Timeline Express - Version 1.0

Version Description

Download this release

Release Info

Developer eherman24
Plugin Icon 128x128 Timeline Express
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (59) hide show
  1. README.md +98 -0
  2. classes/class.timeline-express.php +910 -0
  3. css/timeline-express-settings.css +517 -0
  4. css/timeline-express-settings.min.css +3 -0
  5. css/timeline-express.css +462 -0
  6. css/timeline-express.min.css +4 -0
  7. images/evan_herman_logo.png +0 -0
  8. images/linkedin.png +0 -0
  9. images/rss_icon.png +0 -0
  10. images/timeline-express-icon.png +0 -0
  11. images/timeline-express-menu-icon.png +0 -0
  12. images/twitter.png +0 -0
  13. images/welcome/Font-Awesome-Cheatsheet.png +0 -0
  14. images/welcome/Manage-Announcements.jpg +0 -0
  15. images/welcome/background.png +0 -0
  16. images/welcome/customize-your-timeline.jpg +0 -0
  17. images/welcome/intuitive-creation-screen.jpg +0 -0
  18. images/welcome/timeline-screenshot.png +0 -0
  19. images/wordpress-icon.png +0 -0
  20. js/script.options-color-picker-custom.js +18 -0
  21. js/script.timeline-express.js +82 -0
  22. js/script.timeline-express.min.js +2 -0
  23. js/timeline-express-button-script.js +44 -0
  24. js/timeline-express-menu-icon.png +0 -0
  25. lib/lib.ajax.php +11 -0
  26. lib/metabox/about-template.php +50 -0
  27. lib/metabox/example-functions.php +333 -0
  28. lib/metabox/helpers/timeline_express_MetaBox_ajax.php +180 -0
  29. lib/metabox/helpers/timeline_express_MetaBox_filters.php +65 -0
  30. lib/metabox/helpers/timeline_express_MetaBox_types.php +539 -0
  31. lib/metabox/images/ico-delete.png +0 -0
  32. lib/metabox/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  33. lib/metabox/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  34. lib/metabox/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  35. lib/metabox/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  36. lib/metabox/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  37. lib/metabox/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  38. lib/metabox/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  39. lib/metabox/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  40. lib/metabox/images/ui-icons_222222_256x240.png +0 -0
  41. lib/metabox/images/ui-icons_2e83ff_256x240.png +0 -0
  42. lib/metabox/images/ui-icons_454545_256x240.png +0 -0
  43. lib/metabox/images/ui-icons_888888_256x240.png +0 -0
  44. lib/metabox/images/ui-icons_cd0a0a_256x240.png +0 -0
  45. lib/metabox/init.php +944 -0
  46. lib/metabox/js/cmb.js +335 -0
  47. lib/metabox/js/cmb.min.js +24 -0
  48. lib/metabox/js/jquery.timePicker.min.js +13 -0
  49. lib/metabox/readme.md +159 -0
  50. lib/metabox/style.css +343 -0
  51. lib/metabox/style.min.css +125 -0
  52. lib/process/ajax.php +42 -0
  53. lib/single-announcement-template/how_to_readme.txt +7 -0
  54. lib/single-announcement-template/single-timeline-express-announcement.php +30 -0
  55. license.txt +339 -0
  56. pages/options.php +392 -0
  57. pages/welcome.php +115 -0
  58. readme.txt +114 -0
  59. timeline-express.php +78 -0
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Timeline Express v1.0
2
+ ================
3
+
4
+ Timeline express allows you to create a vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
5
+
6
+ **Features**
7
+
8
+ * Hundreds of Font awesome icons included. Specify a different icon for each announcement
9
+ * CSS3 animations on scroll
10
+ * Set the color of the announcement
11
+ * Specify the length to trim each announcemnt, or randomize it
12
+ * Hide the date of the announcement
13
+ * Hide the 'read more' button for each announcement
14
+ * Specify an image to display for each announcement
15
+ * Delete announcements on uninstallation (so no orphan posts are hanging around in your database)
16
+ * Easy to use shortcode to place the timeline wherever your heart desires ( `[timeline-express]` )
17
+ * TinyMCE button to generate the shortcode
18
+ * Highly extensible
19
+ * Translatable
20
+
21
+
22
+ ### Installation
23
+
24
+ 1. Download the plugin .zip file
25
+ 2. Log in to yourdomain.com/wp-admin
26
+ 3. Click Plugins -> Add New -> Upload
27
+ 4. Activate the plugin
28
+ 6. On the left hand menu, hover over 'Timeline Express' and click 'New Announcement'
29
+ 7. Begin populating the timeline with events. (Note: Events will appear in chronological order according to the <strong>announcement date</strong>)
30
+ 8. Once you have populated the timeline, head over to the settings page (Settings > Timeline Express) to customize your timeline.
31
+ 9. Create a new page, and enter the shortcode [timeline-express] to display the vertical timeline (Note: Timeline Express displays best on full width pages)
32
+
33
+ ### Frequently Asked Questions
34
+
35
+ ###### How do I use this plugin?
36
+ Begin by simply installing the plugin. Once the plugin has been installed, go ahead and begin creating announcement posts. You'll find a new menu item just below 'Posts'.
37
+ After you have a substantial number of announcements set up, you're ready to display the timeline on the front end of your site.
38
+
39
+ Timeline express displays best on full width pages, but is not limited to them. Create a new page, and drop the shortcode into the page - `[timeline-express]`.
40
+ Publish your page, and view it on the front end the see your new super sweet timeline! (scroll for animation effects!)
41
+
42
+ ###### What template is the single announcement post using? Can I customize it at all? I want to do x, y or z.
43
+ The single announcement post is using a custom template file that comes pre-bundled with the plugin. If you want to customize the template for whatever reason
44
+ you can do so, by creating a directory in your active theme called 'timeline-express'. Once the directory is created, simply copy the file titled 'single-timeline-express-announcement.php' into
45
+ the newly created 'timeline-express' directory in your theme. Timeline express will then automagically pull in the newly created template in your theme root. You can go ahead and customize
46
+ it to your hearts desire without fear of losing any changes in future updates!
47
+
48
+ ###### Can I create more than one timeline?
49
+ At the moment no, but I will consider adding that into a futre update if people show enough interest.
50
+
51
+ ###### At what width are the breakpoints set?
52
+ Breakpoints are set at 822px. The timeline will shift/re-adjust automatically using masonry based on the height of each announcement container.
53
+
54
+ ###### How can I translate this plugin?
55
+ The text-domain for all gettext functions is `timeline-express`.
56
+
57
+ If you enjoy this plugin and want to contribute, I'm always looking for people to help translate the plugin into any of the following languages, credit will be given where credit is due :
58
+
59
+ * Arabic
60
+ * Chinese
61
+ * English
62
+ * French
63
+ * German
64
+ * Greek
65
+ * Hebrew
66
+ * Hindi
67
+ * Hong Kong
68
+ * Italian
69
+ * Japanese
70
+ * Korean
71
+ * Persian
72
+ * Portuguese (Brazilian)
73
+ * Portuguese (European)
74
+ * Romanian
75
+ * Russian
76
+ * Spanish
77
+ * Swedish
78
+ * Taiwanese
79
+ * Tamil
80
+ * Urdu
81
+ * Vietnamese
82
+ * Welsh
83
+
84
+ Read the Codex article "[I18n for WordPress Developers]"(http://codex.wordpress.org/I18n_for_WordPress_Developers) for more information.
85
+
86
+ ### Future Ideas
87
+
88
+ Have an idea for a future release feature? I love hearing about new ideas! You can get in contact with me through the contact form on my website, <a href="http://www.evan-herman.com/contact/" target="_blank">Evan-Herman.com</a>.
89
+
90
+
91
+ ### Changelog
92
+ ###### 1.0.0
93
+ * Initial Release to the wordpress respository
94
+
95
+ ### Upgrade Notice
96
+
97
+ ###### 1.0.0
98
+ * Initial Release to the wordpress respository
classes/class.timeline-express.php ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Timeline Express :: Base Class
3
+ // By Evan Herman
4
+ // http://www.Evan-Herman.com
5
+ /***************************************/
6
+ if(!class_exists("timelineExpressBase"))
7
+ {
8
+ class timelineExpressBase
9
+ {
10
+
11
+ /**
12
+ * Variables
13
+ */
14
+ public $sessName = 'timeline_express_session';
15
+ public $timeline_express_optionVal = false;
16
+
17
+ /**
18
+ * Construct
19
+ */
20
+ public function __construct() {
21
+ timelineExpressBase::initialize();
22
+ }
23
+
24
+ /**
25
+ * Destruct
26
+ */
27
+ public function __destruct() {
28
+ unset($this);
29
+ }
30
+
31
+ /**
32
+ * ACTIONS
33
+ * These are called when the plugin is initialized/deactivated/uninstalled
34
+ */
35
+ public function activate() {
36
+ // redirect the user on plugin activation
37
+ // to the timeline express welcome page
38
+ add_option('timeline_express_do_activation_redirect', true);
39
+ }
40
+
41
+ public function deactivate() {
42
+ // clear our re-write rules on deactivate
43
+ delete_option('post_type_rules_flased_te-announcements');
44
+ }
45
+
46
+ public function uninstall() {
47
+ // get+store our options
48
+ $options = get_option(TIMELINE_EXPRESS_OPTION);
49
+ $delete_cpt_option = $options['delete-announcement-posts-on-uninstallation'];
50
+ // Step #1
51
+ // check if the user wants to remove all announcemnts
52
+ // and do so, if set
53
+ if ( $delete_cpt_option == '1' ) {
54
+ // delete all created announcement posts on uninstallation
55
+ global $wpdb; // Must have this or else!
56
+ // set the posts table
57
+ $posts_table = $wpdb->posts;
58
+ // query for our cpt
59
+ $wpdb->query("DELETE FROM " . $posts_table . " WHERE post_type = 'te_announcements'");
60
+ }
61
+ // Step #2
62
+ // delete options on plugin uninstall
63
+ // after we check the 'delete-announcement-posts-on-uninstallation' setting
64
+ delete_option( TIMELINE_EXPRESS_OPTION );
65
+ }
66
+
67
+ /***** INITIAL SETUP
68
+ ****************************************************************************************************/
69
+ public function initialize() {
70
+
71
+ // If it's not already set up, initialize our plugin session
72
+ if( session_id() == '' ) @session_start();
73
+
74
+ if( !is_array( @$_SESSION[$this->sessName] ) ) {
75
+ $_SESSION[$this->sessName] = array();
76
+ }
77
+
78
+ // Add the CSS/JS files - Dashboard
79
+ add_action( 'admin_enqueue_scripts' , array( &$this , 'addStyles' ) );
80
+ add_action( 'admin_enqueue_scripts' , array( &$this , 'addScripts' ) );
81
+
82
+ // redirect on activation
83
+ add_action( 'admin_init' , array( &$this , 'timeline_express_plugin_activation_redirect' ) );
84
+
85
+ // Setup the administration menus
86
+ add_action( 'admin_menu' , array( &$this , 'addAdministrationMenu' ) );
87
+
88
+ // Make sure the option exists
89
+ if( !$this->timeline_express_optionVal ) {
90
+ $this->getTimelineOptionValue();
91
+ }
92
+
93
+ // Setup shortcodes
94
+ $this->timeline_express_createShortcodes();
95
+
96
+ // Do any update tasks if needed
97
+ $this->timeline_express_runUpdateCheck();
98
+
99
+ // Move all "advanced" metaboxes above the default editor
100
+ add_action('edit_form_after_title', function() {
101
+ global $post, $wp_meta_boxes;
102
+ do_meta_boxes(get_current_screen(), 'advanced', $post);
103
+ unset($wp_meta_boxes[get_post_type($post)]['advanced']);
104
+ });
105
+
106
+ // initialize the Metabox class
107
+ add_action( 'init', array( &$this, 'timeline_express_initialize_cmb_meta_boxes' ) , 9998 );
108
+ // Announcement CPT
109
+ add_action( 'init', array( &$this , 'timeline_express_generate_announcement_post_type' ), 0 );
110
+ // change announcement CPT title
111
+ add_filter( 'enter_title_here', array( &$this , 'change_default_announcement_title' ) );
112
+ // enqueue announcement metaboxes
113
+ add_filter( 'cmb_meta_boxes', array( &$this , 'cmb_timeline_announcement_metaboxes' ) );
114
+ // add custom columns to the timeline express announcement cpt
115
+ add_filter('manage_edit-te_announcements_columns', array( &$this, 'add_new_timeline_express_columns' ) );
116
+ // generate the content for each column
117
+ add_action('manage_te_announcements_posts_custom_column', array( &$this, 'manage_timeline_express_column_content' ), 10, 2);
118
+ // make our columns sortable
119
+ add_filter( 'manage_edit-te_announcements_sortable_columns', array( &$this , 'make_sortable_timeline_express_column' ) );
120
+ // custom sort function
121
+ add_action( 'pre_get_posts', array( &$this , 'te_announcements_pre_get_posts' ) , 1 );
122
+ // register custom image size for the edit page
123
+ add_image_size( 'timeline-express-thumbnail', 150, 60, true );
124
+ // register custom image size for the single announcement page
125
+ add_image_size( 'timeline-express-announcement-header', 750, 155, false );
126
+ // load our custom post type single template (to override the default)
127
+ add_filter( 'single_template', array( &$this , 'get_single_page_timeline_express_announcement_template' ) );
128
+ // content filter, to add our announcement image up above before the content
129
+ add_filter( 'the_content', array( &$this , 'timeline_express_single_page_filter_the_content' ) );
130
+ // append a donate button the 'views' section of the edit.php page for te_announcements only
131
+ add_filter( 'views_edit-te_announcements' , array( &$this , 'append_donate_button_on_edit_page' ) );
132
+ // add a tinymce button that generates our shortcode for the user
133
+ add_action( 'admin_head', array( &$this , 'timeline_express_add_tinymce' ) );
134
+
135
+ }
136
+
137
+ // enqueue metabox for the announcement cpt
138
+ public function timeline_express_initialize_cmb_meta_boxes() {
139
+ if ( !class_exists( 'timeline_express_MetaBoxes' ) ) {
140
+ require_once TIMELINE_EXPRESS_PATH.'lib/metabox/init.php';
141
+ }
142
+ }
143
+
144
+ // Register Announcement Custom Post Type
145
+ public function timeline_express_generate_announcement_post_type() {
146
+
147
+ // Register our Release Cycle Custom Post Type
148
+ // used to easily manage the release cycle on the site
149
+ $timeline_express_labels = array(
150
+ 'name' => 'Timeline Express',
151
+ 'singular_name' => 'Announcement', // menu item at the top New > Announcement
152
+ 'menu_name' => 'Timeline Express', // menu name
153
+ 'parent_item_colon' => 'Timeline Express:',
154
+ 'all_items' => 'All Announcements',
155
+ 'view_item' => 'View Announcement',
156
+ 'add_new_item' => 'New Announcement',
157
+ 'add_new' => 'New Announcement',
158
+ 'edit_item' => 'Edit Announcement',
159
+ 'update_item' => 'Update Announcement',
160
+ 'search_items' => 'Search Release Cycle Announcements',
161
+ 'not_found' => 'No Timeline Express Announcements Found',
162
+ 'not_found_in_trash' => 'No Release Cycle Announcements in Trash',
163
+ );
164
+ $timeline_express_rewrite = array(
165
+ 'slug' => 'announcement',
166
+ 'with_front' => false,
167
+ 'pages' => true,
168
+ 'feeds' => true,
169
+ );
170
+ $timeline_express_args = array(
171
+ 'label' => 'timeline-express-announcement',
172
+ 'description' => 'Post type for adding YouTube plus release cycle announcements to the site',
173
+ 'labels' => $timeline_express_labels,
174
+ 'supports' => array( 'title', 'editor' ),
175
+ 'taxonomies' => array(),
176
+ 'hierarchical' => true,
177
+ 'public' => true,
178
+ 'show_ui' => true,
179
+ 'show_in_menu' => true,
180
+ 'show_in_nav_menus' => true,
181
+ 'show_in_admin_bar' => true,
182
+ 'menu_position' => 5,
183
+ 'menu_icon' => TIMELINE_EXPRESS_URL . '/images/timeline-express-menu-icon.png',
184
+ 'can_export' => true,
185
+ 'has_archive' => true,
186
+ 'exclude_from_search' => false,
187
+ 'publicly_queryable' => true,
188
+ 'rewrite' => $timeline_express_rewrite,
189
+ 'capability_type' => 'page',
190
+ );
191
+ register_post_type( 'te_announcements', $timeline_express_args );
192
+ // end release cycle cpt
193
+
194
+ // flush the re-write/permalinks
195
+ $set = get_option('post_type_rules_flased_te-announcements');
196
+ if ($set !== true){
197
+ flush_rewrite_rules(false);
198
+ update_option('post_type_rules_flased_te-announcements',true);
199
+ }
200
+
201
+ }
202
+ // end announcement CPT creation
203
+
204
+
205
+ /**
206
+ * Define the metabox and field configurations.
207
+ *
208
+ * @param array $meta_boxes
209
+ * @return array
210
+ */
211
+ public function cmb_timeline_announcement_metaboxes( array $meta_boxes ) {
212
+
213
+ // Start with an underscore to hide fields from custom fields list
214
+ $prefix = 'announcement_';
215
+
216
+ $meta_boxes['announcement_info'] = array(
217
+ 'id' => 'announcement_info',
218
+ 'title' => __( 'Announcement Info.', 'timeline-express' ),
219
+ 'pages' => array( 'te_announcements', ), // Post type
220
+ 'context' => 'advanced',
221
+ 'priority' => 'high',
222
+ 'show_names' => true, // Show field names on the left
223
+ // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
224
+ 'fields' => array(
225
+ array(
226
+ 'name' => __( 'Announcement Color', 'timeline-express' ),
227
+ 'desc' => __( 'select the color for this announcement.', 'timeline-express' ),
228
+ 'id' => $prefix . 'color',
229
+ 'type' => 'colorpicker',
230
+ 'std' => $this->timeline_express_optionVal['default-announcement-color'],
231
+ // 'repeatable' => true,
232
+ // 'on_front' => false, // Optionally designate a field to wp-admin only
233
+ ),
234
+ array(
235
+ 'name' => __( 'Font Awesome Unicode', 'timeline-express' ),
236
+ 'desc' => __( 'enter the font-awesome class name in the box above. This is used for the icon associated with the announcement. <a href="http://fortawesome.github.io/Font-Awesome/cheatsheet/" target="_blank">cheat sheet</a> Example : "fa-times-circle" ', 'timeline-express' ),
237
+ 'id' => $prefix . 'icon',
238
+ 'type' => 'text_medium',
239
+ 'std' => trim( $this->timeline_express_optionVal['default-announcement-icon'] ),
240
+ // 'repeatable' => true,
241
+ // 'on_front' => false, // Optionally designate a field to wp-admin only
242
+ ),
243
+ array(
244
+ 'name' => __( 'Announcement Date', 'timeline-express' ),
245
+ 'desc' => __( 'enter the date of the announcement. the announcements will appear in chronological order according to this date. ', 'timeline-express' ),
246
+ 'id' => $prefix . 'date',
247
+ 'type' => 'text_date_timestamp',
248
+ 'std' => date( 'm/d/Y'),
249
+ // 'repeatable' => true,
250
+ // 'on_front' => false, // Optionally designate a field to wp-admin only
251
+ ),
252
+ array(
253
+ 'name' => __( 'Announcement Image', 'timeline-express' ),
254
+ 'desc' => __( 'select a banner image for this announcement (optional). (recommended 650px wide or larger) ', 'timeline-express' ),
255
+ 'id' => $prefix . 'image',
256
+ 'type' => 'file',
257
+ // 'repeatable' => true,
258
+ // 'on_front' => false, // Optionally designate a field to wp-admin only
259
+ ),
260
+ ),
261
+ );
262
+
263
+ $meta_boxes['about_the_author'] = array(
264
+ 'id' => 'about_the_author',
265
+ 'title' => __( 'About', 'timeline-express' ),
266
+ 'pages' => array( 'te_announcements', ), // Post type
267
+ 'context' => 'side',
268
+ 'priority' => 'low',
269
+ 'show_names' => false, // Show field names on the left
270
+ // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
271
+ 'fields' => array(
272
+ array(
273
+ 'name' => __( '', 'timeline-express' ),
274
+ 'desc' => __( '', 'timeline-express' ),
275
+ 'id' => $prefix . 'about',
276
+ 'type' => 'custom_about_the_author_callback',
277
+ ),
278
+ ),
279
+ );
280
+
281
+ // Add other metaboxes as needed
282
+ return $meta_boxes;
283
+
284
+ }
285
+ // End metabox definitions
286
+
287
+
288
+ /* Change Testimonial Title */
289
+ public function change_default_announcement_title( $title ){
290
+ $screen = get_current_screen();
291
+ if ( 'te_announcements' == $screen->post_type ) {
292
+ $title = __( 'Enter Announcement Title' , 'timeline-express' );
293
+ }
294
+ return $title;
295
+ }
296
+
297
+ /* Add Custom Columns to Announcement page */
298
+ public function add_new_timeline_express_columns($timeline_express_columns) {
299
+ $timeline_express_announcement_columns['cb'] = '<input type="checkbox" />';
300
+ $timeline_express_announcement_columns['title'] = _x('Announcement Name', 'column name');
301
+ $timeline_express_announcement_columns['color'] = _x('Color', 'column name');
302
+ $timeline_express_announcement_columns['icon'] = _x('Icon', 'column name');
303
+ $timeline_express_announcement_columns['announcement_date'] = _x('Announcement Date', 'column name');
304
+ $timeline_express_announcement_columns['image'] = _x('Image', 'column name');
305
+ $timeline_express_announcement_columns['past_announcement'] = _x('Announcment Past?', 'column name');
306
+ return $timeline_express_announcement_columns;
307
+ }
308
+
309
+ /* Generate the content for our columns */
310
+ public function manage_timeline_express_column_content($column_name, $id) {
311
+
312
+ switch ($column_name) {
313
+
314
+ case 'color':
315
+ $announcement_color = get_post_meta( $id , 'announcement_color' , true );
316
+ echo '<span class="announcement_color_box" style="background-color:' . $announcement_color . ';" title="' . $announcement_color . '"></span>';
317
+ break;
318
+
319
+ case 'icon':
320
+ $announcement_icon = get_post_meta( $id , 'announcement_icon' , true );
321
+ echo '<span class="fa ' . $announcement_icon . ' edit-announcement-icon" title="' . $announcement_icon . '"></span>';
322
+ break;
323
+
324
+ case 'announcement_date':
325
+ $announcment_date = get_post_meta( $id , 'announcement_date' , true );
326
+ echo date( 'l, F jS, Y' , $announcment_date );
327
+ break;
328
+
329
+ case 'image':
330
+ global $wpdb;
331
+ $announcement_image = get_post_meta( $id , 'announcement_image' , true );
332
+ if ( $announcement_image != '' ) {
333
+ $announcement_image_id = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $announcement_image ));
334
+ $announcement_image_thumbnail = wp_get_attachment_image_src( $announcement_image_id[0] , 'timeline-express-thumbnail' );
335
+ echo '<img src="' . esc_url( $announcement_image_thumbnail[0] ) . '">';
336
+ } else {
337
+ echo '<span class="no-image-used-text"><em>n/a</em></span>'; // blank spot for spacing
338
+ }
339
+ break;
340
+
341
+ case 'past_announcement':
342
+ $announcment_date = get_post_meta( $id , 'announcement_date' , true );
343
+ $todays_date = strtotime( date( 'm/d/Y' ) );
344
+
345
+ if ( $announcment_date < $todays_date ) {
346
+ echo '<div class="dashicon-past-announcement dashicons dashicons-backup" title="announcement has past..."></div>';
347
+ }
348
+
349
+ break;
350
+
351
+ default:
352
+ break;
353
+
354
+ } // end switch
355
+ }
356
+
357
+ // Make sortable columns function
358
+ public function make_sortable_timeline_express_column( $columns ) {
359
+ $columns['announcement_date'] = 'announcement_date';
360
+
361
+ //To make a column 'un-sortable' remove it from the array
362
+ //unset($columns['date']);
363
+
364
+ return $columns;
365
+ }
366
+
367
+ // Custom Column Sorting
368
+ function te_announcements_pre_get_posts( $query ) {
369
+
370
+ /**
371
+ * We only want our code to run in the main WP query
372
+ * AND if an orderby query variable is designated.
373
+ */
374
+ if ( $query->is_main_query() && ( $orderby = $query->get( 'orderby' ) ) ) {
375
+
376
+ switch( $orderby ) {
377
+
378
+ // If we're ordering by 'announcement_date'
379
+ case 'announcement_date':
380
+ // set our query's meta_key, which is used for custom fields
381
+ $query->set( 'meta_key', 'announcement_date' );
382
+ $query->set( 'orderby', 'meta_value meta_value_num' );
383
+ break;
384
+
385
+ }
386
+
387
+ }
388
+
389
+ }
390
+
391
+ // register our shortcodes
392
+ public function timeline_express_createShortcodes() {
393
+ add_shortcode('timeline-express', array(&$this, 'processShortcode'));
394
+ }
395
+
396
+ // Create and store our initial plugin options
397
+ public function getTimelineOptionValue() {
398
+ $timeline_express_defaultVals = array(
399
+ 'version' => TIMELINE_EXPRESS_VERSION_CURRENT,
400
+ 'timeline-title' => "Timeline Express",
401
+ 'timeline-title-alignment' => "left",
402
+ 'timeline-title-size' => "h1",
403
+ 'default-announcement-color' => '#75CE66',
404
+ 'excerpt-trim-length' => '30',
405
+ 'excerpt-random-length' => '0',
406
+ 'read-more-visibility' => '1',
407
+ 'date-visibility' => '1',
408
+ 'default-announcement-icon' => "fa-exclamation-triangle",
409
+ 'announcement-time-frame' => "0",
410
+ 'no-events-message' => "No announcements found",
411
+ 'announcement-bg-color' => "#EFEFEF",
412
+ 'announcement-box-shadow-color' => "#B9C5CD",
413
+ 'announcement-background-line-color' => '#D7E4ED',
414
+ 'delete-announcement-posts-on-uninstallation' => '0'
415
+ );
416
+ $ov = get_option( TIMELINE_EXPRESS_OPTION , $timeline_express_defaultVals );
417
+ $this->timeline_express_optionVal = $ov;
418
+ return $ov;
419
+ }
420
+
421
+ // Update check
422
+ // compare stored version to current version
423
+ private function timeline_express_runUpdateCheck() {
424
+ if( !isset( $this->timeline_express_optionVal['version'] ) || $this->timeline_express_optionVal['version'] < TIMELINE_EXPRESS_VERSION_CURRENT ) {
425
+ $this->runUpdateTasks();
426
+ }
427
+ }
428
+
429
+
430
+ /***** FUNCTIONS
431
+ ****************************************************************************************************/
432
+
433
+ /* TinyMCE Button Functions */
434
+
435
+ // register our button for the custom post type
436
+ public function timeline_express_add_tinymce() {
437
+ global $typenow;
438
+ // only on Post Type: post and page
439
+ if( ! in_array( $typenow, array( 'page' , 'post' ) ) )
440
+ return;
441
+ add_filter( 'mce_external_plugins', array( &$this , 'timeline_express_add_tinymce_plugin' ) );
442
+ add_filter( 'mce_buttons', array( &$this , 'timeline_express_add_tinymce_button' ) );
443
+ }
444
+
445
+ // inlcude the js for tinymce
446
+ public function timeline_express_add_tinymce_plugin( $plugin_array ) {
447
+ $plugin_array['timeline_express'] = plugins_url( 'timeline-express/js/timeline-express-button-script.js' );
448
+ // Print all plugin js path
449
+ // var_dump( $plugin_array );
450
+ return $plugin_array;
451
+ }
452
+
453
+ // Add the button key for address via JS
454
+ function timeline_express_add_tinymce_button( $buttons ) {
455
+ array_push( $buttons, 'timeline_express_shortcode_button' );
456
+ // Print all buttons
457
+ // var_dump( $buttons );
458
+ return $buttons;
459
+ }
460
+ // end tinymce button functions
461
+
462
+
463
+ // append donation button to list table
464
+ public function append_donate_button_on_edit_page( $views ) {
465
+ $current_user_object = wp_get_current_user();
466
+ $current_user_name = $current_user_object->user_firstname;
467
+ $current_user_name .= ' ' . $current_user_object->user_lastname;
468
+ $views[] .= '<a href="http://www.evan-herman.com/contact/?contact-name=' . $current_user_name . '&contact-reason=I want to make a donation for all your hard work" target="_blank"><i class="fa fa-paypal" style="color:#253b80;"></i> Donate</a>';
469
+ return $views;
470
+ }
471
+
472
+ // load a custom template file for single announcements
473
+ // when this is copied to the theme root, users can override
474
+ // and customize the template file
475
+ function get_single_page_timeline_express_announcement_template($single_template) {
476
+ global $post;
477
+ // check if the user has created a copy localy
478
+ // if so , we'll use it
479
+ if ( file_exists( get_template_directory() . '/timeline-express/single-timeline-express-announcement.php' ) ) {
480
+ if ($post->post_type == 'te_announcements') {
481
+ $single_template = get_template_directory() . '/single-timeline-express-announcement.php';
482
+ }
483
+ return $single_template;
484
+ } else { // load the defualt one from the plugin
485
+ if ($post->post_type == 'te_announcements') {
486
+ $single_template = TIMELINE_EXPRESS_PATH . 'lib/single-announcement-template/single-timeline-express-announcement.php';
487
+ }
488
+ return $single_template;
489
+ }
490
+
491
+ }
492
+
493
+ // Filter the content and append our custom image
494
+ function timeline_express_single_page_filter_the_content( $content ) {
495
+ global $post;
496
+ if ( is_single() && $post->post_type == 'te_announcements') {
497
+ global $wpdb;
498
+ // grab the attached image
499
+ $announcement_image = esc_url( get_post_meta( $post->ID , 'announcement_image' , true ) );
500
+ $announcement_date = get_post_meta( $post->ID , 'announcement_date' , true );
501
+ $referer = $_SERVER['HTTP_REFERER'];
502
+ if ( $announcement_image != '' ) {
503
+ $announcement_image_id = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $announcement_image ));
504
+ $announcement_header_image = wp_get_attachment_image_src( $announcement_image_id[0] , 'timeline-express-announcement-header');
505
+ $custom_content = '<img class="announcement-banner-image" src="' . esc_url ( $announcement_header_image[0] ) . '" alt="' . get_the_title( $post->ID ) . '">';
506
+ $custom_content .= '<strong class="timeline-express-single-page-announcement-date">Announcement Date : ' . date( 'M j , Y' , $announcement_date ) . '</strong>';
507
+ $custom_content .= $content;
508
+ if ( $referer != '' ) {
509
+ $custom_content .= '<a href="' . $referer . '" class="return-to-timeline"><i class="fa fa-chevron-left"></i> ' . __( 'Back' , 'timeline-express' ) . '</a>';
510
+ }
511
+ return $custom_content;
512
+ } else {
513
+ $custom_content = '<strong class="timeline-express-single-page-announcement-date">Announcement Date : ' . date( 'M j , Y' , $announcement_date ) . '</strong>';
514
+ $custom_content .= $content;
515
+ if ( $referer != '' ) {
516
+ $custom_content .= '<a href="' . $referer . '" class="return-to-timeline"><i class="fa fa-chevron-left"></i> ' . __( 'Back' , 'timeline-express' ) . '</a>';
517
+ }
518
+ return $custom_content;
519
+ }
520
+ } else {
521
+ return $content;
522
+ }
523
+ }
524
+
525
+
526
+ /***** CONFIGURATION
527
+ ****************************************************************************************************/
528
+ // Update our plugin options
529
+ // Runs when the user updates the settings page with new values
530
+ public function updateOptions( $p ) {
531
+ if( !empty( $p['form_data'] ) ) {
532
+ parse_str($p['form_data'], $fd);
533
+ $this->timeline_express_optionVal['timeline-title'] = stripslashes( $fd['timeline-title'] );
534
+ $this->timeline_express_optionVal['timeline-title-alignment'] = $fd['timeline-title-alignment'];
535
+ $this->timeline_express_optionVal['timeline-title-size'] = $fd['timeline-title-size'];
536
+ $this->timeline_express_optionVal['default-announcement-color'] = $fd['default-announcement-color'];
537
+ $this->timeline_express_optionVal['excerpt-trim-length'] = $fd['excerpt-trim-length'];
538
+ $this->timeline_express_optionVal['excerpt-random-length'] = isset( $fd['excerpt-random-length'] ) ? '1' : '0';
539
+ $this->timeline_express_optionVal['read-more-visibility'] = $fd['read-more-visibility'];
540
+ $this->timeline_express_optionVal['date-visibility'] = $fd['date-visibility'];
541
+ $this->timeline_express_optionVal['default-announcement-icon'] = $fd['default-announcement-icon'];
542
+ $this->timeline_express_optionVal['announcement-time-frame'] = $fd['announcement-time-frame'];
543
+ $this->timeline_express_optionVal['no-events-message'] = stripslashes( $fd['no-events-message'] );
544
+ $this->timeline_express_optionVal['announcement-bg-color'] = stripslashes( $fd['announcement-bg-color'] );
545
+ $this->timeline_express_optionVal['announcement-box-shadow-color'] = $fd['announcement-box-shadow-color'];
546
+ $this->timeline_express_optionVal['announcement-background-line-color'] = $fd['announcement-background-line-color'];
547
+ $this->timeline_express_optionVal['delete-announcement-posts-on-uninstallation'] = isset( $fd['delete-announcement-posts-on-uninstallation'] ) ? '1' : '0';
548
+ return update_option( TIMELINE_EXPRESS_OPTION, $this->timeline_express_optionVal );
549
+ }
550
+ return false;
551
+ }
552
+
553
+ // Update the version number
554
+ public function updateVersion( $k ) {
555
+ $this->timeline_express_optionVal['version'] = $k;
556
+ return update_option(TIMELINE_EXPRESS_OPTION, $this->timeline_express_optionVal);
557
+ }
558
+
559
+ /***** SCRIPTS/STYLES
560
+ ****************************************************************************************************/
561
+
562
+ // add styles to the dashboard
563
+ public function addStyles() {
564
+
565
+ $screen = get_current_screen();
566
+ $print_styles_on_screen_array = array( 'settings_page_timeline-express-settings' , 'admin_page_timeline-express-welcome' );
567
+
568
+ if ( in_array( $screen->base , $print_styles_on_screen_array ) || in_array( $screen->id, array( 'edit-te_announcements' ) ) ) {
569
+ // Register Styles
570
+ wp_register_style( 'timeline-express-css-base', TIMELINE_EXPRESS_URL . 'css/timeline-express-settings.min.css' , array(), '1.0.0', 'all');
571
+ // Enqueue Styles
572
+ wp_enqueue_style('timeline-express-css-base');
573
+ // enqueue font awesome for use in column display
574
+ wp_enqueue_style( 'prefix-font-awesome' , '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' , array() , '4.2.0' );
575
+ }
576
+
577
+ }
578
+
579
+ // add scripts to the admin side
580
+ public function addScripts() {
581
+ $screen = get_current_screen();
582
+ global $post;
583
+ if ( in_array( $screen->base , array('settings_page_timeline-express-settings') ) || $screen->post_type == 'te_announcements' ) {
584
+ // enqueue the admin scripts here
585
+ // Add the color picker css file
586
+ // used to select colors on the settings page
587
+ wp_enqueue_style( 'wp-color-picker' );
588
+ wp_enqueue_script( 'wp-color-picker' );
589
+
590
+ wp_enqueue_script( 'jquery-ui-dialog' );
591
+ wp_enqueue_style( "wp-jquery-ui-dialog" );
592
+
593
+ // enqueue custom color picker files
594
+ wp_enqueue_script( 'options-color-picker-custom' , TIMELINE_EXPRESS_URL . 'js/script.options-color-picker-custom.js' , array( 'jquery' , 'wp-color-picker' ) , '' , true );
595
+ }
596
+ }
597
+
598
+ // redirect the user to the settings page on initial activation
599
+ function timeline_express_plugin_activation_redirect() {
600
+ if ( get_option( 'timeline_express_do_activation_redirect' , false ) ) {
601
+ delete_option( 'timeline_express_do_activation_redirect' );
602
+ // redirect to settings page
603
+ wp_redirect( admin_url( '/admin.php?page=timeline-express-welcome' ) );
604
+ }
605
+ }
606
+
607
+ // enqueue scripts on the frontend
608
+ public function addScripts_frontend() {
609
+ // Everything else
610
+ // load our scripts in the dashboard
611
+ wp_enqueue_script( 'timeline-express-js-base' , TIMELINE_EXPRESS_URL . 'js/script.timeline-express.min.js' , array( 'jquery' ) );
612
+ // masonry for layout
613
+ wp_enqueue_script( 'jquery-masonry' );
614
+ }
615
+
616
+ // add styles to the front end
617
+ public function addStyles_frontend() {
618
+ // Register Styles
619
+ wp_register_style( 'timeline-express-base', TIMELINE_EXPRESS_URL . 'css/timeline-express.min.css' , array() , '' , 'all' );
620
+ // Enqueue Styles
621
+ wp_enqueue_style( 'timeline-express-base' );
622
+ // enqueue font awesome for use in the timeline
623
+ wp_enqueue_style( 'prefix-font-awesome' , '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' , array() , '4.2.0' );
624
+ }
625
+
626
+ /***** SHORTCODE
627
+ ****************************************************************************************************/
628
+ // Function to process the shortcode provided by the plugin
629
+ // $p is the data associated with the shortcode (ie: form id and submit button text)
630
+ public function processShortcode( $p ) {
631
+ // enqueue our scripts + styles
632
+ $this->addScripts_frontend();
633
+ $this->addStyles_frontend();
634
+
635
+ // start the object buffer
636
+ ob_start();
637
+
638
+ // store the element wrap
639
+ $title_wrap = $this->timeline_express_optionVal['timeline-title-size'];
640
+ $title_alignment = $this->timeline_express_optionVal['timeline-title-alignment'];
641
+
642
+ // get and store the color options
643
+ $content_background = $this->timeline_express_optionVal['announcement-bg-color'];
644
+ $content_shadow = $this->timeline_express_optionVal['announcement-box-shadow-color'];
645
+ $background_line_color = $this->timeline_express_optionVal['announcement-background-line-color'];
646
+
647
+ $current_date = strtotime( date( 'm/d/Y' ) );
648
+
649
+ $compare = $this->timeline_express_optionVal['announcement-time-frame'];
650
+
651
+ switch( $compare ) {
652
+ case '0':
653
+ $compare_sign = '>=';
654
+ break;
655
+
656
+ case '1':
657
+ $compare_sign = '';
658
+ break;
659
+
660
+ case '2':
661
+ $compare_sign = '<=';
662
+ break;
663
+ }
664
+
665
+ // if the announcement setting
666
+ // is set to All Announcements
667
+ // let's query them all
668
+ if ( $compare_sign == '' ) {
669
+ // set up the announcement arguments
670
+ $announcement_args = array(
671
+ 'post_type' => 'te_announcements',
672
+ 'meta_key' => 'announcement_date',
673
+ 'orderby' => 'meta_value_num',
674
+ 'order' => 'ASC',
675
+ 'posts_per_page' => -1,
676
+ );
677
+ } else {
678
+ // else we only want to query what we
679
+ // have specified;;
680
+ $announcement_args = array(
681
+ 'post_type' => 'te_announcements',
682
+ 'meta_key' => 'announcement_date',
683
+ 'orderby' => 'meta_value_num',
684
+ 'order' => 'ASC',
685
+ 'posts_per_page' => -1,
686
+ 'meta_query' => array(
687
+ array(
688
+ 'key' => 'announcement_date',
689
+ 'value' => $current_date,
690
+ 'compare' => $compare_sign,
691
+ ),
692
+ ),
693
+ );
694
+ }
695
+ // end setting up query args
696
+
697
+ $announcement_query = new WP_Query( $announcement_args );
698
+
699
+ if ( $announcement_query->have_posts() ) {
700
+ ?>
701
+ <!-- style the arrow that points at the icon -->
702
+ <style>
703
+ .cd-timeline-title {
704
+ display: block;
705
+ text-align: <?php echo $title_alignment; ?>;
706
+ }
707
+ .cd-timeline-block:nth-child(odd) .cd-timeline-content::before {
708
+ border-left-color: <?php if ( $content_background == '' ) { echo 'transparent'; } else { echo $content_background . '!important'; } ?>;
709
+ }
710
+ .cd-timeline-block:nth-child(even) .cd-timeline-content::before {
711
+ border-right-color: <?php if ( $content_shadow == '' ) { echo 'transparent'; } else { echo $content_background. '!important'; } ?>;
712
+ }
713
+ #cd-timeline::before {
714
+ background: <?php if ( $background_line_color == '' ) { echo 'transparent'; } else { echo $background_line_color. '!important'; } ?>;
715
+ }
716
+ @media only screen and (max-width: 822px) {
717
+ .cd-timeline-content::before {
718
+ border-left-color: transparent;
719
+ border-right-color: <?php if ( $content_background == '' ) { echo 'transparent'; } else { echo $content_background. '!important'; } ?>;
720
+ }
721
+ .cd-timeline-block:nth-child(odd) .cd-timeline-content::before {
722
+ border-left-color: transparent !important;
723
+ }
724
+ }
725
+ </style>
726
+
727
+ <<?php echo $title_wrap; ?> class="cd-timeline-title"><?php if ( $this->timeline_express_optionVal['timeline-title'] != '' ) { echo apply_filters( 'the_title' , $this->timeline_express_optionVal['timeline-title'] ); } ?></<?php echo $title_wrap; ?>>
728
+ <section id="cd-timeline" class="cd-container"><?php
729
+
730
+ while( $announcement_query->have_posts() ) {
731
+ $announcement_query->the_post();
732
+ global $post;
733
+
734
+ $announcement_image = esc_url( get_post_meta( $post->ID , 'announcement_image' , true ) );
735
+ ?>
736
+ <div class="cd-timeline-block">
737
+ <!-- icon -->
738
+ <?php if ( $this->timeline_express_optionVal['read-more-visibility'] != 0 ) { ?>
739
+ <a class="cd-timeline-icon-link" href="<?php echo get_the_permalink( $post->ID ); ?>">
740
+ <div class="cd-timeline-img cd-picture" style="background:<?php echo get_post_meta( $post->ID , 'announcement_color' , true ); ?>;">
741
+ <span class="fa <?php echo get_post_meta( $post->ID , 'announcement_icon' , true ); ?>" title="<?php echo get_the_title( $post->ID ); ?>"></span>
742
+ </div> <!-- cd-timeline-img -->
743
+ </a>
744
+ <?php } else { ?>
745
+ <div class="cd-timeline-img cd-picture" style="background:<?php echo get_post_meta( $post->ID , 'announcement_color' , true ); ?>;">
746
+ <span class="fa <?php echo get_post_meta( $post->ID , 'announcement_icon' , true ); ?>" title="<?php echo get_the_title( $post->ID ); ?>"></span>
747
+ </div> <!-- cd-timeline-img -->
748
+ <?php } ?>
749
+ <!-- content/date/etc. -->
750
+ <div class="cd-timeline-content" style="background:<?php if ( $content_background == '' ) { echo 'transparent'; } else { echo $content_background; } ?>;box-shadow: 0 3px 0 <?php if ( $content_shadow == '' ) { echo 'transparent'; } else { echo $content_shadow; } ?>;">
751
+ <!-- title -->
752
+ <span class="cd-timeline-title-container"><h2 class="cd-timeline-item-title"><?php the_title();?></h2><?php if ( $this->timeline_express_optionVal['date-visibility'] == 1 ) { ?>
753
+ <!-- release date -->
754
+ <span class="timeline-date"><?php echo date( 'M j , Y' , get_post_meta( $post->ID , 'announcement_date' , true ) ); ?></span>
755
+ <?php } ?></span>
756
+ <?php if ( $announcement_image != '' ) { ?>
757
+ <img src="<?php echo $announcement_image; ?>" class="cd-timeline-announcement-image">
758
+ <?php }
759
+ // excerpt random length
760
+ if( $this->timeline_express_optionVal['excerpt-random-length'] == 1 ) {
761
+ // lets trim it at some random value,
762
+ // to switch it up a bit
763
+ $random_number = array( );
764
+ $random_selection = array_rand( $random_number );
765
+ $trim_array = array( "50" , "52" , "55" , "60" , "66" , "70" , "75" , "82", "45", "40", "48" , "58", "78" , "100" , "80" , "93" , "35" , "25" , "120" , "99" , "85" , "82" );
766
+ $random_trim = array_rand( $trim_array );
767
+ // if the user wants to hide read more,
768
+ // we should remove the elipses
769
+ if ( $this->timeline_express_optionVal['read-more-visibility'] == 0 ) {
770
+ $elipses = '';
771
+ } else {
772
+ $elipses = __( '...' , 'timeline-express' ) ;
773
+ }
774
+ // set up the readmore button
775
+ if ( $this->timeline_express_optionVal['read-more-visibility'] == 0 ) {
776
+ $elipses = '';
777
+ $read_more_button = '';
778
+ } else {
779
+ $elipses = __( '...' , 'timeline-express' );
780
+ // $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
781
+ $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
782
+ }
783
+ ?>
784
+ <span class="the-excerpt"><?php echo apply_filters( 'the_content' , wp_trim_words( get_the_content() , $trim_array[$random_trim] , $elipses ) ); ?></span>
785
+ <?php
786
+ } else {
787
+ $trim_length = $this->timeline_express_optionVal['excerpt-trim-length'];
788
+ if ( $this->timeline_express_optionVal['read-more-visibility'] == 0 ) {
789
+ $elipses = '';
790
+ $read_more_button = '';
791
+ } else {
792
+ $elipses = __( '...' , 'timeline-express' );
793
+ $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
794
+ }
795
+ ?>
796
+ <span class="the-excerpt"><?php echo apply_filters( 'the_content' , wp_trim_words( get_the_content() , $trim_length , $elipses ) ); ?></span>
797
+ <?php
798
+ }
799
+ ?>
800
+ <!-- readmore link -->
801
+ <?php echo $read_more_button; ?>
802
+ </div> <!-- cd-timeline-content -->
803
+
804
+ </div> <!-- cd-timeline-block -->
805
+ <?php
806
+ }
807
+
808
+ ?></section><!-- Timeline Express by Evan Herman - http://www.Evan-Herman.com --><?php
809
+ wp_reset_query();
810
+
811
+ } else {
812
+ ?>
813
+ <h2><?php echo $this->timeline_express_optionVal['no-events-message']; ?></h2>
814
+ <?php
815
+ }
816
+ $shortcode = ob_get_contents();
817
+ ob_end_clean();
818
+ return $shortcode;
819
+ }
820
+
821
+ /***** ADMINISTRATION MENUS
822
+ ****************************************************************************************************/
823
+ public function addAdministrationMenu() {
824
+ // Sub Items
825
+ // Settings Page
826
+ add_submenu_page('options-general.php', __('Timeline Express Settings','timeline-express-text-domain'), __('Timline Express','timeline-express-text-domain'), 'manage_options', 'timeline-express-settings', array(&$this, 'generateOptionsPage'));
827
+ // Welcome Page
828
+ add_submenu_page('options.php', __('Timeline Express Welcome','timeline-express-text-domain'), __('Timeline Express Welcome','timeline-express-text-domain'), 'manage_options', 'timeline-express-welcome', array(&$this, 'generateWelcomePage'));
829
+ }
830
+
831
+
832
+ /***** ADMINISTRATION PAGES
833
+ ****************************************************************************************************/
834
+ public function generateOptionsPage() {
835
+ require_once TIMELINE_EXPRESS_PATH . 'pages/options.php'; // include our options page
836
+ }
837
+ public function generateAboutPage() {
838
+ require_once TIMELINE_EXPRESS_PATH . 'pages/about.php'; // include our about page
839
+ }
840
+ public function generateWelcomePage() {
841
+ require_once TIMELINE_EXPRESS_PATH . 'pages/welcome.php'; // include our welcome page
842
+ }
843
+
844
+
845
+ /***** FORM DATA
846
+ ****************************************************************************************************/
847
+ public function resetPluginSettings() {
848
+ // reset the plugin settings back to defaults
849
+ $this->timeline_express_optionVal['version'] = TIMELINE_EXPRESS_VERSION_CURRENT;
850
+ $this->timeline_express_optionVal['timeline-title'] = "Timeline Express";
851
+ $this->timeline_express_optionVal['timeline-title-alignment'] = "left";
852
+ $this->timeline_express_optionVal['timeline-title-size'] = "h1";
853
+ $this->timeline_express_optionVal['default-announcement-color'] = '#75CE66';
854
+ $this->timeline_express_optionVal['excerpt-trim-length'] = '30';
855
+ $this->timeline_express_optionVal['excerpt-random-length'] = '0';
856
+ $this->timeline_express_optionVal['read-more-visibility'] = '1';
857
+ $this->timeline_express_optionVal['date-visibility'] = '1';
858
+ $this->timeline_express_optionVal['default-announcement-icon'] = "fa-exclamation-triangle";
859
+ $this->timeline_express_optionVal['announcement-time-frame'] = "0";
860
+ $this->timeline_express_optionVal['no-events-message'] = "No announcements found";
861
+ $this->timeline_express_optionVal['announcement-bg-color'] = "#EFEFEF";
862
+ $this->timeline_express_optionVal['announcement-box-shadow-color'] = "#B9C5CD";
863
+ $this->timeline_express_optionVal['announcement-background-line-color'] = '#D7E4ED';
864
+ $this->timeline_express_optionVal['delete-announcement-posts-on-uninstallation'] = '0';
865
+ return update_option( TIMELINE_EXPRESS_OPTION, $this->timeline_express_optionVal );
866
+ }
867
+
868
+
869
+
870
+ /***** UPDATES
871
+ ****************************************************************************************************/
872
+ public function runUpdateTasks() {
873
+ $currentVersion = ( !isset( $this->timeline_express_optionVal['version'] ) || empty( $this->timeline_express_optionVal['version'] ) ? '1.0.0' : $this->timeline_express_optionVal['version'] );
874
+ $latestVersion = TIMELINE_EXPRESS_VERSION_CURRENT;
875
+ if( $currentVersion < $latestVersion )
876
+ {
877
+ $updateFunction = 'runUpdateTasks_'.str_replace('.', '_', $currentVersion);
878
+ if( !method_exists( $this, $updateFunction ) ) return false;
879
+ else
880
+ {
881
+ if( call_user_func( array( &$this , $updateFunction ) ) )
882
+ {
883
+ update_option( TIMELINE_EXPRESS_OPTION, TIMELINE_EXPRESS_VERSION_CURRENT );
884
+ $this->runUpdateTasks();
885
+ }
886
+ }
887
+ }
888
+ else return false;
889
+ }
890
+
891
+ /**
892
+ * Future update function to add missing options etc.
893
+ *
894
+ * 1.0.0 => 1.0.1
895
+ private function runUpdateTasks_1_0_1() {
896
+
897
+ }
898
+ */
899
+
900
+ } // end class timelineExpressBase
901
+ } // end if class exists check
902
+
903
+
904
+ /**************************************
905
+ // enjoy the plugin :)
906
+ // Author : Evan Herman
907
+ // Contact : http://www.Evan-Herman.com/contact/
908
+ **************************************/
909
+
910
+ ?>
css/timeline-express-settings.css ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*******************************************/
2
+ /* Timeline Express Settings Styles */
3
+ /******************************************/
4
+
5
+ /* Red Button Style - Settings Page*/
6
+ .wp-core-ui .timeline-express-red-button {
7
+ background-color: #9B2124;
8
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#C5292E), to(#9B2124));
9
+ background-image: -webkit-linear-gradient(top, #C5292E, #9B2124);
10
+ background-image: -moz-linear-gradient(top, #C5292E, #9B2124);
11
+ background-image: -ms-linear-gradient(top, #C5292E, #9B2124);
12
+ background-image: -o-linear-gradient(top, #C5292E, #9B2124);
13
+ background-image: linear-gradient(to bottom, #C5292E, #9B2124);
14
+ border-color: #9B2124;
15
+ border-bottom-color: #8D1F21;
16
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
17
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
18
+ color: #fff;
19
+ text-decoration: none;
20
+ text-shadow: 0 1px 0 rgba(0,0,0,0.1);
21
+ margin-left: 2em;
22
+ width:150px;
23
+ text-align:center;
24
+ }
25
+
26
+ .wp-core-ui .timeline-express-red-button.hover,
27
+ .wp-core-ui .timeline-express-red-button:hover,
28
+ .wp-core-ui .timeline-express-red-button.focus,
29
+ .wp-core-ui .timeline-express-red-button:focus {
30
+ background-color: #B72629;
31
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#D22E30), to(#9B2124));
32
+ background-image: -webkit-linear-gradient(top, #D22E30, #9B2124);
33
+ background-image: -moz-linear-gradient(top, #D22E30, #9B2124);
34
+ background-image: -ms-linear-gradient(top, #D22E30, #9B2124);
35
+ background-image: -o-linear-gradient(top, #D22E30, #9B2124);
36
+ background-image: linear-gradient(to bottom, #D22E30, #9B2124);
37
+ border-color: #7F1C1F;
38
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
39
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
40
+ color: #fff;
41
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
42
+ }
43
+
44
+ .wp-core-ui .timeline-express-red-button.focus,
45
+ .wp-core-ui .timeline-express-red-button:focus {
46
+ border-color: #500F0E;
47
+ -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);
48
+ box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);
49
+ }
50
+
51
+ .wp-core-ui .timeline-express-red-button.active,
52
+ .wp-core-ui .timeline-express-red-button.active:hover,
53
+ .wp-core-ui .timeline-express-red-button.active:focus,
54
+ .wp-core-ui .timeline-express-red-button:active {
55
+ background: #7F1C1F;
56
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#9B2124), to(#B72629));
57
+ background-image: -webkit-linear-gradient(top, #9B2124, #B72629);
58
+ background-image: -moz-linear-gradient(top, #9B2124, #B72629);
59
+ background-image: -ms-linear-gradient(top, #9B2124, #B72629);
60
+ background-image: -o-linear-gradient(top, #9B2124, #B72629);
61
+ background-image: linear-gradient(to bottom, #9B2124, #B72629);
62
+ border-color: #601312 #AE2426 #AE2426 #AE2426;
63
+ color: rgba(255,255,255,0.95);
64
+ -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
65
+ box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
66
+ text-shadow: 0 1px 0 rgba(0,0,0,0.1);
67
+ }
68
+
69
+ .wp-core-ui .timeline-express-red-button[disabled],
70
+ .wp-core-ui .timeline-express-red-button:disabled,
71
+ .wp-core-ui .timeline-express-red-button-disabled {
72
+ color: #E79496 !important;
73
+ background: #BA292B !important;
74
+ border-color: #7F1C1F !important;
75
+ -webkit-box-shadow: none !important;
76
+ box-shadow: none !important;
77
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.1) !important;
78
+ cursor: default;
79
+ }
80
+
81
+ /* Icon */
82
+ #timeline-express-icon {
83
+ background: transparent url('../images/timeline-express-icon.png') no-repeat 0 0;
84
+ display:block;
85
+ float:left;
86
+ padding: 0 0 0 .5em;
87
+ height: 75px;
88
+ width: 75px;
89
+ background-size: contain;
90
+ margin-bottom: .5em;
91
+ }
92
+
93
+ /* Settings Page Header */
94
+ .wrap #timeline-express-page-header {
95
+ padding-top:0;
96
+ margin: 1em 0 0 0;
97
+ font-size: 25px;
98
+ line-height: 3;
99
+ }
100
+
101
+ .wrap .nav-tab-wrapper {
102
+ padding-top:2.5em;
103
+ }
104
+
105
+ .wrap .account-nav-tab {
106
+ padding-top:0;
107
+ }
108
+
109
+ .random-length-text {
110
+ opacity: .5;
111
+ }
112
+
113
+ #timeline_express_review_this_plugin_container .fa-paypal {
114
+ display: block;
115
+ width: 100%;
116
+ font-size: 16px;
117
+ padding-top: 4px;
118
+ margin: 0 auto !important;
119
+ color: #253b80;
120
+ }
121
+
122
+ /* Settings Page Top Container */
123
+ /* Houses links to leave us a review, links to Evan Herman's Website etc. */
124
+ .wrap #timeline_express_review_this_plugin_container {
125
+ padding:.5em;
126
+ border:1px dashed lightgrey;
127
+ float: right;
128
+ margin-top: .75em;
129
+ }
130
+
131
+ #timeline_express_review_this_plugin_container {
132
+ display:inline-block;
133
+ }
134
+
135
+ #timeline_express_review_this_plugin_container a, #timeline_express_review_this_plugin_container a:hover {
136
+ color: #333;
137
+ }
138
+ #timeline_express_review_this_plugin_container div, #timeline_express_review_this_plugin_container span, #timeline_express_review_this_plugin_container .timeline_express_header_logo {
139
+ float:left;
140
+ margin: 0 .5em;
141
+ text-align:center;
142
+ }
143
+ #timeline_express_review_this_plugin_container div.dashicons {
144
+ margin: 0 5px;
145
+ }
146
+ #timeline_express_review_this_plugin_container div.dashicons-plus-alt {
147
+ display:block;
148
+ width:100%;
149
+ margin: 0 auto;
150
+ color: rgb(163, 195, 184);
151
+ }
152
+
153
+ .timeline-express-form {
154
+ margin-bottom: 3em;
155
+ }
156
+
157
+ .timeline-express-form th {
158
+ font-weight: bold;
159
+ }
160
+
161
+ .timeline-express-settings-description {
162
+ padding-bottom: 2em !important;
163
+ color: #A7A7A7;
164
+ font-style: italic;
165
+ font-size: 10px;
166
+ }
167
+
168
+
169
+ .wp-admin .active-parent-button, .wp-admin .active-parent-button:hover {
170
+ color: red;
171
+ }
172
+
173
+ .delete-no:after {
174
+ content: " no, save my announcements from being deleted. I'll need them again!"
175
+ }
176
+ .delete-no:hover {
177
+ cursor: pointer;
178
+ }
179
+ .delete-yes:after {
180
+ content: " yes, delete all of the announcement posts. they are dead to me."
181
+ }
182
+ .delete-yes:hover {
183
+ cursor: pointer;
184
+ }
185
+
186
+ /** Color Picker **/
187
+ .wp-picker-holder {
188
+ position:absolute;
189
+ z-index: 99999999;
190
+ }
191
+
192
+ /* No events message wp_editor */
193
+ #no-events-message_ifr {
194
+ max-height: 100px;
195
+ }
196
+
197
+ /* No Events Found In Table - text */
198
+ .wp-list-table .no-items .colspanchange {
199
+ text-align: center;
200
+ height: 115px;
201
+ line-height: 8;
202
+ font-style: italic;
203
+ }
204
+
205
+ /* Column Widths */
206
+ .wp-list-table #color, .wp-list-table #icon {
207
+ width: 65px;
208
+ text-align: center;
209
+ padding-left: 1em;
210
+ }
211
+
212
+ .wp-list-table #announcement_date {
213
+ width: 215px;
214
+ }
215
+
216
+ .wp-list-table #image, .wp-list-table .column-image {
217
+ width: 250px;
218
+ text-align:center;
219
+ }
220
+
221
+ .no-image-used-text {
222
+ line-height: 4.7
223
+ }
224
+
225
+ .wp-list-table #past_announcement, .wp-list-table .past_announcement {
226
+ width: 150px;
227
+ text-align:center;
228
+ }
229
+
230
+ /* Edit Timeline Express Announcement Styles */
231
+
232
+ /* Announcement Color Box */
233
+ .wp-list-table .announcement_color_box {
234
+ display:block;
235
+ width: 15px;
236
+ height: 15px;
237
+ border: 1px solid rgba(128, 128, 128, 0.22);
238
+ padding: .5em;
239
+ text-align: center;
240
+ margin: 0 auto;
241
+ margin-top: 11px;
242
+ -webkit-border-radius: 50%;
243
+ -moz-border-radius: 50%;
244
+ border-radius: 50%;
245
+ }
246
+ /* Announcement Icon */
247
+ .wp-list-table .edit-announcement-icon {
248
+ font-size: 25px !important;
249
+ line-height: 2.5 !important;
250
+ display: block;
251
+ text-align: center;
252
+ }
253
+ /* Announcement Date */
254
+ .wp-list-table #announcement_date {
255
+ line-height: 1.5;
256
+ padding-left: 2.5em;
257
+ }
258
+ .wp-list-table .announcement_date {
259
+ line-height: 4.5 !important;
260
+ text-align: center;
261
+ }
262
+ /* Past Announcement Icon */
263
+ .wp-list-table .dashicon-past-announcement {
264
+ font-size: 30px !important;
265
+ line-height: 2.1 !important;
266
+ }
267
+
268
+ /** Admin Break Points **/
269
+
270
+ @media only screen and (max-width: 1175px) {
271
+
272
+ }
273
+
274
+ .dashicons-star-filled {color:#FEBE12;}
275
+
276
+ #timeline_express_reset_plugin_settings .dashicons-dismiss {
277
+ float: left;
278
+ margin-top: .5em;
279
+ padding: .5em 1em 1em .5em;
280
+ color: rgb(241, 83, 83);
281
+ }
282
+
283
+
284
+
285
+ /*************************************************
286
+ *
287
+ * Timeline Express Welcome Page Styles
288
+ *
289
+ *************************************************/
290
+ body.admin_page_timeline-express-welcome .timeline-express-image {
291
+
292
+ background: -moz-linear-gradient(top, rgba(206,220,231,.7) 0%, rgba(89,106,114,.7) 100%);
293
+ background-image: url( '../images/welcome/background.png' );
294
+ }
295
+ body.admin_page_timeline-express-welcome .timeline-screenshot {
296
+ padding: 1.5em;
297
+ padding-bottom: 0;
298
+ }
299
+
300
+ body.admin_page_timeline-express-welcome .font-awesome-background {
301
+ padding-top:3em;
302
+ margin-top:1.5em;
303
+ background-image: url( '../images/welcome/Font-Awesome-Cheatsheet.png' );
304
+ background-size: cover;
305
+ height:250px;
306
+ text-align:center;
307
+ line-height: 8;
308
+ }
309
+
310
+ body.admin_page_timeline-express-welcome .intuitive-post-creation {
311
+ padding-top:3em;
312
+ margin-top:1.5em;
313
+ background-image: url( '../images/welcome/intuitive-creation-screen.jpg' );
314
+ background-size: contain;
315
+ height:665px;
316
+ background-position: bottom center;
317
+ background-repeat: no-repeat;
318
+ }
319
+
320
+ body.admin_page_timeline-express-welcome .admin-manage-announcements {
321
+ padding-top:3em;
322
+ margin-top:1.5em;
323
+ background-image: url( '../images/welcome/manage-announcements.jpg' );
324
+ background-size: contain;
325
+ height:665px;
326
+ background-position: bottom center;
327
+ background-repeat: no-repeat;
328
+ }
329
+
330
+ body.admin_page_timeline-express-welcome .customize-your-timeline {
331
+ padding-top:4%;
332
+ margin-top:1.5em;
333
+ background-image: url( '../images/welcome/customize-your-timeline.jpg' );
334
+ background-size: contain;
335
+ height:665px;
336
+ background-position: bottom center;
337
+ background-repeat: no-repeat;
338
+ }
339
+
340
+ /* fade slider */
341
+ body.admin_page_timeline-express-welcome .slides {
342
+ height:665px;
343
+ overflow:hidden;
344
+ position:relative;
345
+ width:100%;
346
+ padding: 4% 0 4% 0;
347
+ }
348
+
349
+ body.admin_page_timeline-express-welcome .slides ul {
350
+ list-style:none;
351
+ position:relative;
352
+ }
353
+
354
+ /* keyframes #anim_slides */
355
+ @-webkit-keyframes anim_slides {
356
+ 0% {
357
+ opacity:0;
358
+ }
359
+ 6% {
360
+ opacity:1;
361
+ }
362
+ 24% {
363
+ opacity:1;
364
+ }
365
+ 30% {
366
+ opacity:0;
367
+ }
368
+ 100% {
369
+ opacity:0;
370
+ }
371
+ }
372
+ @-moz-keyframes anim_slides {
373
+ 0% {
374
+ opacity:0;
375
+ }
376
+ 6% {
377
+ opacity:1;
378
+ }
379
+ 24% {
380
+ opacity:1;
381
+ }
382
+ 30% {
383
+ opacity:0;
384
+ }
385
+ 100% {
386
+ opacity:0;
387
+ }
388
+ }
389
+
390
+ body.admin_page_timeline-express-welcome .slides ul li {
391
+ width: 100%;
392
+
393
+ opacity:0;
394
+ position:absolute;
395
+ top:0;
396
+
397
+ /* css3 animation */
398
+ -webkit-animation-name: anim_slides;
399
+ -webkit-animation-duration: 18.0s;
400
+ -webkit-animation-timing-function: linear;
401
+ -webkit-animation-iteration-count: infinite;
402
+ -webkit-animation-direction: normal;
403
+ -webkit-animation-delay: 0;
404
+ -webkit-animation-play-state: running;
405
+ -webkit-animation-fill-mode: forwards;
406
+
407
+ -moz-animation-name: anim_slides;
408
+ -moz-animation-duration: 18.0s;
409
+ -moz-animation-timing-function: linear;
410
+ -moz-animation-iteration-count: infinite;
411
+ -moz-animation-direction: normal;
412
+ -moz-animation-delay: 0;
413
+ -moz-animation-play-state: running;
414
+ -moz-animation-fill-mode: forwards;
415
+ }
416
+
417
+ /* css3 delays */
418
+ body.admin_page_timeline-express-welcome .slides ul li:nth-child(2), body.admin_page_timeline-express-welcome .slides ul li:nth-child(2) h2.promo-text {
419
+ -webkit-animation-delay: 6.0s;
420
+ -moz-animation-delay: 6.0s;
421
+ }
422
+ body.admin_page_timeline-express-welcome .slides ul li:nth-child(3), body.admin_page_timeline-express-welcome .slides ul li:nth-child(3) h2.promo-text {
423
+ -webkit-animation-delay: 12.0s;
424
+ -moz-animation-delay: 12.0s;
425
+ }
426
+ body.admin_page_timeline-express-welcome .slides ul li img {
427
+ display:block;
428
+ }
429
+
430
+ /* keyframes #anim_titles */
431
+ @-webkit-keyframes anim_titles {
432
+ 0% {
433
+ left:5%;
434
+ opacity:0;
435
+ }
436
+ 5% {
437
+ left:5%;
438
+ opacity:1;
439
+ }
440
+ 20% {
441
+ left:5%;
442
+ opacity:1;
443
+ }
444
+ 25% {
445
+ left:5%;
446
+ opacity:0;
447
+ }
448
+ 100% {
449
+ left:5%;
450
+ opacity:0;
451
+ }
452
+ }
453
+ @-moz-keyframes anim_titles {
454
+ 0% {
455
+ left:5%;
456
+ opacity:0;
457
+ }
458
+ 5% {
459
+ left:5%;
460
+ opacity:1;
461
+ }
462
+ 20% {
463
+ left:5%;
464
+ opacity:1;
465
+ }
466
+ 25% {
467
+ left:5%;
468
+ opacity:0;
469
+ }
470
+ 100% {
471
+ left:5%;
472
+ opacity:0;
473
+ }
474
+ }
475
+
476
+ body.admin_page_timeline-express-welcome .slides ul li h2.promo-text {
477
+ background-color:#000000;
478
+ border-radius:10px 10px 10px 10px;
479
+ box-shadow:0 0 3px #FFFFFF inset;
480
+ color:#FFFFFF;
481
+ font-size:18px;
482
+ margin:0 auto;
483
+ padding:10px;
484
+ position:absolute;
485
+ top:-35px;
486
+ width:350px;
487
+ text-align:center;
488
+
489
+ /* css3 animation */
490
+ -webkit-animation-name: anim_titles;
491
+ -webkit-animation-duration: 18.0s;
492
+ -webkit-animation-timing-function: linear;
493
+ -webkit-animation-iteration-count: infinite;
494
+ -webkit-animation-direction: normal;
495
+ -webkit-animation-delay: 0;
496
+ -webkit-animation-play-state: running;
497
+ -webkit-animation-fill-mode: forwards;
498
+
499
+ -moz-animation-name: anim_titles;
500
+ -moz-animation-duration: 18.0s;
501
+ -moz-animation-timing-function: linear;
502
+ -moz-animation-iteration-count: infinite;
503
+ -moz-animation-direction: normal;
504
+ -moz-animation-delay: 0;
505
+ -moz-animation-play-state: running;
506
+ -moz-animation-fill-mode: forwards;
507
+ }
508
+
509
+
510
+ .dashicons-heart {
511
+ background: -webkit-linear-gradient(top, #ff8cf7, #e2a5e0);
512
+ background: linear-gradient(top, #ff8cf7, #e2a5e0);
513
+ -webkit-background-clip: text;
514
+ -webkit-text-fill-color: transparent;
515
+ }
516
+
517
+ /** End Timeline Express Admin Styles */
css/timeline-express-settings.min.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* Timeline Express by Evan Herman */
2
+ /* Settings Stylesheet Minified */
3
+ .wp-core-ui .timeline-express-red-button{background-color:#9B2124;background-image:-webkit-gradient(linear,left top,left bottom,from(#C5292E),to(#9B2124));background-image:-webkit-linear-gradient(top,#C5292E,#9B2124);background-image:-moz-linear-gradient(top,#C5292E,#9B2124);background-image:-ms-linear-gradient(top,#C5292E,#9B2124);background-image:-o-linear-gradient(top,#C5292E,#9B2124);background-image:linear-gradient(to bottom,#C5292E,#9B2124);border-color:#9B2124 #9B2124 #8D1F21;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5);box-shadow:inset 0 1px 0 rgba(120,200,230,.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,.1);margin-left:2em;width:150px;text-align:center}.wp-core-ui .timeline-express-red-button.focus,.wp-core-ui .timeline-express-red-button.hover,.wp-core-ui .timeline-express-red-button:focus,.wp-core-ui .timeline-express-red-button:hover{background-color:#B72629;background-image:-webkit-gradient(linear,left top,left bottom,from(#D22E30),to(#9B2124));background-image:-webkit-linear-gradient(top,#D22E30,#9B2124);background-image:-moz-linear-gradient(top,#D22E30,#9B2124);background-image:-ms-linear-gradient(top,#D22E30,#9B2124);background-image:-o-linear-gradient(top,#D22E30,#9B2124);background-image:linear-gradient(to bottom,#D22E30,#9B2124);border-color:#7F1C1F;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.3)}.wp-core-ui .timeline-express-red-button.focus,.wp-core-ui .timeline-express-red-button:focus{border-color:#500F0E;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4)}.wp-core-ui .timeline-express-red-button.active,.wp-core-ui .timeline-express-red-button.active:focus,.wp-core-ui .timeline-express-red-button.active:hover,.wp-core-ui .timeline-express-red-button:active{background:#7F1C1F;background-image:-webkit-gradient(linear,left top,left bottom,from(#9B2124),to(#B72629));background-image:-webkit-linear-gradient(top,#9B2124,#B72629);background-image:-moz-linear-gradient(top,#9B2124,#B72629);background-image:-ms-linear-gradient(top,#9B2124,#B72629);background-image:-o-linear-gradient(top,#9B2124,#B72629);background-image:linear-gradient(to bottom,#9B2124,#B72629);border-color:#601312 #AE2426 #AE2426;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);text-shadow:0 1px 0 rgba(0,0,0,.1)}.wp-core-ui .timeline-express-red-button-disabled,.wp-core-ui .timeline-express-red-button:disabled,.wp-core-ui .timeline-express-red-button[disabled]{color:#E79496!important;background:#BA292B!important;border-color:#7F1C1F!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}#timeline-express-icon{background:url(../images/timeline-express-icon.png) no-repeat;display:block;float:left;padding:0 0 0 .5em;height:75px;width:75px;background-size:contain;margin-bottom:.5em}.wrap #timeline-express-page-header{padding-top:0;margin:1em 0 0;font-size:25px;line-height:3}.wrap .nav-tab-wrapper{padding-top:2.5em}.wrap .account-nav-tab{padding-top:0}.random-length-text{opacity:.5}#timeline_express_review_this_plugin_container .fa-paypal{display:block;width:100%;font-size:16px;padding-top:4px;margin:0 auto!important;color:#253b80}.wrap #timeline_express_review_this_plugin_container{padding:.5em;border:1px dashed lightgrey;float:right;margin-top:.75em}#timeline_express_review_this_plugin_container{display:inline-block}#timeline_express_review_this_plugin_container a,#timeline_express_review_this_plugin_container a:hover{color:#333}#timeline_express_review_this_plugin_container .timeline_express_header_logo,#timeline_express_review_this_plugin_container div,#timeline_express_review_this_plugin_container span{float:left;margin:0 .5em;text-align:center}#timeline_express_review_this_plugin_container div.dashicons{margin:0 5px}#timeline_express_review_this_plugin_container div.dashicons-plus-alt{display:block;width:100%;margin:0 auto;color:#a3c3b8}.timeline-express-form{margin-bottom:3em}.timeline-express-form th{font-weight:700}.timeline-express-settings-description{padding-bottom:2em!important;color:#A7A7A7;font-style:italic;font-size:10px}.wp-admin .active-parent-button,.wp-admin .active-parent-button:hover{color:red}.delete-no:after{content:" no, save my announcements from being deleted. I'll need them again!"}.delete-no:hover{cursor:pointer}.delete-yes:after{content:" yes, delete all of the announcement posts. they are dead to me."}.delete-yes:hover{cursor:pointer}.wp-picker-holder{position:absolute;z-index:99999999}#no-events-message_ifr{max-height:100px}.wp-list-table .no-items .colspanchange{text-align:center;height:115px;line-height:8;font-style:italic}.wp-list-table #color,.wp-list-table #icon{width:65px;text-align:center;padding-left:1em}.wp-list-table #announcement_date{width:215px}.wp-list-table #image,.wp-list-table .column-image{width:250px;text-align:center}.no-image-used-text{line-height:4.7}.wp-list-table #past_announcement,.wp-list-table .past_announcement{width:150px;text-align:center}.wp-list-table .announcement_color_box{display:block;width:15px;height:15px;border:1px solid rgba(128,128,128,.22);padding:.5em;text-align:center;margin:11px auto 0;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%}.wp-list-table .edit-announcement-icon{font-size:25px!important;line-height:2.5!important;display:block;text-align:center}.wp-list-table #announcement_date{line-height:1.5;padding-left:2.5em}.wp-list-table .announcement_date{line-height:4.5!important;text-align:center}.wp-list-table .dashicon-past-announcement{font-size:30px!important;line-height:2.1!important}.dashicons-star-filled{color:#FEBE12}#timeline_express_reset_plugin_settings .dashicons-dismiss{float:left;margin-top:.5em;padding:.5em 1em 1em .5em;color:#f15353}body.admin_page_timeline-express-welcome .timeline-express-image{background:url('../images/welcome/background.png')}body.admin_page_timeline-express-welcome .timeline-screenshot{padding:1.5em 1.5em 0}body.admin_page_timeline-express-welcome .font-awesome-background{padding-top:3em;margin-top:1.5em;background-image:url('../images/welcome/Font-Awesome-Cheatsheet.png');background-size:cover;height:250px;text-align:center;line-height:8}body.admin_page_timeline-express-welcome .intuitive-post-creation{padding-top:3em;margin-top:1.5em;background-image:url('../images/welcome/intuitive-creation-screen.jpg');background-size:contain;height:665px;background-position:bottom center;background-repeat:no-repeat}body.admin_page_timeline-express-welcome .admin-manage-announcements{padding-top:3em;margin-top:1.5em;background-image:url('../images/welcome/manage-announcements.jpg');background-size:contain;height:665px;background-position:bottom center;background-repeat:no-repeat}body.admin_page_timeline-express-welcome .customize-your-timeline{padding-top:4%;margin-top:1.5em;background-image:url('../images/welcome/customize-your-timeline.jpg');background-size:contain;height:665px;background-position:bottom center;background-repeat:no-repeat}body.admin_page_timeline-express-welcome .slides{height:665px;overflow:hidden;position:relative;width:100%;padding:4% 0}body.admin_page_timeline-express-welcome .slides ul{list-style:none;position:relative}@-webkit-keyframes anim_slides{0%{opacity:0}24%,6%{opacity:1}100%,30%{opacity:0}}@-moz-keyframes anim_slides{0%{opacity:0}24%,6%{opacity:1}100%,30%{opacity:0}}body.admin_page_timeline-express-welcome .slides ul li{width:100%;opacity:0;position:absolute;top:0;-webkit-animation-name:anim_slides;-webkit-animation-duration:18s;-webkit-animation-timing-function:linear;-webkit-animation-iteration-count:infinite;-webkit-animation-direction:normal;-webkit-animation-delay:0;-webkit-animation-play-state:running;-webkit-animation-fill-mode:forwards;-moz-animation-name:anim_slides;-moz-animation-duration:18s;-moz-animation-timing-function:linear;-moz-animation-iteration-count:infinite;-moz-animation-direction:normal;-moz-animation-delay:0;-moz-animation-play-state:running;-moz-animation-fill-mode:forwards}body.admin_page_timeline-express-welcome .slides ul li:nth-child(2),body.admin_page_timeline-express-welcome .slides ul li:nth-child(2) h2.promo-text{-webkit-animation-delay:6s;-moz-animation-delay:6s}body.admin_page_timeline-express-welcome .slides ul li:nth-child(3),body.admin_page_timeline-express-welcome .slides ul li:nth-child(3) h2.promo-text{-webkit-animation-delay:12s;-moz-animation-delay:12s}body.admin_page_timeline-express-welcome .slides ul li img{display:block}@-webkit-keyframes anim_titles{0%{left:5%;opacity:0}20%,5%{left:5%;opacity:1}100%,25%{left:5%;opacity:0}}@-moz-keyframes anim_titles{0%{left:5%;opacity:0}20%,5%{left:5%;opacity:1}100%,25%{left:5%;opacity:0}}body.admin_page_timeline-express-welcome .slides ul li h2.promo-text{background-color:#000;border-radius:10px;box-shadow:0 0 3px #FFF inset;color:#FFF;font-size:18px;margin:0 auto;padding:10px;position:absolute;top:-35px;width:350px;text-align:center;-webkit-animation-name:anim_titles;-webkit-animation-duration:18s;-webkit-animation-timing-function:linear;-webkit-animation-iteration-count:infinite;-webkit-animation-direction:normal;-webkit-animation-delay:0;-webkit-animation-play-state:running;-webkit-animation-fill-mode:forwards;-moz-animation-name:anim_titles;-moz-animation-duration:18s;-moz-animation-timing-function:linear;-moz-animation-iteration-count:infinite;-moz-animation-direction:normal;-moz-animation-delay:0;-moz-animation-play-state:running;-moz-animation-fill-mode:forwards}.dashicons-heart{background:-webkit-linear-gradient(top,#ff8cf7,#e2a5e0);background:linear-gradient(top,#ff8cf7,#e2a5e0);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
css/timeline-express.css ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Timeline Express Minified Styles 1.0 */
2
+ /* By Evan Herman (http://www.evan-herman.com */
3
+ /* -------------------------------------------------- */
4
+ .cd-container {
5
+ width: 100%;
6
+ max-width: 822px;
7
+ margin: 0 auto;
8
+ }
9
+ .cd-container::after {
10
+ content: '';
11
+ display: table;
12
+ clear: both;
13
+ }
14
+ .cd-timeline-announcement-image {
15
+ box-shadow: none!important;
16
+ max-width: 100%;
17
+ display: block;
18
+ margin: 1em auto;
19
+ }
20
+ #cd-timeline {
21
+ position: relative;
22
+ padding: 2em 0;
23
+ margin-top: 2em;
24
+ margin-bottom: 3em;
25
+ }
26
+ #cd-timeline::before {
27
+ content: '';
28
+ position: absolute;
29
+ top: 0;
30
+ left: 18px;
31
+ height: 100%;
32
+ width: 4px;
33
+ background: #d7e4ed;
34
+ }
35
+ .announcement-banner-image {
36
+ margin-bottom: 1em;
37
+ width: 100%}
38
+ .timeline-express-single-page-announcement-date {
39
+ display: block;
40
+ margin-bottom: 1em;
41
+ }
42
+ @media only screen and (min-width:822px) {
43
+ #cd-timeline {
44
+ margin-top: 3em;
45
+ margin-bottom: 5.5em;
46
+ }
47
+ #cd-timeline::before {
48
+ left: 50%;
49
+ margin-left: -2px;
50
+ }
51
+ }.cd-timeline-block {
52
+ margin: 25px 0;
53
+ }
54
+ .cd-timeline-block:after {
55
+ content: "";
56
+ display: table;
57
+ clear: both;
58
+ }
59
+ .cd-timeline-block:first-child {
60
+ margin-top: 0;
61
+ }
62
+ .cd-timeline-block:last-child {
63
+ margin-bottom: 0;
64
+ }
65
+ @media only screen and (min-width:822px) {
66
+ .cd-timeline-block {
67
+ width: 100%;
68
+ margin: -3.5em 0;
69
+ }
70
+ .cd-timeline-block:first-child {
71
+ margin-top: 0;
72
+ }
73
+ .cd-timeline-block:last-child {
74
+ margin-bottom: 0;
75
+ }
76
+ }.cd-timeline-img {
77
+ position: absolute;
78
+ top: 0;
79
+ left: 0;
80
+ width: 40px;
81
+ height: 40px;
82
+ border-radius: 50%;
83
+ box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, .08), 0 3px 0 4px rgba(0, 0, 0, .05);
84
+ }
85
+ .cd-timeline-img img {
86
+ display: block;
87
+ width: 24px;
88
+ height: 24px;
89
+ position: relative;
90
+ left: 50%;
91
+ top: 50%;
92
+ margin-left: -12px;
93
+ margin-top: -12px;
94
+ }
95
+ .cd-timeline-img.cd-picture {
96
+ background: #75ce66;
97
+ }
98
+ .cd-timeline-img.cd-movie {
99
+ background: #c03b44;
100
+ }
101
+ .cd-timeline-img.cd-location {
102
+ background: #f0ca45;
103
+ }
104
+ @media only screen and (min-width:822px) {
105
+ .cd-timeline-img {
106
+ width: 60px;
107
+ height: 60px;
108
+ left: 50%;
109
+ margin-left: -30px;
110
+ -webkit-transform: translateZ(0);
111
+ -webkit-backface-visibility: hidden;
112
+ }
113
+ .cssanimations .cd-timeline-img.is-hidden {
114
+ visibility: hidden;
115
+ }
116
+ .cssanimations .cd-timeline-img.bounce-in {
117
+ visibility: visible;
118
+ -webkit-animation: cd-bounce-1 .6s;
119
+ -moz-animation: cd-bounce-1 .6s;
120
+ animation: cd-bounce-1 .6s;
121
+ }
122
+ }@-webkit-keyframes cd-bounce-1 {
123
+ 0% {
124
+ opacity: 0;
125
+ -webkit-transform: scale(0.5);
126
+ }
127
+ 60% {
128
+ opacity: 1;
129
+ -webkit-transform: scale(1.2);
130
+ }
131
+ 100% {
132
+ -webkit-transform: scale(1);
133
+ }
134
+ }@-moz-keyframes cd-bounce-1 {
135
+ 0% {
136
+ opacity: 0;
137
+ -moz-transform: scale(0.5);
138
+ }
139
+ 60% {
140
+ opacity: 1;
141
+ -moz-transform: scale(1.2);
142
+ }
143
+ 100% {
144
+ -moz-transform: scale(1);
145
+ }
146
+ }@keyframes cd-bounce-1 {
147
+ 0% {
148
+ opacity: 0;
149
+ -webkit-transform: scale(0.5);
150
+ -moz-transform: scale(0.5);
151
+ -ms-transform: scale(0.5);
152
+ -o-transform: scale(0.5);
153
+ transform: scale(0.5);
154
+ }
155
+ 60% {
156
+ opacity: 1;
157
+ -webkit-transform: scale(1.2);
158
+ -moz-transform: scale(1.2);
159
+ -ms-transform: scale(1.2);
160
+ -o-transform: scale(1.2);
161
+ transform: scale(1.2);
162
+ }
163
+ 100% {
164
+ -webkit-transform: scale(1);
165
+ -moz-transform: scale(1);
166
+ -ms-transform: scale(1);
167
+ -o-transform: scale(1);
168
+ transform: scale(1);
169
+ }
170
+ }.cd-timeline-content {
171
+ position: relative;
172
+ margin-left: 60px;
173
+ background: #fff;
174
+ border-radius: .25em;
175
+ padding: 1em;
176
+ box-shadow: 0 3px 0 #B9C5CD;
177
+ font-family: "Open Sans", sans-serif;
178
+ }
179
+ .cd-timeline-content:after {
180
+ content: "";
181
+ display: table;
182
+ clear: both;
183
+ }
184
+ .cd-timeline-item-title {
185
+ -ms-word-break: break-all;
186
+ word-break: break-all;
187
+ word-break: break-word;
188
+ -webkit-hyphens: auto;
189
+ -moz-hyphens: auto;
190
+ hyphens: auto;
191
+ }
192
+ .cd-timeline-title-container h2 {
193
+ color: #303e49;
194
+ }
195
+ .cd-timeline-title {
196
+ font-size: 25px!important;
197
+ }
198
+ .cd-timeline-content .cd-date, .cd-timeline-content .cd-read-more {
199
+ display: inline-block;
200
+ }
201
+ .cd-timeline-content .cd-read-more {
202
+ padding: .8em 1em;
203
+ position: relative;
204
+ z-index: 9999;
205
+ }
206
+ .cd-timeline-content .cd-date {
207
+ float: left;
208
+ padding: .8em 0;
209
+ opacity: .7;
210
+ font-size: 12px;
211
+ }
212
+ .cd-timeline-title-container {
213
+ display: inline-block;
214
+ width: 100%;
215
+ float: left;
216
+ margin: .55em 0;
217
+ }
218
+ .cd-timeline-title-container h2 {
219
+ float: left;
220
+ }
221
+ .cd-timeline-content .timeline-date {
222
+ opacity: .7;
223
+ font-size: .857143rem;
224
+ float: right;
225
+ margin-top: .5em;
226
+ }
227
+ .cd-timeline-content::before {
228
+ content: '';
229
+ position: absolute;
230
+ top: 16px;
231
+ right: 100%;
232
+ height: 0;
233
+ width: 0;
234
+ border: 7px solid transparent;
235
+ border-right: 7px solid #fff;
236
+ }
237
+ @media only screen and (min-width:768px) {
238
+ .cd-timeline-content h2 {
239
+ margin-top: 0;
240
+ margin-bottom: 0;
241
+ }
242
+ .cd-timeline-content .the-excerpt {
243
+ display: block;
244
+ float: left;
245
+ width: 100%;
246
+ margin: 1em 0;
247
+ }
248
+ .cd-timeline-content .cd-date, .cd-timeline-content .cd-read-more {
249
+ font-size: 14px;
250
+ font-size: .875rem;
251
+ }
252
+ }@media only screen and (min-width:822px) {
253
+ .cd-timeline-content {
254
+ margin-left: 0;
255
+ padding: 1.6em;
256
+ width: 39%;
257
+ background: #EFEFEF;
258
+ }
259
+ .cd-timeline-content::before {
260
+ top: 24px;
261
+ left: 100%;
262
+ border-color: transparent transparent transparent #EFEFEF;
263
+ }
264
+ .cd-timeline-content .cd-read-more {
265
+ float: left;
266
+ color: #333;
267
+ }
268
+ .cd-timeline-content .cd-date {
269
+ position: absolute;
270
+ width: 100%;
271
+ left: 125%;
272
+ top: 15px;
273
+ }
274
+ .cd-timeline-block:nth-child(even) .cd-timeline-content {
275
+ float: right;
276
+ }
277
+ .cd-timeline-block:nth-child(even) .cd-timeline-content::before {
278
+ top: 24px;
279
+ left: auto;
280
+ right: 100%;
281
+ border-color: transparent #EFEFEF transparent transparent;
282
+ }
283
+ .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
284
+ float: right;
285
+ color: #333;
286
+ padding-right: 0;
287
+ }
288
+ .cd-timeline-block:nth-child(odd) .cd-timeline-content .cd-read-more {
289
+ position: relative;
290
+ z-index: 99999;
291
+ padding-left: 0;
292
+ }
293
+ .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
294
+ left: auto;
295
+ right: 125%;
296
+ text-align: right;
297
+ }
298
+ .cssanimations .cd-timeline-content.is-hidden {
299
+ visibility: hidden;
300
+ }
301
+ .cssanimations .cd-timeline-content.bounce-in {
302
+ visibility: visible;
303
+ -webkit-animation: cd-bounce-2 .6s;
304
+ -moz-animation: cd-bounce-2 .6s;
305
+ animation: cd-bounce-2 .6s;
306
+ }
307
+ }@media only screen and (min-width:822px) {
308
+ .cssanimations .cd-timeline-block: nth-child(even) .cd-timeline-content.bounce-in {
309
+ -webkit-animation: cd-bounce-2-inverse .6s;
310
+ -moz-animation: cd-bounce-2-inverse .6s;
311
+ animation: cd-bounce-2-inverse .6s;
312
+ }
313
+ }@-webkit-keyframes cd-bounce-2 {
314
+ 0% {
315
+ opacity: 0;
316
+ -webkit-transform: translateX(-100px);
317
+ }
318
+ 60% {
319
+ opacity: 1;
320
+ -webkit-transform: translateX(20px);
321
+ }
322
+ 100% {
323
+ -webkit-transform: translateX(0);
324
+ }
325
+ }@-moz-keyframes cd-bounce-2 {
326
+ 0% {
327
+ opacity: 0;
328
+ -moz-transform: translateX(-100px);
329
+ }
330
+ 60% {
331
+ opacity: 1;
332
+ -moz-transform: translateX(20px);
333
+ }
334
+ 100% {
335
+ -moz-transform: translateX(0);
336
+ }
337
+ }@keyframes cd-bounce-2 {
338
+ 0% {
339
+ opacity: 0;
340
+ -webkit-transform: translateX(-100px);
341
+ -moz-transform: translateX(-100px);
342
+ -ms-transform: translateX(-100px);
343
+ -o-transform: translateX(-100px);
344
+ transform: translateX(-100px);
345
+ }
346
+ 60% {
347
+ opacity: 1;
348
+ -webkit-transform: translateX(20px);
349
+ -moz-transform: translateX(20px);
350
+ -ms-transform: translateX(20px);
351
+ -o-transform: translateX(20px);
352
+ transform: translateX(20px);
353
+ }
354
+ 100% {
355
+ -webkit-transform: translateX(0);
356
+ -moz-transform: translateX(0);
357
+ -ms-transform: translateX(0);
358
+ -o-transform: translateX(0);
359
+ transform: translateX(0);
360
+ }
361
+ }@-webkit-keyframes cd-bounce-2-inverse {
362
+ 0% {
363
+ opacity: 0;
364
+ -webkit-transform: translateX(100px);
365
+ }
366
+ 60% {
367
+ opacity: 1;
368
+ -webkit-transform: translateX(-20px);
369
+ }
370
+ 100% {
371
+ -webkit-transform: translateX(0);
372
+ }
373
+ }@-moz-keyframes cd-bounce-2-inverse {
374
+ 0% {
375
+ opacity: 0;
376
+ -moz-transform: translateX(100px);
377
+ }
378
+ 60% {
379
+ opacity: 1;
380
+ -moz-transform: translateX(-20px);
381
+ }
382
+ 100% {
383
+ -moz-transform: translateX(0);
384
+ }
385
+ }@keyframes cd-bounce-2-inverse {
386
+ 0% {
387
+ opacity: 0;
388
+ -webkit-transform: translateX(100px);
389
+ -moz-transform: translateX(100px);
390
+ -ms-transform: translateX(100px);
391
+ -o-transform: translateX(100px);
392
+ transform: translateX(100px);
393
+ }
394
+ 60% {
395
+ opacity: 1;
396
+ -webkit-transform: translateX(-20px);
397
+ -moz-transform: translateX(-20px);
398
+ -ms-transform: translateX(-20px);
399
+ -o-transform: translateX(-20px);
400
+ transform: translateX(-20px);
401
+ }
402
+ 100% {
403
+ -webkit-transform: translateX(0);
404
+ -moz-transform: translateX(0);
405
+ -ms-transform: translateX(0);
406
+ -o-transform: translateX(0);
407
+ transform: translateX(0);
408
+ }
409
+ }.more-to-come-container {
410
+ position: relative;
411
+ background: #EFEFEF;
412
+ display: block;
413
+ width: 100%;
414
+ text-align: center;
415
+ }
416
+ .more-to-come {
417
+ margin: 10em 0 0;
418
+ font-family: "Open Sans";
419
+ padding: 1em 0;
420
+ font-weight: 200;
421
+ color: rgba(100, 100, 100, .46);
422
+ }
423
+ .page article.page {
424
+ background: 0 0!important;
425
+ box-shadow: none;
426
+ border: none;
427
+ -webkit-box-shadow: none;
428
+ }
429
+ .page .cd-timeline-block span.fa {
430
+ color: #fff;
431
+ font-size: 25px;
432
+ display: block;
433
+ text-align: center;
434
+ margin-top: 18px;
435
+ }
436
+ .cd-timeline-icon-link {
437
+ color: #fff!important;
438
+ }
439
+ @media only screen and (max-width:821px) {
440
+ .page .cd-timeline-block span.fa {
441
+ color: #fff;
442
+ font-size: 18px;
443
+ display: block;
444
+ text-align: center;
445
+ margin-top: 12px;
446
+ }
447
+ .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more, .cd-timeline-block:nth-child(odd) .cd-timeline-content .cd-read-more {
448
+ padding-left: 0!important;
449
+ position: relative;
450
+ z-index: 99999;
451
+ }
452
+ }
453
+ .timeline-width100 {
454
+ width: 100%}
455
+ .timeline-width34 {
456
+ width: 34%}
457
+ .timeline-width30 {
458
+ width: 30%}
459
+ .timeline-date-left {
460
+ width: 100%;
461
+ float: left!important;
462
+ }
css/timeline-express.min.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* Timeline Express Minified Styles 1.0 */
2
+ /* By Evan Herman (http://www.evan-herman.com */
3
+ /* -------------------------------------------------- */
4
+ .cd-container{width:100%;max-width:822px;margin:0 auto}.cd-container::after{content:'';display:table;clear:both}.cd-timeline-announcement-image{box-shadow:none!important;max-width:100%;display:block;margin:1em auto}#cd-timeline{position:relative;padding:2em 0;margin-top:2em;margin-bottom:3em}#cd-timeline::before{content:'';position:absolute;top:0;left:18px;height:100%;width:4px;background:#d7e4ed}.announcement-banner-image{margin-bottom:1em;width:100%}.timeline-express-single-page-announcement-date{display:block;margin-bottom:1em}@media only screen and (min-width:822px){#cd-timeline{margin-top:3em;margin-bottom:5.5em}#cd-timeline::before{left:50%;margin-left:-2px}}.cd-timeline-block{margin:25px 0}.cd-timeline-block:after{content:"";display:table;clear:both}.cd-timeline-block:first-child{margin-top:0}.cd-timeline-block:last-child{margin-bottom:0}@media only screen and (min-width:822px){.cd-timeline-block{width:100%;margin:-3.5em 0;}.cd-timeline-block:first-child{margin-top:0}.cd-timeline-block:last-child{margin-bottom:0}}.cd-timeline-img{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;box-shadow:0 0 0 4px white,inset 0 2px 0 rgba(0,0,0,.08),0 3px 0 4px rgba(0,0,0,.05)}.cd-timeline-img img{display:block;width:24px;height:24px;position:relative;left:50%;top:50%;margin-left:-12px;margin-top:-12px}.cd-timeline-img.cd-picture{background:#75ce66}.cd-timeline-img.cd-movie{background:#c03b44}.cd-timeline-img.cd-location{background:#f0ca45}@media only screen and (min-width:822px){.cd-timeline-img{width:60px;height:60px;left:50%;margin-left:-30px;-webkit-transform:translateZ(0);-webkit-backface-visibility:hidden}.cssanimations .cd-timeline-img.is-hidden{visibility:hidden}.cssanimations .cd-timeline-img.bounce-in{visibility:visible;-webkit-animation:cd-bounce-1 .6s;-moz-animation:cd-bounce-1 .6s;animation:cd-bounce-1 .6s}}@-webkit-keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(0.5)}60%{opacity:1;-webkit-transform:scale(1.2)}100%{-webkit-transform:scale(1)}}@-moz-keyframes cd-bounce-1{0%{opacity:0;-moz-transform:scale(0.5)}60%{opacity:1;-moz-transform:scale(1.2)}100%{-moz-transform:scale(1)}}@keyframes cd-bounce-1{0%{opacity:0;-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);-o-transform:scale(0.5);transform:scale(0.5)}60%{opacity:1;-webkit-transform:scale(1.2);-moz-transform:scale(1.2);-ms-transform:scale(1.2);-o-transform:scale(1.2);transform:scale(1.2)}100%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}.cd-timeline-content{position:relative;margin-left:60px;background:#fff;border-radius:.25em;padding:1em;box-shadow:0 3px 0 #B9C5CD;font-family:"Open Sans",sans-serif}.cd-timeline-content:after{content:"";display:table;clear:both}.cd-timeline-item-title{-ms-word-break:break-all;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.cd-timeline-title-container h2{color:#303e49}.cd-timeline-title{font-size:25px!important}.cd-timeline-content .cd-date,.cd-timeline-content .cd-read-more{display:inline-block}.cd-timeline-content .cd-read-more{padding:.8em 1em;position:relative;z-index:9999}.cd-timeline-content .cd-date{float:left;padding:.8em 0;opacity:.7;font-size:12px}.cd-timeline-title-container{display:inline-block;width:100%;float:left;margin:.55em 0}.cd-timeline-title-container h2{float:left}.cd-timeline-content .timeline-date{opacity:.7;font-size:.857143rem;float:right;margin-top:.5em}.cd-timeline-content::before{content:'';position:absolute;top:16px;right:100%;height:0;width:0;border:7px solid transparent;border-right:7px solid #fff}@media only screen and (min-width:768px){.cd-timeline-content h2{margin-top:0;margin-bottom:0}.cd-timeline-content .the-excerpt{display:block;float:left;width:100%;margin:1em 0}.cd-timeline-content .cd-date,.cd-timeline-content .cd-read-more{font-size:14px;font-size:.875rem}}@media only screen and (min-width:822px){.cd-timeline-content{margin-left:0;padding:1.6em;width:39%;background:#EFEFEF}.cd-timeline-content::before{top:24px;left:100%;border-color:transparent transparent transparent #EFEFEF}.cd-timeline-content .cd-read-more{float:left;color:#333}.cd-timeline-content .cd-date{position:absolute;width:100%;left:125%;top:15px}.cd-timeline-block:nth-child(even) .cd-timeline-content{float:right}.cd-timeline-block:nth-child(even) .cd-timeline-content::before{top:24px;left:auto;right:100%;border-color:transparent #EFEFEF transparent transparent}.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more{float:right;color:#333;padding-right:0}.cd-timeline-block:nth-child(odd) .cd-timeline-content .cd-read-more{position:relative;z-index:99999;padding-left:0}.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date{left:auto;right:125%;text-align:right}.cssanimations .cd-timeline-content.is-hidden{visibility:hidden}.cssanimations .cd-timeline-content.bounce-in{visibility:visible;-webkit-animation:cd-bounce-2 .6s;-moz-animation:cd-bounce-2 .6s;animation:cd-bounce-2 .6s}}@media only screen and (min-width:822px){.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in{-webkit-animation:cd-bounce-2-inverse .6s;-moz-animation:cd-bounce-2-inverse .6s;animation:cd-bounce-2-inverse .6s}}@-webkit-keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px)}60%{opacity:1;-webkit-transform:translateX(20px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes cd-bounce-2{0%{opacity:0;-moz-transform:translateX(-100px)}60%{opacity:1;-moz-transform:translateX(20px)}100%{-moz-transform:translateX(0)}}@keyframes cd-bounce-2{0%{opacity:0;-webkit-transform:translateX(-100px);-moz-transform:translateX(-100px);-ms-transform:translateX(-100px);-o-transform:translateX(-100px);transform:translateX(-100px)}60%{opacity:1;-webkit-transform:translateX(20px);-moz-transform:translateX(20px);-ms-transform:translateX(20px);-o-transform:translateX(20px);transform:translateX(20px)}100%{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);-o-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px)}60%{opacity:1;-webkit-transform:translateX(-20px)}100%{-webkit-transform:translateX(0)}}@-moz-keyframes cd-bounce-2-inverse{0%{opacity:0;-moz-transform:translateX(100px)}60%{opacity:1;-moz-transform:translateX(-20px)}100%{-moz-transform:translateX(0)}}@keyframes cd-bounce-2-inverse{0%{opacity:0;-webkit-transform:translateX(100px);-moz-transform:translateX(100px);-ms-transform:translateX(100px);-o-transform:translateX(100px);transform:translateX(100px)}60%{opacity:1;-webkit-transform:translateX(-20px);-moz-transform:translateX(-20px);-ms-transform:translateX(-20px);-o-transform:translateX(-20px);transform:translateX(-20px)}100%{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);-o-transform:translateX(0);transform:translateX(0)}}.more-to-come-container{position:relative;background:#EFEFEF;display:block;width:100%;text-align:center}.more-to-come{margin:10em 0 0;font-family:"Open Sans";padding:1em 0;font-weight:200;color:rgba(100,100,100,.46)}.page article.page{background:0 0!important;box-shadow:none;border:none;-webkit-box-shadow:none}.page .cd-timeline-block span.fa{color:#fff;font-size:25px;display:block;text-align:center;margin-top:18px}.cd-timeline-icon-link{color:#fff!important}@media only screen and (max-width:821px){.page .cd-timeline-block span.fa{color:#fff;font-size:18px;display:block;text-align:center;margin-top:12px}.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more,.cd-timeline-block:nth-child(odd) .cd-timeline-content .cd-read-more{padding-left:0!important;position:relative;z-index:99999;}}.timeline-width100{width:100%}.timeline-width34{width:34%}.timeline-width30{width:30%}.timeline-date-left{width:100%;float:left!important}
images/evan_herman_logo.png ADDED
Binary file
images/linkedin.png ADDED
Binary file
images/rss_icon.png ADDED
Binary file
images/timeline-express-icon.png ADDED
Binary file
images/timeline-express-menu-icon.png ADDED
Binary file
images/twitter.png ADDED
Binary file
images/welcome/Font-Awesome-Cheatsheet.png ADDED
Binary file
images/welcome/Manage-Announcements.jpg ADDED
Binary file
images/welcome/background.png ADDED
Binary file
images/welcome/customize-your-timeline.jpg ADDED
Binary file
images/welcome/intuitive-creation-screen.jpg ADDED
Binary file
images/welcome/timeline-screenshot.png ADDED
Binary file
images/wordpress-icon.png ADDED
Binary file
js/script.options-color-picker-custom.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Timeline Express by Evan Herman - http://www.Evan-Herman.com
3
+ - Initialize our color pickers
4
+ */
5
+ jQuery(document).ready(function() {
6
+
7
+ // Add Color Picker to all inputs that have 'color-field' class
8
+ jQuery('.color-picker-field').wpColorPicker();
9
+
10
+ // disable sortable on the metaboxes
11
+ jQuery('.meta-box-sortables').sortable({
12
+ disabled: true
13
+ });
14
+
15
+ jQuery('.postbox .hndle').css('cursor', 'pointer');
16
+
17
+
18
+ });
js/script.timeline-express.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Timeline Express Script */
2
+ /* By Evan Herman - http://www.Evan-Herman.com/contact/ */
3
+
4
+
5
+ /* Run on document load */
6
+ /* Script Used To Fadein Announcements */
7
+ jQuery(document).ready(function(){
8
+
9
+ // add the necessary classes on page load
10
+ jQuery( 'html' ).addClass( 'cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions' );
11
+
12
+ var timeline_block = jQuery('.cd-timeline-block');
13
+
14
+ //hide timeline blocks which are outside the viewport
15
+ timeline_block.each(function(){
16
+ if(jQuery(this).offset().top > jQuery(window).scrollTop()+jQuery(window).height()*0.75) {
17
+ jQuery(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
18
+ }
19
+ });
20
+
21
+ //on scolling, show/animate timeline blocks when enter the viewport
22
+ jQuery(window).on('scroll', function(){
23
+ timeline_block.each(function(){
24
+ if( jQuery(this).offset().top <= jQuery(window).scrollTop()+jQuery(window).height()*0.75 && jQuery(this).find('.cd-timeline-img').hasClass('is-hidden') ) {
25
+ jQuery(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
26
+ }
27
+ });
28
+ });
29
+
30
+ jQuery( '#cd-timeline' ).masonry({itemSelector : '.cd-timeline-block',});
31
+
32
+ var entry_content_width = jQuery( '#cd-timeline' ).parents('div').css('width');
33
+ var width = jQuery(window).width() + parseInt(17);
34
+ var timeline_content_width = jQuery( '.cd-timeline-content' ).css('width');
35
+
36
+ // medium content width (twenty thirteen)
37
+ if ( width <= 822 && ( entry_content_width.replace( 'px' , '' ) <= '475' && entry_content_width.replace( 'px' , '' ) <= '800' ) ) {
38
+ jQuery( '.cd-timeline-content' ).removeClass( 'timeline-width34' );
39
+ } else if ( width >= 822 && ( entry_content_width.replace( 'px' , '' ) >= '475' && entry_content_width.replace( 'px' , '' ) <= '800' ) ) {
40
+ jQuery( '.cd-timeline-content' ).addClass( 'timeline-width34' );
41
+ }
42
+
43
+ // narrow content widths (twenty fourteen)
44
+ if ( width <= 822 && entry_content_width.replace( 'px' , '' ) <= '475' ) {
45
+ jQuery( '.cd-timeline-content' ).removeClass( 'timeline-width30' );
46
+ } else if ( width >= 822 && entry_content_width.replace( 'px' , '' ) <= '475' ) {
47
+ jQuery( '.cd-timeline-content' ).addClass( 'timeline-width30' );
48
+ }
49
+
50
+ // if the content is narrow (twenty thirteen)
51
+ if ( timeline_content_width.replace( 'px' , '' ) < 262 ) {
52
+ jQuery( '.cd-timeline-content' ).find( '.timeline-date' ).addClass( 'timeline-date-left' );
53
+ }
54
+
55
+ // resize funciton
56
+ jQuery(window).resize(function() {
57
+
58
+ var width = jQuery(window).width() + parseInt(17);
59
+ var entry_content_width = jQuery( '#cd-timeline' ).parents('div').css('width');
60
+ var timeline_content_width = jQuery( '.cd-timeline-content' ).css('width');
61
+
62
+ if ( width >= '822' && entry_content_width.replace( 'px' , '' ) <= '475' ) {
63
+ jQuery( '.cd-timeline-content' ).addClass( 'timeline-width30' );
64
+ }
65
+
66
+ if ( width >= '822' && timeline_content_width.replace( 'px' , '' ) < 262 ) {
67
+ jQuery( '.cd-timeline-content' ).find( '.timeline-date' ).addClass( 'timeline-date-left' );
68
+ } else {
69
+ jQuery( '.cd-timeline-content' ).find( '.timeline-date' ).removeClass( 'timeline-date-left' );
70
+ }
71
+
72
+ if ( ( width < '822' ) ) {
73
+
74
+ jQuery( '#cd-timeline' ).masonry('reload');
75
+ jQuery( '.cd-timeline-content' ).removeClass( 'timeline-width30' ).removeClass( 'timeline-width34' );
76
+
77
+
78
+ }
79
+
80
+ });
81
+
82
+ });
js/script.timeline-express.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* Timeline Express by Evan Herman - http://www.Evan-Herman.com */
2
+ jQuery(document).ready(function(){jQuery("html").addClass("cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions");var e=jQuery(".cd-timeline-block");e.each(function(){if(jQuery(this).offset().top>jQuery(window).scrollTop()+jQuery(window).height()*.75){jQuery(this).find(".cd-timeline-img, .cd-timeline-content").addClass("is-hidden")}});jQuery(window).on("scroll",function(){e.each(function(){if(jQuery(this).offset().top<=jQuery(window).scrollTop()+jQuery(window).height()*.75&&jQuery(this).find(".cd-timeline-img").hasClass("is-hidden")){jQuery(this).find(".cd-timeline-img, .cd-timeline-content").removeClass("is-hidden").addClass("bounce-in")}})});jQuery("#cd-timeline").masonry({itemSelector:".cd-timeline-block"});var t=jQuery("#cd-timeline").parents("div").css("width");var n=jQuery(window).width()+parseInt(17);var r=jQuery(".cd-timeline-content").css("width");if(n<=822&&t.replace("px","")<="475"&&t.replace("px","")<="800"){jQuery(".cd-timeline-content").removeClass("timeline-width34")}else if(n>=822&&t.replace("px","")>="475"&&t.replace("px","")<="800"){jQuery(".cd-timeline-content").addClass("timeline-width34")}if(n<=822&&t.replace("px","")<="475"){jQuery(".cd-timeline-content").removeClass("timeline-width30")}else if(n>=822&&t.replace("px","")<="475"){jQuery(".cd-timeline-content").addClass("timeline-width30")}if(r.replace("px","")<262){jQuery(".cd-timeline-content").find(".timeline-date").addClass("timeline-date-left")}jQuery(window).resize(function(){var e=jQuery(window).width()+parseInt(17);var t=jQuery("#cd-timeline").parents("div").css("width");var n=jQuery(".cd-timeline-content").css("width");if(e>="822"&&t.replace("px","")<="475"){jQuery(".cd-timeline-content").addClass("timeline-width30")}if(e>="822"&&n.replace("px","")<262){jQuery(".cd-timeline-content").find(".timeline-date").addClass("timeline-date-left")}else{jQuery(".cd-timeline-content").find(".timeline-date").removeClass("timeline-date-left")}if(e<"822"){jQuery("#cd-timeline").masonry("reload");jQuery(".cd-timeline-content").removeClass("timeline-width30").removeClass("timeline-width34")}})})
js/timeline-express-button-script.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Custom Timeline Express TinyMCE Button -> Shortcode */
2
+ ( function() {
3
+
4
+ tinymce.PluginManager.add( 'timeline_express', function( editor, url ) {
5
+
6
+ function disabled_button_on_click() {
7
+ this.disabled( !this.disabled() );
8
+ editor.insertContent( '[timeline-express]' ); /* Do your true-stuff here */
9
+ }
10
+
11
+ function re_enable_button() {
12
+ var state = this.enabled();
13
+ }
14
+
15
+ editor.on( 'keyup' , function() {
16
+ // re-enable our button once the shortcode has been deleted
17
+ // we'll wait all the way till [timeline-express]
18
+ if ( editor.getContent().indexOf( '[timeline-express]' ) > -1 ) {
19
+ editor.controlManager.setDisabled('timeline_express_shortcode_button', true);
20
+ } else {
21
+ editor.controlManager.setDisabled('timeline_express_shortcode_button', false);
22
+ }
23
+ });
24
+
25
+ // Add a button that drops in our shortcode
26
+ editor.addButton( 'timeline_express_shortcode_button', {
27
+ title: 'Timeline Express Shortcode',
28
+ text: false,
29
+ image: url + '/timeline-express-menu-icon.png',
30
+ onclick: disabled_button_on_click
31
+ });
32
+
33
+ // disable the button if the shortcode exists (when loading a previously saved page/post etc)
34
+ editor.onSetContent.add(function(editor, o) {
35
+ if ( editor.getContent().indexOf( '[timeline-express]' ) > -1 ) {
36
+ editor.controlManager.setDisabled('timeline_express_shortcode_button', true);
37
+ }
38
+ });
39
+
40
+
41
+ });
42
+
43
+
44
+ })();
js/timeline-express-menu-icon.png ADDED
Binary file
lib/lib.ajax.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_ajax_timeline_express_settings_form', 'timeline_express_ajaxActions');
3
+
4
+ function timeline_express_ajaxActions()
5
+ {
6
+ global $timelineExpressBase;
7
+ require_once TIMELINE_EXPRESS_PATH.'/lib/process/ajax.php';
8
+ exit;
9
+ }
10
+
11
+ ?>
lib/metabox/about-template.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $current_user_object = wp_get_current_user();
3
+ $current_user_name = $current_user_object->user_firstname;
4
+ $current_user_name .= ' ' . $current_user_object->user_lastname;
5
+ ?>
6
+
7
+ <style>
8
+ .cmb-type-custom_about_the_author_callback th {
9
+ display: none;
10
+ }
11
+ .dashicons-heart {
12
+ background: -webkit-linear-gradient(top, #ff8cf7, #e2a5e0);
13
+ background: linear-gradient(top, #ff8cf7, #e2a5e0);
14
+ -webkit-background-clip: text;
15
+ -webkit-text-fill-color: transparent;
16
+ line-height: 1.5;
17
+ font-size: 13px;
18
+ width: 13px;
19
+ }
20
+ .cmb-type-custom_about_the_author_callback td {
21
+ padding: 15px 2px !important;
22
+ }
23
+ #about_the_author .inside {
24
+ padding-bottom: 0;
25
+ }
26
+ .te-button-container {
27
+ display: inline-block;
28
+ text-align: center;
29
+ width: 100%;
30
+ margin-bottom: .75em;
31
+ }
32
+ .te-button-container a.button-secondary {
33
+ margin: 0 5px !important;
34
+ }
35
+ </style>
36
+
37
+ <section class="te-button-container">
38
+ <a class="button-secondary" href="https://wordpress.org/support/plugin/timeline-express" target="_blank"><?php _e( 'Help!' , 'timeline-express' ); ?></a>
39
+ <a class="button-secondary" href="https://wordpress.org/support/view/plugin-reviews/timeline-express" target="_blank"><?php _e( 'Review' , 'timeline-express' ); ?></a>
40
+ <a class="button-secondary" href="http://www.evan-herman.com/contact/?contact-name=<?php echo $current_user_name; ?>&contact-reason=I want to make a donation for all your hard work" target="_blank"><?php _e( 'Donate' , 'timeline-express' ); ?></a>
41
+ <br />
42
+ <br />
43
+ <!-- social media buttons -->
44
+ <a href="http://facebook.com/yikesinc" title="WordPress" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/wordpress-icon.png" style="border: 0px none;" alt="Evan Herman - WordPress Profile" height="24" width="24"></a>
45
+ <a href="http://twitter.com/evanmherman" title="Twitter" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/twitter.png" style="border: 0px none;" alt="Evan Herman - Twitter Profile" height="24" width="24"></a>
46
+ <a href="https://www.linkedin.com/profile/view?id=46246110" title="Linkedin" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/linkedin.png" alt="Evan Herman - LinkedIn Profile" border="0" height="24" width="24"></a>
47
+ <a href="http://www.evan-herman.com/feed/" title="RSS Feed" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/rss_icon.png" alt="Evan Herman - RSS Feed" border="0" height="24" width="24"></a>
48
+ </section>
49
+
50
+ <em style="display:block;font-size:12px; text-align:center;margin:.5em 0;"><?php _e( 'this plugin was made with ' , 'timeline-express' ); ?><div class="dashicons dashicons-heart" style="line-height:1.2;"></div>, <?php _e( 'by' , 'timeline-express' ); ?> <a href="http://www.evan-herman.com" target="_blank">Evan Herman</a></em>
lib/metabox/example-functions.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Include and setup custom metaboxes and fields.
4
+ *
5
+ * @category YourThemeOrPlugin
6
+ * @package Metaboxes
7
+ * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
8
+ * @link https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
9
+ */
10
+
11
+ add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
12
+ /**
13
+ * Define the metabox and field configurations.
14
+ *
15
+ * @param array $meta_boxes
16
+ * @return array
17
+ */
18
+ function cmb_sample_metaboxes( array $meta_boxes ) {
19
+
20
+ // Start with an underscore to hide fields from custom fields list
21
+ $prefix = '_cmb_';
22
+
23
+ $meta_boxes['test_metabox'] = array(
24
+ 'id' => 'test_metabox',
25
+ 'title' => __( 'Test Metabox', 'cmb' ),
26
+ 'pages' => array( 'page', ), // Post type
27
+ 'context' => 'normal',
28
+ 'priority' => 'high',
29
+ 'show_names' => true, // Show field names on the left
30
+ // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
31
+ 'fields' => array(
32
+ array(
33
+ 'name' => __( 'Test Text', 'cmb' ),
34
+ 'desc' => __( 'field description (optional)', 'cmb' ),
35
+ 'id' => $prefix . 'test_text',
36
+ 'type' => 'text',
37
+ // 'repeatable' => true,
38
+ // 'on_front' => false, // Optionally designate a field to wp-admin only
39
+ ),
40
+ array(
41
+ 'name' => __( 'Test Text Small', 'cmb' ),
42
+ 'desc' => __( 'field description (optional)', 'cmb' ),
43
+ 'id' => $prefix . 'test_textsmall',
44
+ 'type' => 'text_small',
45
+ // 'repeatable' => true,
46
+ ),
47
+ array(
48
+ 'name' => __( 'Test Text Medium', 'cmb' ),
49
+ 'desc' => __( 'field description (optional)', 'cmb' ),
50
+ 'id' => $prefix . 'test_textmedium',
51
+ 'type' => 'text_medium',
52
+ // 'repeatable' => true,
53
+ ),
54
+ array(
55
+ 'name' => __( 'Website URL', 'cmb' ),
56
+ 'desc' => __( 'field description (optional)', 'cmb' ),
57
+ 'id' => $prefix . 'url',
58
+ 'type' => 'text_url',
59
+ // 'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols
60
+ // 'repeatable' => true,
61
+ ),
62
+ array(
63
+ 'name' => __( 'Test Text Email', 'cmb' ),
64
+ 'desc' => __( 'field description (optional)', 'cmb' ),
65
+ 'id' => $prefix . 'email',
66
+ 'type' => 'text_email',
67
+ // 'repeatable' => true,
68
+ ),
69
+ array(
70
+ 'name' => __( 'Test Time', 'cmb' ),
71
+ 'desc' => __( 'field description (optional)', 'cmb' ),
72
+ 'id' => $prefix . 'test_time',
73
+ 'type' => 'text_time',
74
+ ),
75
+ array(
76
+ 'name' => __( 'Time zone', 'cmb' ),
77
+ 'desc' => __( 'Time zone', 'cmb' ),
78
+ 'id' => $prefix . 'timezone',
79
+ 'type' => 'select_timezone',
80
+ ),
81
+ array(
82
+ 'name' => __( 'Test Date Picker', 'cmb' ),
83
+ 'desc' => __( 'field description (optional)', 'cmb' ),
84
+ 'id' => $prefix . 'test_textdate',
85
+ 'type' => 'text_date',
86
+ ),
87
+ array(
88
+ 'name' => __( 'Test Date Picker (UNIX timestamp)', 'cmb' ),
89
+ 'desc' => __( 'field description (optional)', 'cmb' ),
90
+ 'id' => $prefix . 'test_textdate_timestamp',
91
+ 'type' => 'text_date_timestamp',
92
+ // 'timezone_meta_key' => $prefix . 'timezone', // Optionally make this field honor the timezone selected in the select_timezone specified above
93
+ ),
94
+ array(
95
+ 'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb' ),
96
+ 'desc' => __( 'field description (optional)', 'cmb' ),
97
+ 'id' => $prefix . 'test_datetime_timestamp',
98
+ 'type' => 'text_datetime_timestamp',
99
+ ),
100
+ array(
101
+ 'name' => __( 'Test Date/Time Picker/Time zone Combo (serialized DateTime object)', 'cmb' ),
102
+ 'desc' => __( 'field description (optional)', 'cmb' ),
103
+ 'id' => $prefix . 'test_datetime_timestamp_timezone',
104
+ 'type' => 'text_datetime_timestamp_timezone',
105
+ ),
106
+ array(
107
+ 'name' => __( 'Test Money', 'cmb' ),
108
+ 'desc' => __( 'field description (optional)', 'cmb' ),
109
+ 'id' => $prefix . 'test_textmoney',
110
+ 'type' => 'text_money',
111
+ // 'before' => '£', // override '$' symbol if needed
112
+ // 'repeatable' => true,
113
+ ),
114
+ array(
115
+ 'name' => __( 'Test Color Picker', 'cmb' ),
116
+ 'desc' => __( 'field description (optional)', 'cmb' ),
117
+ 'id' => $prefix . 'test_colorpicker',
118
+ 'type' => 'colorpicker',
119
+ 'std' => '#ffffff'
120
+ ),
121
+ array(
122
+ 'name' => __( 'Test Text Area', 'cmb' ),
123
+ 'desc' => __( 'field description (optional)', 'cmb' ),
124
+ 'id' => $prefix . 'test_textarea',
125
+ 'type' => 'textarea',
126
+ ),
127
+ array(
128
+ 'name' => __( 'Test Text Area Small', 'cmb' ),
129
+ 'desc' => __( 'field description (optional)', 'cmb' ),
130
+ 'id' => $prefix . 'test_textareasmall',
131
+ 'type' => 'textarea_small',
132
+ ),
133
+ array(
134
+ 'name' => __( 'Test Text Area for Code', 'cmb' ),
135
+ 'desc' => __( 'field description (optional)', 'cmb' ),
136
+ 'id' => $prefix . 'test_textarea_code',
137
+ 'type' => 'textarea_code',
138
+ ),
139
+ array(
140
+ 'name' => __( 'Test Title Weeeee', 'cmb' ),
141
+ 'desc' => __( 'This is a title description', 'cmb' ),
142
+ 'id' => $prefix . 'test_title',
143
+ 'type' => 'title',
144
+ ),
145
+ array(
146
+ 'name' => __( 'Test Select', 'cmb' ),
147
+ 'desc' => __( 'field description (optional)', 'cmb' ),
148
+ 'id' => $prefix . 'test_select',
149
+ 'type' => 'select',
150
+ 'options' => array(
151
+ array( 'name' => __( 'Option One', 'cmb' ), 'value' => 'standard', ),
152
+ array( 'name' => __( 'Option Two', 'cmb' ), 'value' => 'custom', ),
153
+ array( 'name' => __( 'Option Three', 'cmb' ), 'value' => 'none', ),
154
+ ),
155
+ ),
156
+ array(
157
+ 'name' => __( 'Test Radio inline', 'cmb' ),
158
+ 'desc' => __( 'field description (optional)', 'cmb' ),
159
+ 'id' => $prefix . 'test_radio_inline',
160
+ 'type' => 'radio_inline',
161
+ 'options' => array(
162
+ array( 'name' => __( 'Option One', 'cmb' ), 'value' => 'standard', ),
163
+ array( 'name' => __( 'Option Two', 'cmb' ), 'value' => 'custom', ),
164
+ array( 'name' => __( 'Option Three', 'cmb' ), 'value' => 'none', ),
165
+ ),
166
+ ),
167
+ array(
168
+ 'name' => __( 'Test Radio', 'cmb' ),
169
+ 'desc' => __( 'field description (optional)', 'cmb' ),
170
+ 'id' => $prefix . 'test_radio',
171
+ 'type' => 'radio',
172
+ 'options' => array(
173
+ array( 'name' => __( 'Option One', 'cmb' ), 'value' => 'standard', ),
174
+ array( 'name' => __( 'Option Two', 'cmb' ), 'value' => 'custom', ),
175
+ array( 'name' => __( 'Option Three', 'cmb' ), 'value' => 'none', ),
176
+ ),
177
+ ),
178
+ array(
179
+ 'name' => __( 'Test Taxonomy Radio', 'cmb' ),
180
+ 'desc' => __( 'field description (optional)', 'cmb' ),
181
+ 'id' => $prefix . 'text_taxonomy_radio',
182
+ 'type' => 'taxonomy_radio',
183
+ 'taxonomy' => 'category', // Taxonomy Slug
184
+ ),
185
+ array(
186
+ 'name' => __( 'Test Taxonomy Select', 'cmb' ),
187
+ 'desc' => __( 'field description (optional)', 'cmb' ),
188
+ 'id' => $prefix . 'text_taxonomy_select',
189
+ 'type' => 'taxonomy_select',
190
+ 'taxonomy' => 'category', // Taxonomy Slug
191
+ ),
192
+ array(
193
+ 'name' => __( 'Test Taxonomy Multi Checkbox', 'cmb' ),
194
+ 'desc' => __( 'field description (optional)', 'cmb' ),
195
+ 'id' => $prefix . 'test_multitaxonomy',
196
+ 'type' => 'taxonomy_multicheck',
197
+ 'taxonomy' => 'post_tag', // Taxonomy Slug
198
+ ),
199
+ array(
200
+ 'name' => __( 'Test Checkbox', 'cmb' ),
201
+ 'desc' => __( 'field description (optional)', 'cmb' ),
202
+ 'id' => $prefix . 'test_checkbox',
203
+ 'type' => 'checkbox',
204
+ ),
205
+ array(
206
+ 'name' => __( 'Test Multi Checkbox', 'cmb' ),
207
+ 'desc' => __( 'field description (optional)', 'cmb' ),
208
+ 'id' => $prefix . 'test_multicheckbox',
209
+ 'type' => 'multicheck',
210
+ 'options' => array(
211
+ 'check1' => __( 'Check One', 'cmb' ),
212
+ 'check2' => __( 'Check Two', 'cmb' ),
213
+ 'check3' => __( 'Check Three', 'cmb' ),
214
+ ),
215
+ ),
216
+ array(
217
+ 'name' => __( 'Test wysiwyg', 'cmb' ),
218
+ 'desc' => __( 'field description (optional)', 'cmb' ),
219
+ 'id' => $prefix . 'test_wysiwyg',
220
+ 'type' => 'wysiwyg',
221
+ 'options' => array( 'textarea_rows' => 5, ),
222
+ ),
223
+ array(
224
+ 'name' => __( 'Test Image', 'cmb' ),
225
+ 'desc' => __( 'Upload an image or enter a URL.', 'cmb' ),
226
+ 'id' => $prefix . 'test_image',
227
+ 'type' => 'file',
228
+ ),
229
+ array(
230
+ 'name' => __( 'Multiple Files', 'cmb' ),
231
+ 'desc' => __( 'Upload or add multiple images/attachments.', 'cmb' ),
232
+ 'id' => $prefix . 'test_file_list',
233
+ 'type' => 'file_list',
234
+ ),
235
+ array(
236
+ 'name' => __( 'oEmbed', 'cmb' ),
237
+ 'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at <a href="http://codex.wordpress.org/Embeds">http://codex.wordpress.org/Embeds</a>.', 'cmb' ),
238
+ 'id' => $prefix . 'test_embed',
239
+ 'type' => 'oembed',
240
+ ),
241
+ ),
242
+ );
243
+
244
+ $meta_boxes['about_page_metabox'] = array(
245
+ 'id' => 'about_page_metabox',
246
+ 'title' => __( 'About Page Metabox', 'cmb' ),
247
+ 'pages' => array( 'page', ), // Post type
248
+ 'context' => 'normal',
249
+ 'priority' => 'high',
250
+ 'show_names' => true, // Show field names on the left
251
+ 'show_on' => array( 'key' => 'id', 'value' => array( 2, ), ), // Specific post IDs to display this metabox
252
+ 'fields' => array(
253
+ array(
254
+ 'name' => __( 'Test Text', 'cmb' ),
255
+ 'desc' => __( 'field description (optional)', 'cmb' ),
256
+ 'id' => $prefix . 'test_text',
257
+ 'type' => 'text',
258
+ ),
259
+ )
260
+ );
261
+
262
+ /**
263
+ * Metabox for the user profile screen
264
+ */
265
+ $meta_boxes['user_edit'] = array(
266
+ 'id' => 'user_edit',
267
+ 'title' => __( 'User Profile Metabox', 'cmb' ),
268
+ 'pages' => array( 'user' ), // Tells CMB to use user_meta vs post_meta
269
+ 'show_names' => true,
270
+ // 'cmb_styles' => true, // Show cmb bundled styles.. not needed on user profile page
271
+ 'fields' => array(
272
+ array(
273
+ 'name' => __( 'Extra Info', 'cmb' ),
274
+ 'desc' => __( 'field description (optional)', 'cmb' ),
275
+ 'id' => $prefix . 'exta_info',
276
+ 'type' => 'title',
277
+ 'on_front' => false,
278
+ ),
279
+ array(
280
+ 'name' => __( 'Avatar', 'cmb' ),
281
+ 'desc' => __( 'field description (optional)', 'cmb' ),
282
+ 'id' => $prefix . 'avatar',
283
+ 'type' => 'file',
284
+ 'save_id' => true,
285
+ ),
286
+ array(
287
+ 'name' => __( 'Facebook URL', 'cmb' ),
288
+ 'desc' => __( 'field description (optional)', 'cmb' ),
289
+ 'id' => $prefix . 'facebookurl',
290
+ 'type' => 'text_url',
291
+ ),
292
+ array(
293
+ 'name' => __( 'Twitter URL', 'cmb' ),
294
+ 'desc' => __( 'field description (optional)', 'cmb' ),
295
+ 'id' => $prefix . 'twitterurl',
296
+ 'type' => 'text_url',
297
+ ),
298
+ array(
299
+ 'name' => __( 'Google+ URL', 'cmb' ),
300
+ 'desc' => __( 'field description (optional)', 'cmb' ),
301
+ 'id' => $prefix . 'googleplusurl',
302
+ 'type' => 'text_url',
303
+ ),
304
+ array(
305
+ 'name' => __( 'Linkedin URL', 'cmb' ),
306
+ 'desc' => __( 'field description (optional)', 'cmb' ),
307
+ 'id' => $prefix . 'linkedinurl',
308
+ 'type' => 'text_url',
309
+ ),
310
+ array(
311
+ 'name' => __( 'User Field', 'cmb' ),
312
+ 'desc' => __( 'field description (optional)', 'cmb' ),
313
+ 'id' => $prefix . 'user_text_field',
314
+ 'type' => 'text',
315
+ ),
316
+ )
317
+ );
318
+
319
+ // Add other metaboxes as needed
320
+
321
+ return $meta_boxes;
322
+ }
323
+
324
+ add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
325
+ /**
326
+ * Initialize the metabox class.
327
+ */
328
+ function cmb_initialize_cmb_meta_boxes() {
329
+
330
+ if ( ! class_exists( 'cmb_Meta_Box' ) )
331
+ require_once 'init.php';
332
+
333
+ }
lib/metabox/helpers/timeline_express_MetaBox_ajax.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CMB ajax methods
5
+ * (i.e. a lot of work to get oEmbeds to work with non-post objects)
6
+ *
7
+ * @since 0.9.5
8
+ */
9
+ class timeline_express_MetaBox_ajax {
10
+
11
+ // A single instance of this class.
12
+ public static $instance = null;
13
+ // Whether to hijack the oembed cache system
14
+ public static $hijack = false;
15
+ public static $object_id = 0;
16
+ public static $embed_args = array();
17
+ public static $object_type = 'post';
18
+
19
+ /**
20
+ * Creates or returns an instance of this class.
21
+ * @since 0.1.0
22
+ * @return cmb_Meta_Box_types A single instance of this class.
23
+ */
24
+ public static function get() {
25
+ if ( self::$instance === null )
26
+ self::$instance = new self();
27
+
28
+ return self::$instance;
29
+ }
30
+
31
+ /**
32
+ * Handles our oEmbed ajax request
33
+ * @since 0.9.5
34
+ * @return object oEmbed embed code | fallback | error message
35
+ */
36
+ public function oembed_handler() {
37
+
38
+ // verify our nonce
39
+ if ( ! ( isset( $_REQUEST['cmb_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['cmb_ajax_nonce'], 'ajax_nonce' ) ) )
40
+ die();
41
+
42
+ // sanitize our search string
43
+ $oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
44
+
45
+ // send back error if empty
46
+ if ( empty( $oembed_string ) )
47
+ self::send_result( '<p class="ui-state-error-text">'. __( 'Please Try Again', 'cmb' ) .'</p>', false );
48
+
49
+ // Set width of embed
50
+ $embed_width = isset( $_REQUEST['oembed_width'] ) && intval( $_REQUEST['oembed_width'] ) < 640 ? intval( $_REQUEST['oembed_width'] ) : '640';
51
+
52
+ // set url
53
+ $oembed_url = esc_url( $oembed_string );
54
+ // set args
55
+ $embed_args = array( 'width' => $embed_width );
56
+
57
+ // Get embed code (or fallback link)
58
+ $html = self::get_oembed( $oembed_url, $_REQUEST['object_id'], array(
59
+ 'object_type' => isset( $_REQUEST['object_type'] ) ? $_REQUEST['object_type'] : 'post',
60
+ 'oembed_args' => $embed_args,
61
+ 'field_id' => $_REQUEST['field_id'],
62
+ ) );
63
+
64
+ self::send_result( $html );
65
+
66
+ }
67
+
68
+ /**
69
+ * Retrieves oEmbed from url/object ID
70
+ * @since 0.9.5
71
+ * @param string $url URL to retrieve oEmbed
72
+ * @param int $object_id Object ID
73
+ * @param array $args Arguments for method
74
+ * @return string html markup with embed or fallback
75
+ */
76
+ public function get_oembed( $url, $object_id, $args = array() ) {
77
+ global $wp_embed;
78
+
79
+ $oembed_url = esc_url( $url );
80
+ self::$object_id = absint( $object_id );
81
+
82
+ $args = self::$embed_args = wp_parse_args( $args, array(
83
+ 'object_type' => 'post',
84
+ 'oembed_args' => self::$embed_args,
85
+ 'field_id' => false,
86
+ ) );
87
+
88
+ // set the post_ID so oEmbed won't fail
89
+ $wp_embed->post_ID = self::$object_id;
90
+
91
+ // Special scenario if NOT a post object
92
+ if ( isset( $args['object_type'] ) && $args['object_type'] != 'post' ) {
93
+
94
+ // Ok, we need to hijack the oembed cache system
95
+ self::$hijack = true;
96
+ self::$object_type = $args['object_type'];
97
+
98
+ // Gets ombed cache from our object's meta (vs postmeta)
99
+ add_filter( 'get_post_metadata', array( 'cmb_Meta_Box_ajax', 'hijack_oembed_cache_get' ), 10, 3 );
100
+ // Sets ombed cache in our object's meta (vs postmeta)
101
+ add_filter( 'update_post_metadata', array( 'cmb_Meta_Box_ajax', 'hijack_oembed_cache_set' ), 10, 4 );
102
+
103
+ }
104
+
105
+ $embed_args = '';
106
+ foreach ( $args['oembed_args'] as $key => $val ) {
107
+ $embed_args .= " $key=\"$val\"";
108
+ }
109
+
110
+ // ping WordPress for an embed
111
+ $check_embed = $wp_embed->run_shortcode( '[embed'. $embed_args .']'. $oembed_url .'[/embed]' );
112
+
113
+ // fallback that WordPress creates when no oEmbed was found
114
+ $fallback = $wp_embed->maybe_make_link( $oembed_url );
115
+
116
+ // Send back our embed
117
+ if ( $check_embed && $check_embed != $fallback )
118
+ return '<div class="embed_status">'. $check_embed .'<p><a href="#" class="cmb_remove_file_button" rel="'. $args['field_id'] .'">'. __( 'Remove Embed', 'cmb' ) .'</a></p></div>';
119
+
120
+ // Otherwise, send back error info that no oEmbeds were found
121
+ return '<p class="ui-state-error-text">'. sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb' ), $fallback ) .' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
122
+
123
+ }
124
+
125
+ /**
126
+ * Hijacks retrieving of cached oEmbed.
127
+ * Returns cached data from relevant object metadata (vs postmeta)
128
+ *
129
+ * @since 0.9.5
130
+ * @param boolean $check Whether to retrieve postmeta or override
131
+ * @param int $object_id Object ID
132
+ * @param string $meta_key Object metakey
133
+ * @return mixed Object's oEmbed cached data
134
+ */
135
+ public function hijack_oembed_cache_get( $check, $object_id, $meta_key ) {
136
+
137
+ if ( ! self::$hijack || $object_id != self::$object_id )
138
+ return $check;
139
+
140
+ // get cached data
141
+ return get_metadata( self::$object_type, $object_id, $meta_key, true );
142
+
143
+ }
144
+
145
+ /**
146
+ * Hijacks saving of cached oEmbed.
147
+ * Saves cached data to relevant object metadata (vs postmeta)
148
+ *
149
+ * @since 0.9.5
150
+ * @param boolean $check Whether to continue setting postmeta
151
+ * @param int $object_id Object ID to get postmeta from
152
+ * @param string $meta_key Postmeta's key
153
+ * @param mixed $meta_value Value of the postmeta to be saved
154
+ * @return boolean Whether to continue setting
155
+ */
156
+ public function hijack_oembed_cache_set( $check, $object_id, $meta_key, $meta_value ) {
157
+ if ( ! self::$hijack || $object_id != self::$object_id )
158
+ return $check;
159
+
160
+ // Cache the result to our metadata
161
+ update_metadata( self::$object_type, $object_id, $meta_key, $meta_value );
162
+
163
+ // Anything other than `null` to cancel saving to postmeta
164
+ return true;
165
+ }
166
+
167
+ /**
168
+ * Helper to send json encoded response to ajax
169
+ * @since 0.9.5
170
+ * @param string $data Data to be shown via ajax
171
+ * @param boolean $success Success or fail
172
+ */
173
+ public static function send_result( $data, $success = true ) {
174
+ $found = $success ? 'found' : 'not found';
175
+ // send back our encoded data
176
+ echo json_encode( array( 'result' => $data, 'id' => $found ) );
177
+ die();
178
+ }
179
+
180
+ }
lib/metabox/helpers/timeline_express_MetaBox_filters.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Show On Filters
5
+ * Use the 'cmb_show_on' filter to further refine the conditions under which a metabox is displayed.
6
+ * Below you can limit it by ID and page template
7
+ *
8
+ * All methods in this class are automatically filtered
9
+ *
10
+ * @since 1.0.0
11
+ */
12
+ class timeline_express_MetaBox_filters {
13
+
14
+ /**
15
+ * Add metaboxes for an specific ID
16
+ * @since 1.0.0
17
+ * @param bool $display To display or not
18
+ * @param array $meta_box Metabox config array
19
+ * @return bool Whether to display this metabox on the current page.
20
+ */
21
+ public static function check_id( $display, $meta_box ) {
22
+
23
+ if ( ! isset( $meta_box['show_on']['key'] ) || 'id' !== $meta_box['show_on']['key'] )
24
+ return $display;
25
+
26
+ $object_id = cmb_Meta_Box::get_object_id();
27
+
28
+ if ( ! $object_id )
29
+ return false;
30
+
31
+ // If current page id is in the included array, display the metabox
32
+ if ( in_array( $object_id, (array) $meta_box['show_on']['value'] ) )
33
+ return true;
34
+
35
+ return false;
36
+ }
37
+
38
+ /**
39
+ * Add metaboxes for an specific Page Template
40
+ * @since 1.0.0
41
+ * @param bool $display To display or not
42
+ * @param array $meta_box Metabox config array
43
+ * @return bool Whether to display this metabox on the current page.
44
+ */
45
+ public static function check_page_template( $display, $meta_box ) {
46
+
47
+ if ( ! isset( $meta_box['show_on']['key'] ) || 'page-template' !== $meta_box['show_on']['key'] )
48
+ return $display;
49
+
50
+ $object_id = cmb_Meta_Box::get_object_id();
51
+
52
+ if ( ! $object_id || cmb_Meta_Box::get_object_type() !== 'post' )
53
+ return false;
54
+
55
+ // Get current template
56
+ $current_template = get_post_meta( $object_id, '_wp_page_template', true );
57
+
58
+ // See if there's a match
59
+ if ( $current_template && in_array( $current_template, (array) $meta_box['show_on']['value'] ) )
60
+ return true;
61
+
62
+ return false;
63
+ }
64
+
65
+ }
lib/metabox/helpers/timeline_express_MetaBox_types.php ADDED
@@ -0,0 +1,539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CMB field types
5
+ * @since 1.0.0
6
+ */
7
+ class timeline_express_MetaBox_types {
8
+
9
+ /**
10
+ * @todo test taxonomy methods with non-post objects
11
+ * @todo test all methods with non-post objects
12
+ */
13
+
14
+ /**
15
+ * A single instance of this class.
16
+ * @var cmb_Meta_Box_types object
17
+ */
18
+ public static $instance = null;
19
+
20
+ /**
21
+ * An iterator value for repeatable fields
22
+ * @var integer
23
+ */
24
+ public static $iterator = 0;
25
+
26
+ /**
27
+ * Holds cmb_valid_img_types
28
+ * @var array
29
+ */
30
+ public static $valid = array();
31
+
32
+ /**
33
+ * Current field type
34
+ * @var string
35
+ */
36
+ public static $type = 'text';
37
+
38
+ /**
39
+ * Current field
40
+ * @var array
41
+ */
42
+ public static $field;
43
+
44
+ /**
45
+ * Current field meta value
46
+ * @var mixed
47
+ */
48
+ public static $meta;
49
+
50
+ /**
51
+ * Creates or returns an instance of this class.
52
+ * @since 1.0.0
53
+ * @return cmb_Meta_Box_types A single instance of this class.
54
+ */
55
+ public static function get() {
56
+ if ( self::$instance === null )
57
+ self::$instance = new self();
58
+
59
+ return self::$instance;
60
+ }
61
+
62
+ /**
63
+ * Generates a field's description markup
64
+ * @since 1.0.0
65
+ * @param string $desc Field's description
66
+ * @param boolean $paragraph Paragraph tag or span
67
+ * @return strgin Field's description markup
68
+ */
69
+ private static function desc( $desc, $paragraph = false ) {
70
+ $tag = $paragraph ? 'p' : 'span';
71
+ return "\n<$tag class=\"cmb_metabox_description\">$desc</$tag>\n";
72
+ }
73
+
74
+ /**
75
+ * Generates repeatable text fields
76
+ * @since 1.0.0
77
+ * @param string $field Metabox field
78
+ * @param mixed $meta Field's meta value
79
+ * @param string $class Field's class attribute
80
+ * @param string $type Field Type
81
+ */
82
+ private static function repeat_text_field( $field, $meta, $class = '', $type = 'text' ) {
83
+
84
+ self::$field = $field; self::$meta = $meta; self::$type = $type;
85
+
86
+ // check for default content
87
+ $std = isset( $field['std'] ) ? array( $field['std'] ) : false;
88
+ // check for saved data
89
+ $meta = !empty( $meta ) && array_filter( $meta ) ? $meta : $std;
90
+
91
+
92
+ self::repeat_table_open( $class );
93
+
94
+ $class = $class ? $class .' widefat' : 'widefat';
95
+
96
+ if ( !empty( $meta ) ) {
97
+ foreach ( (array) $meta as $val ) {
98
+ self::repeat_row( self::text_input( $class, $val ) );
99
+ }
100
+ } else {
101
+ self::repeat_row( self::text_input( $class ) );
102
+ }
103
+
104
+ self::empty_row( self::text_input( $class ) );
105
+ self::repeat_table_close();
106
+ // reset iterator
107
+ self::$iterator = 0;
108
+ }
109
+
110
+ /**
111
+ * Text input field used by repeatable fields
112
+ * @since 1.0.0
113
+ * @param string $class Field's class attribute
114
+ * @param mixed $val Field's meta value
115
+ * @return string HTML text input
116
+ */
117
+ private static function text_input( $class = '', $val = '' ) {
118
+ self::$iterator = self::$iterator ? self::$iterator + 1 : 1;
119
+ $before = '';
120
+ if ( self::$field['type'] == 'text_money' )
121
+ $before = ! empty( self::$field['before'] ) ? ' ' : '$ ';
122
+ return $before . '<input type="'. self::$type .'" class="'. $class .'" name="'. self::$field['id'] .'[]" id="'. self::$field['id'] .'_'. self::$iterator .'" value="'. $val .'" data-id="'. self::$field['id'] .'" data-count="'. self::$iterator .'"/>';
123
+ }
124
+
125
+ /**
126
+ * Generates repeatable field opening table markup for repeatable fields
127
+ * @since 1.0.0
128
+ * @param string $class Field's class attribute
129
+ */
130
+ private static function repeat_table_open( $class = '' ) {
131
+ echo self::desc( self::$field['desc'] ), '<table id="', self::$field['id'], '_repeat" class="cmb-repeat-table ', $class ,'"><tbody>';
132
+ }
133
+
134
+ /**
135
+ * Generates repeatable feild closing table markup for repeatable fields
136
+ * @since 1.0.0
137
+ */
138
+ private static function repeat_table_close() {
139
+ echo '</tbody></table><p class="add-row"><a data-selector="', self::$field['id'] ,'_repeat" class="add-row-button button" href="#">'. __( 'Add Row', 'cmb' ) .'</a></p>';
140
+ }
141
+
142
+ /**
143
+ * Generates table row markup for repeatable fields
144
+ * @since 1.0.0
145
+ * @param string $input Table cell markup
146
+ */
147
+ private static function repeat_row( $input ) {
148
+ echo '<tr class="repeat-row">', self::repeat_cell( $input ) ,'</tr>';
149
+ }
150
+
151
+ /**
152
+ * Generates the empty table row markup (for duplication) for repeatable fields
153
+ * @since 1.0.0
154
+ * @param string $input Table cell markup
155
+ */
156
+ private static function empty_row( $input ) {
157
+ echo '<tr class="empty-row">', self::repeat_cell( $input ) ,'</tr>';
158
+ }
159
+
160
+ /**
161
+ * Generates table cell markup for repeatable fields
162
+ * @since 1.0.0
163
+ * @param string $input Text input field
164
+ * @return string HTML table cell markup
165
+ */
166
+ private static function repeat_cell( $input ) {
167
+ return '<td>'. $input .'</td><td class="remove-row"><a class="button remove-row-button" href="#">'. __( 'Remove', 'cmb' ) .'</a></td>';
168
+ }
169
+
170
+ /**
171
+ * Determine a file's extension
172
+ * @since 1.0.0
173
+ * @param string $file File url
174
+ * @return string|false File extension or false
175
+ */
176
+ public static function get_file_ext( $file ) {
177
+ $parsed = @parse_url( $file, PHP_URL_PATH );
178
+ return $parsed ? strtolower( pathinfo( $parsed, PATHINFO_EXTENSION ) ) : false;
179
+ }
180
+
181
+ /**
182
+ * Determines if a file has a valid image extension
183
+ * @since 1.0.0
184
+ * @param string $file File url
185
+ * @return bool Whether file has a valid image extension
186
+ */
187
+ public static function is_valid_img_ext( $file ) {
188
+ $file_ext = self::get_file_ext( $file );
189
+
190
+ self::$valid = empty( self::$valid ) ? (array) apply_filters( 'cmb_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' ) ) : self::$valid;
191
+
192
+ return ( $file_ext && in_array( $file_ext, self::$valid ) );
193
+ }
194
+
195
+
196
+ /**
197
+ * Begin Field Types
198
+ */
199
+ /** Custom About Type */
200
+ public static function custom_about_the_author_callback( $field, $meta ) {
201
+ require_once TIMELINE_EXPRESS_PATH . '/lib/metabox/about-template.php';
202
+ }
203
+
204
+ public static function text( $field, $meta ) {
205
+ echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'], true );
206
+ }
207
+
208
+ public static function text_repeat( $field, $meta ) {
209
+ self::repeat_text_field( $field, $meta );
210
+ }
211
+
212
+ public static function text_small( $field, $meta ) {
213
+ echo '<input class="cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'] );
214
+ }
215
+
216
+ public static function text_small_repeat( $field, $meta ) {
217
+ self::repeat_text_field( $field, $meta, 'cmb_text_small' );
218
+ }
219
+
220
+ public static function text_medium( $field, $meta ) {
221
+ echo '<input class="cmb_text_medium" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'] );
222
+ }
223
+
224
+ public static function text_medium_repeat( $field, $meta ) {
225
+ self::repeat_text_field( $field, $meta, 'cmb_text_medium' );
226
+ }
227
+
228
+ public static function text_email( $field, $meta ) {
229
+ echo '<input class="cmb_text_email cmb_text_medium" type="email" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'], true );
230
+ }
231
+
232
+ public static function text_email_repeat( $field, $meta ) {
233
+ self::repeat_text_field( $field, $meta, 'cmb_text_email cmb_text_medium', 'email' );
234
+ }
235
+
236
+ public static function text_url( $field, $meta ) {
237
+ $val = ! empty( $meta ) ? $meta : $field['std'];
238
+ $protocols = isset( $field['protocols'] ) ? (array) $field['protocols'] : null;
239
+ $val = $val ? esc_url( $val, $protocols ) : '';
240
+
241
+ echo '<input class="cmb_text_url cmb_text_medium" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $val, '" />', self::desc( $field['desc'], true );
242
+ }
243
+
244
+ public static function text_url_repeat( $field, $meta ) {
245
+ $val = ! empty( $meta ) ? $meta : $field['std'];
246
+ $protocols = isset( $field['protocols'] ) ? (array) $field['protocols'] : null;
247
+ $val = $val ? esc_url( $val, $protocols ) : '';
248
+ self::repeat_text_field( $field, $val, 'cmb_text_url cmb_text_medium' );
249
+ }
250
+
251
+ public static function text_date( $field, $meta ) {
252
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'] );
253
+ }
254
+
255
+ public static function text_date_timestamp( $field, $meta ) {
256
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />', self::desc( $field['desc'] );
257
+ }
258
+
259
+ public static function text_datetime_timestamp( $field, $meta, $object_id ) {
260
+
261
+ // This will be used if there is a select_timezone set for this field
262
+ $tz_offset = cmb_Meta_Box::field_timezone_offset( $object_id );
263
+ if ( !empty( $tz_offset ) ) {
264
+ $meta -= $tz_offset;
265
+ }
266
+
267
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
268
+ echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" />', self::desc( $field['desc'] );
269
+ }
270
+
271
+ public static function text_datetime_timestamp_timezone( $field, $meta ) {
272
+
273
+ $datetime = unserialize($meta);
274
+ $meta = $tzstring = false;
275
+
276
+
277
+ if ( $datetime && $datetime instanceof DateTime ) {
278
+ $tz = $datetime->getTimezone();
279
+ $tzstring = $tz->getName();
280
+
281
+ $meta = $datetime->getTimestamp() + $tz->getOffset( new DateTime('NOW') );
282
+ }
283
+
284
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
285
+ echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" />';
286
+
287
+ echo '<select name="', $field['id'], '[timezone]" id="', $field['id'], '_timezone">';
288
+ echo wp_timezone_choice( $tzstring );
289
+ echo '</select>', self::desc( $field['desc'] );
290
+ }
291
+
292
+ public static function text_time( $field, $meta ) {
293
+ echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'] );
294
+ }
295
+
296
+ public static function select_timezone( $field, $meta ) {
297
+ $meta = '' !== $meta ? $meta : $field['std'];
298
+ if ( '' === $meta )
299
+ $meta = cmb_Meta_Box::timezone_string();
300
+
301
+ echo '<select name="', $field['id'], '" id="', $field['id'], '">';
302
+ echo wp_timezone_choice( $meta );
303
+ echo '</select>';
304
+ }
305
+
306
+ public static function text_money( $field, $meta ) {
307
+ echo ! empty( $field['before'] ) ? '' : '$', ' <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'] );
308
+ }
309
+
310
+ public static function text_money_repeat( $field, $meta ) {
311
+ self::repeat_text_field( $field, $meta, 'cmb_text_money' );
312
+ }
313
+
314
+ public static function colorpicker( $field, $meta ) {
315
+ $meta = '' !== $meta ? $meta : $field['std'];
316
+ $hex_color = '(([a-fA-F0-9]){3}){1,2}$';
317
+ if ( preg_match( '/^' . $hex_color . '/i', $meta ) ) // Value is just 123abc, so prepend #.
318
+ $meta = '#' . $meta;
319
+ elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta ) ) // Value doesn't match #123abc, so sanitize to just #.
320
+ $meta = "#";
321
+ echo '<input class="cmb_colorpicker cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" />', self::desc( $field['desc'] );
322
+ }
323
+
324
+ public static function textarea( $field, $meta ) {
325
+ echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>', self::desc( $field['desc'], true );
326
+ }
327
+
328
+ public static function textarea_small( $field, $meta ) {
329
+ echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>', self::desc( $field['desc'], true );
330
+ }
331
+
332
+ public static function textarea_code( $field, $meta ) {
333
+ echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="cmb_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>', self::desc( $field['desc'], true );
334
+ }
335
+
336
+ public static function select( $field, $meta ) {
337
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
338
+ echo '<select name="', $field['id'], '" id="', $field['id'], '">';
339
+ foreach ($field['options'] as $option) {
340
+ echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
341
+ }
342
+ echo '</select>', self::desc( $field['desc'], true );
343
+ }
344
+
345
+ public static function radio_inline( $field, $meta ) {
346
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
347
+ echo '<ul class="cmb_radio_inline">';
348
+ $i = 1;
349
+ foreach ($field['options'] as $option) {
350
+ echo '<li class="cmb_radio_inline_option"><input type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', checked( $meta == $option['value'] ), ' /> <label for="', $field['id'], $i, '">', $option['name'], '</label></li>';
351
+ $i++;
352
+ }
353
+ echo '</ul>', self::desc( $field['desc'], true );
354
+ }
355
+
356
+ public static function radio( $field, $meta ) {
357
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
358
+ echo '<ul>';
359
+ $i = 1;
360
+ foreach ($field['options'] as $option) {
361
+ echo '<li class="cmb_radio_inline_option"><input type="radio" name="', $field['id'], '" id="', $field['id'], $i,'" value="', $option['value'], '" ', checked( $meta == $option['value'] ), ' /> <label for="', $field['id'], $i, '">', $option['name'].'</label></li>';
362
+ $i++;
363
+ }
364
+ echo '</ul>', self::desc( $field['desc'], true );
365
+ }
366
+
367
+ public static function checkbox( $field, $meta ) {
368
+ echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '" ', checked( ! empty( $meta ) ), ' /> <label for="', $field['id'], '">', self::desc( $field['desc'] ) ,'</label>';
369
+ }
370
+
371
+ public static function multicheck( $field, $meta ) {
372
+ echo '<ul>';
373
+ $i = 1;
374
+ foreach ( $field['options'] as $value => $name ) {
375
+ echo '<li><input type="checkbox" name="', $field['id'], '[]" id="', $field['id'], $i, '" value="', $value, '" ', checked( in_array( $value, $meta ) ), ' /> <label for="', $field['id'], $i, '">', $name, '</label></li>';
376
+ $i++;
377
+ }
378
+ echo '</ul>', self::desc( $field['desc'] );
379
+ }
380
+
381
+ public static function title( $field, $meta, $object_id, $object_type ) {
382
+ $tag = $object_type == 'post' ? 'h5' : 'h3';
383
+ echo '<'. $tag .' class="cmb_metabox_title">', $field['name'], '</'. $tag .'>', self::desc( $field['desc'], true );
384
+ }
385
+
386
+ public static function wysiwyg( $field, $meta ) {
387
+ wp_editor( $meta ? $meta : $field['std'], $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
388
+ echo self::desc( $field['desc'], true );
389
+ }
390
+
391
+ public static function taxonomy_select( $field, $meta, $object_id ) {
392
+
393
+ echo '<select name="', $field['id'], '" id="', $field['id'], '">';
394
+ $names = wp_get_object_terms( $object_id, $field['taxonomy'] );
395
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
396
+ foreach ( $terms as $term ) {
397
+ if ( !is_wp_error( $names ) && !empty( $names ) && ! strcmp( $term->slug, $names[0]->slug ) ) {
398
+ echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>';
399
+ } else {
400
+ echo '<option value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name . '</option>';
401
+ }
402
+ }
403
+ echo '</select>', self::desc( $field['desc'], true );
404
+ }
405
+
406
+ public static function taxonomy_radio( $field, $meta, $object_id ) {
407
+
408
+ $names = wp_get_object_terms( $object_id, $field['taxonomy'] );
409
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
410
+ echo '<ul>';
411
+ $i = 1;
412
+ foreach ( $terms as $term ) {
413
+ $checked = ( !is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) );
414
+
415
+ echo '<li class="cmb_radio_inline_option"><input type="radio" name="', $field['id'], '" id="', $field['id'], $i,'" value="'. $term->slug . '" ', checked( $checked ), ' /> <label for="', $field['id'], $i, '">' . $term->name . '</label></li>';
416
+ $i++;
417
+ }
418
+ echo '</ul>', self::desc( $field['desc'], true );
419
+ }
420
+
421
+ public static function taxonomy_multicheck( $field, $meta, $object_id ) {
422
+ echo '<ul>';
423
+ $names = wp_get_object_terms( $object_id, $field['taxonomy'] );
424
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
425
+ $i = 1;
426
+ foreach ( $terms as $term ) {
427
+ echo '<li><input type="checkbox" name="', $field['id'], '[]" id="', $field['id'], $i,'" value="'. $term->slug . '" ';
428
+ foreach ($names as $name) {
429
+ checked( $term->slug == $name->slug );
430
+ }
431
+
432
+ echo ' /> <label for="', $field['id'], $i, '">' . $term->name . '</label></li>';
433
+ $i++;
434
+ }
435
+ echo '</ul>', self::desc( $field['desc'] );
436
+ }
437
+
438
+ public static function file_list( $field, $meta, $object_id ) {
439
+
440
+ echo '<input class="cmb_upload_file cmb_upload_list" type="hidden" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
441
+ echo '<input class="cmb_upload_button button cmb_upload_list" type="button" value="'. __( 'Add or Upload File', 'cmb' ) .'" />', self::desc( $field['desc'], true );
442
+
443
+ echo '<ul id="', $field['id'], '_status" class="cmb_media_status attach_list">';
444
+
445
+ if ( $meta ) {
446
+
447
+ foreach ( $meta as $id => $fullurl ) {
448
+ if ( self::is_valid_img_ext( $fullurl ) ) {
449
+ echo
450
+ '<li class="img_status">',
451
+ wp_get_attachment_image( $id, array( 50, 50 ) ),
452
+ '<p><a href="#" class="cmb_remove_file_button">'. __( 'Remove Image', 'cmb' ) .'</a></p>
453
+ <input type="hidden" id="filelist-', $id ,'" name="', $field['id'] ,'[', $id ,']" value="', $fullurl ,'" />
454
+ </li>';
455
+
456
+ } else {
457
+ $parts = explode( '/', $fullurl );
458
+ for ( $i = 0; $i < count( $parts ); ++$i ) {
459
+ $title = $parts[$i];
460
+ }
461
+ echo
462
+ '<li>',
463
+ __( 'File:', 'cmb' ), ' <strong>', $title, '</strong>&nbsp;&nbsp;&nbsp; (<a href="', $fullurl, '" target="_blank" rel="external">'. __( 'Download', 'cmb' ) .'</a> / <a href="#" class="cmb_remove_file_button">'. __( 'Remove', 'cmb' ) .'</a>)
464
+ <input type="hidden" id="filelist-', $id ,'" name="', $field['id'] ,'[', $id ,']" value="', $fullurl ,'" />
465
+ </li>';
466
+ }
467
+ }
468
+ }
469
+
470
+ echo '</ul>';
471
+ }
472
+
473
+ public static function file( $field, $meta, $object_id, $object_type ) {
474
+
475
+ $input_type_url = 'hidden';
476
+ if ( 'url' == $field['allow'] || ( is_array( $field['allow'] ) && in_array( 'url', $field['allow'] ) ) )
477
+ $input_type_url = 'text';
478
+ echo '<input class="cmb_upload_file" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
479
+ echo '<input class="cmb_upload_button button" type="button" value="'. __( 'Add or Upload File', 'cmb' ) .'" />';
480
+
481
+ $_id_name = $field['id'] .'_id';
482
+
483
+ $_id_meta = get_metadata( $object_type, $object_id, $_id_name, ( ! isset( $field['multiple'] ) || ! $field['multiple'] ) );
484
+
485
+ // If there is no ID saved yet, try to get it from the url
486
+ if ( $meta && ! $_id_meta ) {
487
+ $_id_meta = cmb_Meta_Box::image_id_from_url( esc_url_raw( $meta ) );
488
+ }
489
+
490
+ echo '<input class="cmb_upload_file_id" type="hidden" id="', $_id_name, '" name="', $_id_name, '" value="', $_id_meta, '" />',
491
+ self::desc( $field['desc'], true ),
492
+ '<div id="', $field['id'], '_status" class="cmb_media_status">';
493
+ if ( ! empty( $meta ) ) {
494
+
495
+ if ( self::is_valid_img_ext( $meta ) ) {
496
+ echo '<div class="img_status">';
497
+ echo '<img style="max-width: 350px; width: 100%; height: auto;" src="', $meta, '" alt="" />';
498
+ echo '<p><a href="#" class="cmb_remove_file_button" rel="', $field['id'], '">'. __( 'Remove Image', 'cmb' ) .'</a></p>';
499
+ echo '</div>';
500
+ } else {
501
+ // $file_ext = self::get_file_ext( $meta );
502
+ $parts = explode( '/', $meta );
503
+ for ( $i = 0; $i < count( $parts ); ++$i ) {
504
+ $title = $parts[$i];
505
+ }
506
+ echo __( 'File:', 'cmb' ), ' <strong>', $title, '</strong>&nbsp;&nbsp;&nbsp; (<a href="', $meta, '" target="_blank" rel="external">'. __( 'Download', 'cmb' ) .'</a> / <a href="#" class="cmb_remove_file_button" rel="', $field['id'], '">'. __( 'Remove', 'cmb' ) .'</a>)';
507
+ }
508
+ }
509
+ echo '</div>';
510
+ }
511
+
512
+ public static function oembed( $field, $meta, $object_id, $object_type ) {
513
+ echo '<input class="cmb_oembed" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', self::desc( $field['desc'], true );
514
+ echo '<p class="cmb-spinner spinner" style="display:none;"><img src="'. admin_url( '/images/wpspin_light.gif' ) .'" alt="spinner"/></p>';
515
+ echo '<div id="', $field['id'], '_status" class="cmb_media_status ui-helper-clearfix embed_wrap">';
516
+
517
+ if ( $meta != '' )
518
+ echo cmb_Meta_Box_ajax::get_oembed( $meta, $object_id, array(
519
+ 'object_type' => $object_type,
520
+ 'oembed_args' => array( 'width' => '640' ),
521
+ 'field_id' => $field['id'],
522
+ ) );
523
+
524
+ echo '</div>';
525
+ }
526
+
527
+ /**
528
+ * Default fallback. Allows rendering fields via "cmb_render_$name" hook
529
+ * @since 1.0.0
530
+ * @param string $name Non-existent method name
531
+ * @param array $arguments All arguments passed to the method
532
+ */
533
+ public function __call( $name, $arguments ) {
534
+ list( $field, $meta, $object_id, $object_type ) = $arguments;
535
+ // When a non-registered field is called, send it through an action.
536
+ do_action( "cmb_render_$name", $field, $meta, $object_id, $object_type );
537
+ }
538
+
539
+ }
lib/metabox/images/ico-delete.png ADDED
Binary file
lib/metabox/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
lib/metabox/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
lib/metabox/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
lib/metabox/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
lib/metabox/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
lib/metabox/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
lib/metabox/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
lib/metabox/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
lib/metabox/images/ui-icons_222222_256x240.png ADDED
Binary file
lib/metabox/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
lib/metabox/images/ui-icons_454545_256x240.png ADDED
Binary file
lib/metabox/images/ui-icons_888888_256x240.png ADDED
Binary file
lib/metabox/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
lib/metabox/init.php ADDED
@@ -0,0 +1,944 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Script Name: Custom Metaboxes and Fields
4
+ Contributors: Andrew Norcross (@norcross / andrewnorcross.com)
5
+ Jared Atchison (@jaredatch / jaredatchison.com)
6
+ Bill Erickson (@billerickson / billerickson.net)
7
+ Justin Sternberg (@jtsternberg / dsgnwrks.pro)
8
+ Description: This will create metaboxes with custom fields that will blow your mind.
9
+ Version: 1.0.0
10
+ */
11
+
12
+ /**
13
+ * Released under the GPL license
14
+ * http://www.opensource.org/licenses/gpl-license.php
15
+ *
16
+ * This is an add-on for WordPress
17
+ * http://wordpress.org/
18
+ *
19
+ * **********************************************************************
20
+ * This program is free software; you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation; either version 2 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ * **********************************************************************
30
+ */
31
+
32
+ /************************************************************************
33
+ You should not edit the code below or things might explode!
34
+ *************************************************************************/
35
+
36
+ // Autoload helper classes
37
+ spl_autoload_register('timeline_express_MetaBoxes::autoload_helpers');
38
+
39
+ // for PHP versions < 5.3
40
+ if ( !defined( '__DIR__' ) ) {
41
+ define( '__DIR__', dirname( __FILE__ ) );
42
+ }
43
+
44
+ $meta_boxes = array();
45
+ $meta_boxes = apply_filters( 'cmb_meta_boxes' , $meta_boxes );
46
+ foreach ( $meta_boxes as $meta_box ) {
47
+ $my_box = new timeline_express_MetaBoxes( $meta_box );
48
+ }
49
+
50
+ /**
51
+ * Validate value of meta fields
52
+ * Define ALL validation methods inside this class and use the names of these
53
+ * methods in the definition of meta boxes (key 'validate_func' of each field)
54
+ */
55
+ class timeline_express_Meta_Box_Validate {
56
+ function check_text( $text ) {
57
+ if ($text != 'hello') {
58
+ return false;
59
+ }
60
+ return true;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Defines the url to which is used to load local resources.
66
+ * This may need to be filtered for local Window installations.
67
+ * If resources do not load, please check the wiki for details.
68
+ */
69
+ function get_timeline_express_meta_box_url() {
70
+
71
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
72
+ // Windows
73
+ $content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
74
+ $content_url = str_replace( $content_dir, WP_CONTENT_URL, dirname(__FILE__) );
75
+ $cmb_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
76
+
77
+ } else {
78
+ $cmb_url = str_replace(
79
+ array(WP_CONTENT_DIR, WP_PLUGIN_DIR),
80
+ array(WP_CONTENT_URL, WP_PLUGIN_URL),
81
+ dirname( __FILE__ )
82
+ );
83
+ }
84
+
85
+ return trailingslashit( apply_filters('cmb_meta_box_url', $cmb_url ) );
86
+ }
87
+
88
+ define( 'CMB_META_BOX_URL', get_timeline_express_meta_box_url() );
89
+
90
+ /**
91
+ * Create meta boxes
92
+ */
93
+ class timeline_express_MetaBoxes {
94
+ protected $_meta_box;
95
+ protected $form_id = 'post';
96
+ protected static $field = array();
97
+ protected static $object_id = 0;
98
+ // Type of object being saved. (e.g., post, user, or comment)
99
+ protected static $object_type = false;
100
+ protected static $is_enqueued = false;
101
+ protected static $mb_object_type = 'post';
102
+ const CMB_VERSION = '1.0.0';
103
+
104
+ /**
105
+ * Get started
106
+ */
107
+ function __construct( $meta_box ) {
108
+
109
+ $allow_frontend = apply_filters( 'cmb_allow_frontend', true, $meta_box );
110
+
111
+ if ( ! is_admin() && ! $allow_frontend )
112
+ return;
113
+
114
+ $this->_meta_box = $meta_box;
115
+
116
+ self::set_mb_type( $meta_box );
117
+
118
+ $types = wp_list_pluck( $meta_box['fields'], 'type' );
119
+ $upload = in_array( 'file', $types ) || in_array( 'file_list', $types );
120
+
121
+ global $pagenow;
122
+
123
+ $show_filters = 'timeline_express_MetaBox_filters';
124
+ foreach ( get_class_methods( $show_filters ) as $filter ) {
125
+ add_filter( 'cmb_show_on', array( $show_filters, $filter ), 10, 2 );
126
+ }
127
+
128
+ // register our scripts and styles for cmb
129
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ), 8 );
130
+
131
+ if ( self::get_object_type() == 'post' ) {
132
+ add_action( 'admin_menu', array( $this, 'add_metaboxes' ) );
133
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
134
+ add_action( 'admin_enqueue_scripts', array( $this, 'do_scripts' ) );
135
+
136
+ if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
137
+ add_action( 'admin_head', array( $this, 'add_post_enctype' ) );
138
+ }
139
+
140
+ }
141
+ if ( self::get_object_type() == 'user' ) {
142
+
143
+ $priority = 10;
144
+ if ( isset( $meta_box['priority'] ) ) {
145
+ if ( is_numeric( $meta_box['priority'] ) )
146
+ $priority = $meta_box['priority'];
147
+ elseif ( $meta_box['priority'] == 'high' )
148
+ $priority = 5;
149
+ elseif ( $meta_box['priority'] == 'low' )
150
+ $priority = 20;
151
+ }
152
+ add_action( 'show_user_profile', array( $this, 'user_metabox' ), $priority );
153
+ add_action( 'edit_user_profile', array( $this, 'user_metabox' ), $priority );
154
+
155
+ add_action( 'personal_options_update', array( $this, 'save_user' ) );
156
+ add_action( 'edit_user_profile_update', array( $this, 'save_user' ) );
157
+ if ( $upload && in_array( $pagenow, array( 'profile.php', 'user-edit.php' ) ) ) {
158
+ $this->form_id = 'your-profile';
159
+ add_action( 'admin_head', array( $this, 'add_post_enctype' ) );
160
+ }
161
+ }
162
+
163
+ }
164
+
165
+ /**
166
+ * Autoloads files with classes when needed
167
+ * @since 1.0.0
168
+ * @param string $class_name Name of the class being requested
169
+ */
170
+ public static function autoload_helpers( $class_name ) {
171
+ if ( class_exists( $class_name, false ) )
172
+ return;
173
+
174
+ $file = __DIR__ .'/helpers/'. $class_name .'.php';
175
+ if ( file_exists( $file ) )
176
+ @include( $file );
177
+ }
178
+
179
+ /**
180
+ * Registers scripts and styles for CMB
181
+ * @since 1.0.0
182
+ */
183
+ function register_scripts() {
184
+
185
+ // Should only be run once
186
+ if ( self::$is_enqueued )
187
+ return;
188
+
189
+ global $wp_version;
190
+ // Only use minified files if SCRIPT_DEBUG is off
191
+ $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
192
+
193
+ // scripts required for cmb
194
+ $scripts = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', /*'media-upload', */'cmb-timepicker' );
195
+ // styles required for cmb
196
+ $styles = array();
197
+
198
+ // if we're 3.5 or later, user wp-color-picker
199
+ if ( 3.5 <= $wp_version ) {
200
+ $scripts[] = 'wp-color-picker';
201
+ $styles[] = 'wp-color-picker';
202
+ if ( ! is_admin() ) {
203
+ // we need to register colorpicker on the front-end
204
+ wp_register_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), self::CMB_VERSION );
205
+ wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), self::CMB_VERSION );
206
+ wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
207
+ 'clear' => __( 'Clear' ),
208
+ 'defaultString' => __( 'Default' ),
209
+ 'pick' => __( 'Select Color' ),
210
+ 'current' => __( 'Current Color' ),
211
+ ) );
212
+ }
213
+ } else {
214
+ // otherwise use the older 'farbtastic'
215
+ $scripts[] = 'farbtastic';
216
+ $styles[] = 'farbtastic';
217
+ }
218
+ wp_register_script( 'cmb-timepicker', CMB_META_BOX_URL . 'js/jquery.timePicker.min.js' );
219
+ wp_register_script( 'cmb-scripts', CMB_META_BOX_URL .'js/cmb'. $min .'.js', $scripts, self::CMB_VERSION );
220
+
221
+ wp_enqueue_media();
222
+
223
+ wp_localize_script( 'cmb-scripts', 'cmb_l10', array(
224
+ 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ),
225
+ 'object_id' => self::get_object_id(),
226
+ 'object_type' => self::get_object_type(),
227
+ 'upload_file' => 'Use this file',
228
+ 'remove_image' => 'Remove Image',
229
+ 'remove_file' => 'Remove',
230
+ 'file' => 'File:',
231
+ 'download' => 'Download',
232
+ 'ajaxurl' => admin_url( '/admin-ajax.php' ),
233
+ ) );
234
+
235
+ wp_register_style( 'cmb-styles', CMB_META_BOX_URL . 'style'. $min .'.css', $styles );
236
+
237
+ // Ok, we've enqueued our scripts/styles
238
+ self::$is_enqueued = true;
239
+ }
240
+
241
+ /**
242
+ * Enqueues scripts and styles for CMB
243
+ * @since 1.0.0
244
+ */
245
+ function do_scripts( $hook ) {
246
+ // only enqueue our scripts/styles on the proper pages
247
+ if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
248
+ wp_enqueue_script( 'cmb-scripts' );
249
+
250
+ // default is to show cmb styles on post pages
251
+ if ( ! isset( $this->_meta_box['cmb_styles'] ) || $this->_meta_box['cmb_styles'] != false )
252
+ wp_enqueue_style( 'cmb-styles' );
253
+ }
254
+ }
255
+
256
+ /**
257
+ * Add encoding attribute
258
+ */
259
+ function add_post_enctype() {
260
+ echo '
261
+ <script type="text/javascript">
262
+ jQuery(document).ready(function(){
263
+ jQuery("#'. $this->form_id .'").attr("enctype", "multipart/form-data");
264
+ jQuery("#'. $this->form_id .'").attr("encoding", "multipart/form-data");
265
+ });
266
+ </script>';
267
+ }
268
+
269
+ /**
270
+ * Add metaboxes (to 'post' object type)
271
+ */
272
+ function add_metaboxes() {
273
+ $this->_meta_box['context'] = empty( $this->_meta_box['context'] ) ? 'normal' : $this->_meta_box['context'];
274
+ $this->_meta_box['priority'] = empty( $this->_meta_box['priority'] ) ? 'high' : $this->_meta_box['priority'];
275
+ $this->_meta_box['show_on'] = empty( $this->_meta_box['show_on'] ) ? array( 'key' => false, 'value' => false ) : $this->_meta_box['show_on'];
276
+
277
+ foreach ( $this->_meta_box['pages'] as $page ) {
278
+ if ( apply_filters( 'cmb_show_on', true, $this->_meta_box ) )
279
+ add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array( $this, 'post_metabox' ), $page, $this->_meta_box['context'], $this->_meta_box['priority']) ;
280
+ }
281
+ }
282
+
283
+ /**
284
+ * Display metaboxes for a post object
285
+ * @since 1.0.0
286
+ */
287
+ function post_metabox() {
288
+ if ( ! $this->_meta_box )
289
+ return;
290
+
291
+ self::show_form( $this->_meta_box, get_the_ID(), 'post' );
292
+
293
+ }
294
+
295
+ /**
296
+ * Display metaboxes for a user object
297
+ * @since 1.0.0
298
+ */
299
+ function user_metabox() {
300
+ if ( ! $this->_meta_box )
301
+ return;
302
+
303
+ if ( 'user' != self::set_mb_type( $this->_meta_box ) )
304
+ return;
305
+
306
+ if ( ! apply_filters( 'cmb_show_on', true, $this->_meta_box ) )
307
+ return;
308
+
309
+ wp_enqueue_script( 'cmb-scripts' );
310
+
311
+ // default is to NOT show cmb styles on user profile page
312
+ if ( isset( $this->_meta_box['cmb_styles'] ) && $this->_meta_box['cmb_styles'] == true )
313
+ wp_enqueue_style( 'cmb-styles' );
314
+
315
+ self::show_form( $this->_meta_box );
316
+
317
+ }
318
+
319
+ /**
320
+ * Loops through and displays fields
321
+ * @since 1.0.0
322
+ * @param array $meta_box Metabox config array
323
+ * @param int $object_id Object ID
324
+ * @param string $object_type Type of object being saved. (e.g., post, user, or comment)
325
+ */
326
+ public static function show_form( $meta_box, $object_id = 0, $object_type = '' ) {
327
+
328
+ // Set/get type
329
+ $object_type = self::set_object_type( $object_type ? $object_type : self::set_mb_type( $meta_box ) );
330
+ // Set/get ID
331
+ $object_id = self::set_object_id( $object_id ? $object_id : self::get_object_id() );
332
+
333
+ // get box types
334
+ $types = timeline_express_MetaBox_types::get();
335
+
336
+ // Use nonce for verification
337
+ echo "\n<!-- Begin CMB Fields -->\n";
338
+ wp_nonce_field( self::nonce(), 'wp_meta_box_nonce', false, true );
339
+ do_action( 'cmb_before_table', $meta_box, $object_id, $object_type );
340
+ echo '<table class="form-table cmb_metabox">';
341
+
342
+ foreach ( $meta_box['fields'] as $field ) {
343
+
344
+ if ( isset( $field['on_front'] ) && $field['on_front'] == false )
345
+ continue;
346
+
347
+ self::$field =& $field;
348
+
349
+ // Set up blank or default values for empty ones
350
+ if ( !isset( $field['name'] ) ) $field['name'] = '';
351
+ if ( !isset( $field['desc'] ) ) $field['desc'] = '';
352
+ if ( !isset( $field['std'] ) ) $field['std'] = '';
353
+ // filter default value
354
+ $field['std'] = apply_filters( 'cmb_std_filter', $field['std'], $field, $object_id, $object_type );
355
+ if ( 'file' == $field['type'] && !isset( $field['allow'] ) )
356
+ $field['allow'] = array( 'url', 'attachment' );
357
+ if ( 'file' == $field['type'] && !isset( $field['save_id'] ) )
358
+ $field['save_id'] = false;
359
+ if ( 'multicheck' == $field['type'] )
360
+ $field['multiple'] = true;
361
+
362
+ // Allow an override for the field's value
363
+ // (assuming no one would want to save 'cmb_override_val' as a value)
364
+ $meta = apply_filters( 'cmb_override_meta_value', 'cmb_override_val', $object_id, $field, $object_type );
365
+
366
+ // If no override, get our meta
367
+ if ( $meta === 'cmb_override_val' )
368
+ $meta = get_metadata( $object_type, $object_id, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
369
+
370
+ $repeat = isset( $field['repeatable'] ) && $field['repeatable'];
371
+ $repeatclass = $repeat ? ' cmb-repeat' : '';
372
+ $repeatmethod = $repeat ? '_repeat' : '';
373
+
374
+ echo '<tr class="cmb-type-'. sanitize_html_class( $field['type'] ) .' cmb_id_'. sanitize_html_class( $field['id'] ) . $repeatclass .'">';
375
+
376
+ if ( $field['type'] == "title" ) {
377
+ echo '<td colspan="2">';
378
+ } else {
379
+ if ( isset( $meta_box['show_names'] ) && $meta_box['show_names'] == true ) {
380
+ $style = $object_type == 'post' ? ' style="width:18%"' : '';
381
+ echo '<th'. $style .'><label for="', $field['id'], '">', $field['name'], '</label></th>';
382
+ } else {
383
+ echo '<label style="display:none;" for="', $field['id'], '">', $field['name'], '</label></th>';
384
+ }
385
+ echo '<td>';
386
+ }
387
+
388
+ echo empty( $field['before'] ) ? '' : $field['before'];
389
+
390
+ call_user_func( array( $types, $field['type'].$repeatmethod ), $field, $meta, $object_id, $object_type );
391
+
392
+ echo empty( $field['after'] ) ? '' : $field['after'];
393
+
394
+ echo '</td>','</tr>';
395
+ }
396
+ echo '</table>';
397
+ do_action( 'cmb_after_table', $meta_box, $object_id, $object_type );
398
+ echo "\n<!-- End CMB Fields -->\n";
399
+
400
+ }
401
+
402
+ /**
403
+ * Save data from metabox
404
+ */
405
+ function save_post( $post_id, $post ) {
406
+
407
+ // check permissions
408
+ if (
409
+ // check nonce
410
+ ! isset( $_POST['wp_meta_box_nonce'] )
411
+ || ! wp_verify_nonce( $_POST['wp_meta_box_nonce'], self::nonce() )
412
+ // check if autosave
413
+ || defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE
414
+ // check user editing permissions
415
+ || ( 'page' == $_POST['post_type'] && ! current_user_can( 'edit_page', $post_id ) )
416
+ || ! current_user_can( 'edit_post', $post_id )
417
+ // get the metabox post_types & compare it to this post_type
418
+ || ! in_array( $post->post_type, $this->_meta_box['pages'] )
419
+ )
420
+ return $post_id;
421
+
422
+ self::save_fields( $this->_meta_box, $post_id, 'post' );
423
+ }
424
+
425
+ /**
426
+ * Save data from metabox
427
+ */
428
+ function save_user( $user_id ) {
429
+
430
+ // check permissions
431
+ // @todo more hardening?
432
+ if (
433
+ // check nonce
434
+ ! isset( $_POST['wp_meta_box_nonce'] )
435
+ || ! wp_verify_nonce( $_POST['wp_meta_box_nonce'], self::nonce() )
436
+ )
437
+ return $user_id;
438
+
439
+ self::save_fields( $this->_meta_box, $user_id, 'user' );
440
+ }
441
+
442
+ /**
443
+ * Loops through and saves field data
444
+ * @since 1.0.0
445
+ * @param array $meta_box Metabox config array
446
+ * @param int $object_id Object ID
447
+ * @param string $object_type Type of object being saved. (e.g., post, user, or comment)
448
+ */
449
+ public static function save_fields( $meta_box, $object_id, $object_type = '' ) {
450
+
451
+ $meta_box['show_on'] = empty( $meta_box['show_on'] ) ? array( 'key' => false, 'value' => false ) : $meta_box['show_on'];
452
+
453
+ if ( ! apply_filters( 'cmb_show_on', true, $meta_box ) )
454
+ return;
455
+
456
+ self::set_object_id( $object_id );
457
+ // Set/get type
458
+ $object_type = self::set_object_type( $object_type ? $object_type : self::set_mb_type( $meta_box ) );
459
+
460
+ // save field ids of those that are updated
461
+ $updated = array();
462
+
463
+ foreach ( $meta_box['fields'] as $field ) {
464
+
465
+ self::$field =& $field;
466
+
467
+ $name = $field['id'];
468
+
469
+ if ( ! isset( $field['multiple'] ) )
470
+ $field['multiple'] = ( 'multicheck' == $field['type'] ) ? true : false;
471
+
472
+ $old = get_metadata( $object_type, $object_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
473
+ $new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : null;
474
+
475
+ if ( $object_type == 'post' ) {
476
+
477
+ if (
478
+ isset( $field['taxonomy'] )
479
+ && in_array( $field['type'], array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_multicheck' ) )
480
+ )
481
+ $new = wp_set_object_terms( $object_id, $new, $field['taxonomy'] );
482
+
483
+ }
484
+
485
+ if ( isset( $field['repeatable'] ) && $field['repeatable'] && is_array( $new ) ) {
486
+ $new = array_filter( $new );
487
+ }
488
+
489
+ switch ( $field['type'] ) {
490
+ case 'text_datetime_timestamp':
491
+ $new = strtotime( $new['date'] .' '. $new['time'] );
492
+
493
+ if ( $tz_offset = self::field_timezone_offset( $object_id ) )
494
+ $new += $tz_offset;
495
+ break;
496
+ case 'text_datetime_timestamp_timezone':
497
+ $tzstring = null;
498
+
499
+ if ( array_key_exists( 'timezone', $new ) )
500
+ $tzstring = $new['timezone'];
501
+
502
+ if ( empty( $tzstring ) )
503
+ $tzstring = self::timezone_string();
504
+
505
+ $offset = self::timezone_offset( $tzstring );
506
+
507
+ if ( substr( $tzstring, 0, 3 ) === 'UTC' )
508
+ $tzstring = timezone_name_from_abbr( "", $offset, 0 );
509
+
510
+ $new = new DateTime( $new['date'] .' '. $new['time'], new DateTimeZone( $tzstring ) );
511
+ $new = serialize( $new );
512
+
513
+ break;
514
+ case 'text_url':
515
+ if ( ! empty( $new ) ) {
516
+ $protocols = isset( $field['protocols'] ) ? (array) $field['protocols'] : null;
517
+ $new = esc_url_raw( $new, $protocols );
518
+ }
519
+ break;
520
+ case 'textarea':
521
+ case 'textarea_small':
522
+ $new = htmlspecialchars( $new );
523
+ break;
524
+ case 'textarea_code':
525
+ $new = htmlspecialchars_decode( $new );
526
+ break;
527
+ case 'text_email':
528
+ $new = trim( $new );
529
+ $new = is_email( $new ) ? $new : '';
530
+ break;
531
+ case 'text_date_timestamp':
532
+ $new = strtotime( $new );
533
+ break;
534
+ case 'file':
535
+ $_id_name = $field['id'] .'_id';
536
+ // get _id old value
537
+ $_id_old = get_metadata( $object_type, $object_id, $_id_name, !$field['multiple'] /* If multicheck this can be multiple values */ );
538
+
539
+ // If specified NOT to save the file ID
540
+ if ( isset( $field['save_id'] ) && ! $field['save_id'] ) {
541
+ $_new_id = '';
542
+ } else {
543
+ // otherwise get the file ID
544
+ $_new_id = isset( $_POST[$_id_name] ) ? $_POST[$_id_name] : null;
545
+
546
+ // If there is no ID saved yet, try to get it from the url
547
+ if ( isset( $_POST[ $field['id'] ] ) && $_POST[ $field['id'] ] && ! $_new_id ) {
548
+ $_new_id = self::image_id_from_url( esc_url_raw( $_POST[ $field['id'] ] ) );
549
+ }
550
+
551
+ }
552
+
553
+ if ( $_new_id && $_new_id != $_id_old ) {
554
+ $updated[] = $_id_name;
555
+ update_metadata( $object_type, $object_id, $_id_name, $_new_id );
556
+
557
+ } elseif ( '' == $_new_id && $_id_old ) {
558
+ $updated[] = $_id_name;
559
+ delete_metadata( $object_type, $object_id, $_id_name, $old );
560
+ }
561
+ break;
562
+ }
563
+
564
+ // Allow validation via filter
565
+ $new = apply_filters( 'cmb_validate_'. $field['type'], $new, $object_id, $field, $object_type );
566
+
567
+ // Allow validation via metabox flag
568
+ if ( isset( $field['validate_func'] ) ) {
569
+ $ok = call_user_func( array( 'timeline_express_Meta_Box_Validate', $field['validate_func'] ), $new );
570
+ // move along when meta value is invalid
571
+ if ( $ok === false )
572
+ continue;
573
+
574
+ } elseif ( $field['multiple'] ) {
575
+
576
+ $updated[] = $name;
577
+ delete_metadata( $object_type, $object_id, $name );
578
+ if ( ! empty( $new ) ) {
579
+ foreach ( $new as $add_new ) {
580
+ add_metadata( $object_type, $object_id, $name, $add_new, false );
581
+ }
582
+ }
583
+ } elseif ( '' !== $new && $new != $old ) {
584
+ $updated[] = $name;
585
+ update_metadata( $object_type, $object_id, $name, $new );
586
+ } elseif ( '' == $new ) {
587
+ $updated[] = $name;
588
+ delete_metadata( $object_type, $object_id, $name );
589
+ }
590
+
591
+ }
592
+
593
+ do_action( "cmb_save_{$object_type}_fields", $object_id, $meta_box['id'], $updated, $meta_box );
594
+
595
+ }
596
+
597
+ /**
598
+ * Returns a timezone string representing the default timezone for the site.
599
+ *
600
+ * Roughly copied from WordPress, as get_option('timezone_string') will return
601
+ * and empty string if no value has beens set on the options page.
602
+ * A timezone string is required by the wp_timezone_choice() used by the
603
+ * select_timezone field.
604
+ *
605
+ * @since 1.0.0
606
+ * @return string Timezone string
607
+ */
608
+ public static function timezone_string() {
609
+ $current_offset = get_option( 'gmt_offset' );
610
+ $tzstring = get_option( 'timezone_string' );
611
+
612
+ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
613
+ if ( 0 == $current_offset )
614
+ $tzstring = 'UTC+0';
615
+ elseif ( $current_offset < 0 )
616
+ $tzstring = 'UTC' . $current_offset;
617
+ else
618
+ $tzstring = 'UTC+' . $current_offset;
619
+ }
620
+
621
+ return $tzstring;
622
+ }
623
+
624
+ /**
625
+ * Returns time string offset by timezone
626
+ * @since 1.0.0
627
+ * @param string $tzstring Time string
628
+ * @return string Offset time string
629
+ */
630
+ public static function timezone_offset( $tzstring ) {
631
+ if ( !empty( $tzstring ) ) {
632
+
633
+ if ( substr( $tzstring, 0, 3 ) === 'UTC' ) {
634
+ $tzstring = str_replace( array( ':15',':30',':45' ), array( '.25','.5','.75' ), $tzstring );
635
+ return intval( floatval( substr( $tzstring, 3 ) ) * HOUR_IN_SECONDS );
636
+ }
637
+
638
+ $date_time_zone_selected = new DateTimeZone( $tzstring );
639
+ $tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
640
+
641
+ return $tz_offset;
642
+ }
643
+
644
+ return 0;
645
+ }
646
+
647
+ /**
648
+ * Offset a time value based on timezone
649
+ * @since 1.0.0
650
+ * @param integer $object_id Object ID
651
+ * @return string Offset time string
652
+ */
653
+ public static function field_timezone_offset( $object_id = 0 ) {
654
+
655
+ $tzstring = self::field_timezone( $object_id );
656
+
657
+ return self::timezone_offset( $tzstring );
658
+ }
659
+
660
+ /**
661
+ * Return timezone string
662
+ * @since 1.0.0
663
+ * @param integer $object_id Object ID
664
+ * @return string Timezone string
665
+ */
666
+ public static function field_timezone( $object_id = 0 ) {
667
+ $tzstring = null;
668
+ if ( ! ( $object_id = self::get_object_id( $object_id ) ) )
669
+ return $tzstring;
670
+
671
+ if ( array_key_exists( 'timezone', self::$field ) && self::$field['timezone'] ) {
672
+ $tzstring = self::$field['timezone'];
673
+ } else if ( array_key_exists( 'timezone_meta_key', self::$field ) && self::$field['timezone_meta_key'] ) {
674
+ $timezone_meta_key = self::$field['timezone_meta_key'];
675
+
676
+ $tzstring = get_metadata( self::get_mb_type(), $object_id, $timezone_meta_key, true );
677
+
678
+ return $tzstring;
679
+ }
680
+
681
+ return false;
682
+ }
683
+
684
+ /**
685
+ * Get object id from global space if no id is provided
686
+ * @since 1.0.0
687
+ * @param integer $object_id Object ID
688
+ * @return integer $object_id Object ID
689
+ */
690
+ public static function get_object_id( $object_id = 0 ) {
691
+
692
+ if ( $object_id )
693
+ return $object_id;
694
+
695
+ if ( self::$object_id )
696
+ return self::$object_id;
697
+
698
+ // Try to get our object ID from the global space
699
+ switch ( self::get_object_type() ) {
700
+ case 'user':
701
+ $object_id = isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
702
+ $object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id;
703
+ break;
704
+
705
+ default:
706
+ $has_id = @get_the_id();
707
+ $object_id = $has_id ? $has_id : $object_id;
708
+ $object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
709
+ $object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id;
710
+ break;
711
+ }
712
+
713
+ // reset to id or 0
714
+ self::set_object_id( $object_id ? $object_id : 0 );
715
+
716
+ return self::$object_id;
717
+ }
718
+
719
+ /**
720
+ * Explicitly Set object id
721
+ * @since 1.0.0
722
+ * @param integer $object_id Object ID
723
+ * @return integer $object_id Object ID
724
+ */
725
+ public static function set_object_id( $object_id ) {
726
+ return self::$object_id = $object_id;
727
+ }
728
+
729
+ /**
730
+ * Sets the $object_type based on metabox settings
731
+ * @since 1.0.0
732
+ * @param array|string $meta_box Metabox config array or explicit setting
733
+ * @return string Object type
734
+ */
735
+ public static function set_mb_type( $meta_box ) {
736
+
737
+ if ( is_string( $meta_box ) ) {
738
+ self::$mb_object_type = $meta_box;
739
+ return self::get_mb_type();
740
+ }
741
+
742
+ if ( ! isset( $meta_box['pages'] ) )
743
+ return self::get_mb_type();
744
+
745
+ $type = false;
746
+ // check if 'pages' is a string
747
+ if ( is_string( $meta_box['pages'] ) )
748
+ $type = $meta_box['pages'];
749
+ // if it's an array of one, extract it
750
+ elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] === 1 ) )
751
+ $type = is_string( end( $meta_box['pages'] ) ) ? end( $meta_box['pages'] ) : false;
752
+
753
+ if ( !$type )
754
+ return self::get_mb_type();
755
+
756
+ // Get our object type
757
+ if ( 'user' == $type )
758
+ self::$mb_object_type = 'user';
759
+ elseif ( 'comment' == $type )
760
+ self::$mb_object_type = 'comment';
761
+ else
762
+ self::$mb_object_type = 'post';
763
+
764
+ return self::get_mb_type();
765
+ }
766
+
767
+ /**
768
+ * Returns the object type
769
+ * @since 1.0.0
770
+ * @return string Object type
771
+ */
772
+ public static function get_object_type() {
773
+ if ( self::$object_type )
774
+ return self::$object_type;
775
+
776
+ global $pagenow;
777
+
778
+ if (
779
+ $pagenow == 'user-edit.php'
780
+ || $pagenow == 'profile.php'
781
+ )
782
+ self::set_object_type( 'user' );
783
+
784
+ elseif (
785
+ $pagenow == 'edit-comments.php'
786
+ || $pagenow == 'comment.php'
787
+ )
788
+ self::set_object_type( 'comment' );
789
+ else
790
+ self::set_object_type( 'post' );
791
+
792
+ return self::$object_type;
793
+ }
794
+
795
+ /**
796
+ * Sets the object type
797
+ * @since 1.0.0
798
+ * @return string Object type
799
+ */
800
+ public static function set_object_type( $object_type ) {
801
+ return self::$object_type = $object_type;
802
+ }
803
+
804
+ /**
805
+ * Returns the object type
806
+ * @since 1.0.0
807
+ * @return string Object type
808
+ */
809
+ public static function get_mb_type() {
810
+ return self::$mb_object_type;
811
+ }
812
+
813
+ /**
814
+ * Returns the nonce value for wp_meta_box_nonce
815
+ * @since 1.0.0
816
+ * @return string Nonce value
817
+ */
818
+ public static function nonce() {
819
+ return basename( __FILE__ );
820
+ }
821
+
822
+ /**
823
+ * Utility method that attempts to get an attachment's ID by it's url
824
+ * @since 1.0.0
825
+ * @param string $img_url Attachment url
826
+ * @return mixed Attachment ID or false
827
+ */
828
+ public static function image_id_from_url( $img_url ) {
829
+ global $wpdb;
830
+
831
+ // Get just the file name
832
+ if ( false !== strpos( $img_url, '/' ) ) {
833
+ $explode = explode( '/', $img_url );
834
+ $img_url = end( $explode );
835
+ }
836
+
837
+ // And search for a fuzzy match of the file name
838
+ $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid LIKE '%%%s%%' LIMIT 1;", $img_url ) );
839
+
840
+ // If we found an attachement ID, return it
841
+ if ( !empty( $attachment ) && is_array( $attachment ) )
842
+ return $attachment[0];
843
+
844
+ // No luck
845
+ return false;
846
+ }
847
+
848
+ }
849
+
850
+ // Handle oembed Ajax
851
+ add_action( 'wp_ajax_cmb_oembed_handler', array( 'timeline_express_MetaBox_ajax', 'oembed_handler' ) );
852
+ add_action( 'wp_ajax_nopriv_cmb_oembed_handler', array( 'timeline_express_MetaBox_ajax', 'oembed_handler' ) );
853
+
854
+ /**
855
+ * Loop and output multiple metaboxes
856
+ * @since 1.0.0
857
+ * @param array $meta_boxes Metaboxes config array
858
+ * @param int $object_id Object ID
859
+ */
860
+ function timeline_express_print_metaboxes( $meta_boxes, $object_id ) {
861
+ foreach ( (array) $meta_boxes as $meta_box ) {
862
+ timeline_express_print_metaboxe( $meta_box, $object_id );
863
+ }
864
+ }
865
+
866
+ /**
867
+ * Output a metabox
868
+ * @since 1.0.0
869
+ * @param array $meta_box Metabox config array
870
+ * @param int $object_id Object ID
871
+ */
872
+ function timeline_express_print_metaboxe( $meta_box, $object_id ) {
873
+ $cmb = new timeline_express_MetaBoxes( $meta_box );
874
+ if ( $cmb ) {
875
+
876
+ timeline_express_MetaBoxes::set_object_id( $object_id );
877
+
878
+ if ( ! wp_script_is( 'cmb-scripts', 'registered' ) )
879
+ $cmb->register_scripts();
880
+
881
+ wp_enqueue_script( 'cmb-scripts' );
882
+
883
+ // default is to show cmb styles
884
+ if ( ! isset( $meta_box['cmb_styles'] ) || $meta_box['cmb_styles'] != false )
885
+ wp_enqueue_style( 'cmb-styles' );
886
+
887
+ timeline_express_MetaBoxes::show_form( $meta_box );
888
+ }
889
+
890
+ }
891
+
892
+ /**
893
+ * Saves a particular metabox's fields
894
+ * @since 1.0.0
895
+ * @param array $meta_box Metabox config array
896
+ * @param int $object_id Object ID
897
+ */
898
+ function timeline_express_save_metabox_fields( $meta_box, $object_id ) {
899
+ timeline_express_MetaBoxes::save_fields( $meta_box, $object_id );
900
+ }
901
+
902
+ /**
903
+ * Display a metabox form & save it on submission
904
+ * @since 1.0.0
905
+ * @param array $meta_box Metabox config array
906
+ * @param int $object_id Object ID
907
+ * @param boolean $return Whether to return or echo form
908
+ * @return string CMB html form markup
909
+ */
910
+ function timeline_express_metabox_form( $meta_box, $object_id, $echo = true ) {
911
+
912
+ // Make sure that our object type is explicitly set by the metabox config
913
+ timeline_express_MetaBoxes::set_object_type( timeline_express_MetaBoxes::set_mb_type( $meta_box ) );
914
+
915
+ // Save the metabox if it's been submitted
916
+ // check permissions
917
+ // @todo more hardening?
918
+ if (
919
+ // check nonce
920
+ isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST['wp_meta_box_nonce'] )
921
+ && wp_verify_nonce( $_POST['wp_meta_box_nonce'], timeline_express_MetaBoxes::nonce() )
922
+ && $_POST['object_id'] == $object_id
923
+ )
924
+ timeline_express_save_metabox_fields( $meta_box, $object_id );
925
+
926
+ // Show specific metabox form
927
+
928
+ // Get cmb form
929
+ ob_start();
930
+ timeline_express_print_metaboxe( $meta_box, $object_id );
931
+ $form = ob_get_contents();
932
+ ob_end_clean();
933
+
934
+ $form_format = apply_filters( 'cmb_frontend_form_format', '<form class="cmb-form" method="post" id="%s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%s">%s<input type="submit" name="submit-cmb" value="%s"></form>', $object_id, $meta_box, $form );
935
+
936
+ $form = sprintf( $form_format, $meta_box['id'], $object_id, $form, __( 'Save', 'cmb' ) );
937
+
938
+ if ( $echo )
939
+ echo $form;
940
+
941
+ return $form;
942
+ }
943
+
944
+ // End. That's it, folks! //
lib/metabox/js/cmb.js ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Controls the behaviours of custom metabox fields.
3
+ *
4
+ * @author Andrew Norcross
5
+ * @author Jared Atchison
6
+ * @author Bill Erickson
7
+ * @author Justin Sternberg
8
+ * @see https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
9
+ */
10
+
11
+ /*jslint browser: true, devel: true, indent: 4, maxerr: 50, sub: true */
12
+ /*global jQuery, tb_show, tb_remove */
13
+
14
+ /**
15
+ * Custom jQuery for Custom Metaboxes and Fields
16
+ */
17
+ jQuery(document).ready( function($) {
18
+ 'use strict';
19
+
20
+ var formfield;
21
+ // Uploading files
22
+ var file_frames = {};
23
+ var iterator = 0;
24
+
25
+ /**
26
+ * Initialize timepicker (this will be moved inline in a future release)
27
+ */
28
+ $('.cmb_timepicker').each( function() {
29
+ $('#' + jQuery(this).attr('id')).timePicker({
30
+ startTime: "00:00",
31
+ endTime: "23:59",
32
+ show24Hours: false,
33
+ separator: ':',
34
+ step: 30
35
+ });
36
+ });
37
+
38
+ /**
39
+ * Initialize jQuery UI datepicker (this will be moved inline in a future release)
40
+ */
41
+ $('.cmb_datepicker').each( function() {
42
+ $('#' + jQuery(this).attr('id')).datepicker();
43
+ // $('#' + jQuery(this).attr('id')).datepicker({ dateFormat: 'yy-mm-dd' });
44
+ // For more options see http://jqueryui.com/demos/datepicker/#option-dateFormat
45
+ });
46
+ // Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts
47
+ $("#ui-datepicker-div").wrap('<div class="cmb_element" />');
48
+
49
+ /**
50
+ * Initialize color picker
51
+ */
52
+ if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
53
+ $('input:text.cmb_colorpicker').wpColorPicker();
54
+ } else {
55
+ $('input:text.cmb_colorpicker').each( function(i) {
56
+ $(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
57
+ $('#picker-' + i).hide().farbtastic($(this));
58
+ })
59
+ .focus( function() {
60
+ $(this).next().show();
61
+ })
62
+ .blur( function() {
63
+ $(this).next().hide();
64
+ });
65
+ }
66
+
67
+ /**
68
+ * File and image upload handling
69
+ */
70
+
71
+
72
+ $('.cmb_metabox')
73
+ .on( 'change', '.cmb_upload_file', function() {
74
+ formfield = $(this).attr('name');
75
+ $('#' + formfield + '_id').val("");
76
+ })
77
+ .on( 'click', '.cmb_upload_button', function(event) {
78
+
79
+ event.preventDefault();
80
+
81
+ var $self = $(this);
82
+ formfield = $self.prev('input').attr('name');
83
+ var $formfield = $('#'+formfield);
84
+ var uploadStatus = true;
85
+ var attachment = true;
86
+ var isList = $self.hasClass( 'cmb_upload_list' );
87
+
88
+
89
+ // If this field's media frame already exists, reopen it.
90
+ if ( formfield in file_frames ) {
91
+ file_frames[formfield].open();
92
+ return;
93
+ }
94
+
95
+ // Create the media frame.
96
+ file_frames[formfield] = wp.media.frames.file_frame = wp.media({
97
+ title: $('label[for=' + formfield + ']').text(),
98
+ button: {
99
+ text: window.cmb_l10.upload_file
100
+ },
101
+ multiple: isList ? true : false
102
+ });
103
+
104
+ // When an file is selected, run a callback.
105
+ file_frames[formfield].on( 'select', function() {
106
+
107
+
108
+ if ( isList ) {
109
+
110
+ // Get all of our selected files
111
+ attachment = file_frames[formfield].state().get('selection').toJSON();
112
+
113
+ $formfield.val(attachment.url);
114
+ $('#'+ formfield +'_id').val(attachment.id);
115
+
116
+ // Setup our fileGroup array
117
+ var fileGroup = [];
118
+
119
+ // Loop through each attachment
120
+ $( attachment ).each( function() {
121
+ if ( this.type && this.type === 'image' ) {
122
+ // image preview
123
+ uploadStatus = '<li class="img_status">'+
124
+ '<img width="50" height="50" src="' + this.url + '" class="attachment-50x50" alt="'+ this.filename +'">'+
125
+ '<p><a href="#" class="cmb_remove_file_button" rel="'+ formfield +'['+ this.id +']">'+ cmb_l10.remove_image +'</a></p>'+
126
+ '<input type="hidden" id="filelist-'+ this.id +'" name="'+ formfield +'['+ this.id +']" value="' + this.url + '">'+
127
+ '</li>';
128
+
129
+ } else {
130
+ // Standard generic output if it's not an image.
131
+ uploadStatus = '<li>'+ cmb_l10.file +' <strong>'+ this.filename +'</strong>&nbsp;&nbsp;&nbsp; (<a href="' + this.url + '" target="_blank" rel="external">'+ cmb_l10.download +'</a> / <a href="#" class="cmb_remove_file_button" rel="'+ formfield +'['+ this.id +']">'+ cmb_l10.remove_file +'</a>)'+
132
+ '<input type="hidden" id="filelist-'+ this.id +'" name="'+ formfield +'['+ this.id +']" value="' + this.url + '">'+
133
+ '</li>';
134
+
135
+ }
136
+
137
+ // Add our file to our fileGroup array
138
+ fileGroup.push( uploadStatus );
139
+ });
140
+
141
+ // Append each item from our fileGroup array to .cmb_media_status
142
+ $( fileGroup ).each( function() {
143
+ $formfield.siblings('.cmb_media_status').slideDown().append(this);
144
+ });
145
+
146
+ } else {
147
+
148
+ // Only get one file from the uploader
149
+ attachment = file_frames[formfield].state().get('selection').first().toJSON();
150
+
151
+ $formfield.val(attachment.url);
152
+ $('#'+ formfield +'_id').val(attachment.id);
153
+
154
+ if ( attachment.type && attachment.type === 'image' ) {
155
+ // image preview
156
+ uploadStatus = '<div class="img_status"><img style="max-width: 350px; width: 100%; height: auto;" src="' + attachment.url + '" alt="'+ attachment.filename +'" title="'+ attachment.filename +'" /><p><a href="#" class="cmb_remove_file_button" rel="' + formfield + '">'+ cmb_l10.remove_image +'</a></p></div>';
157
+ } else {
158
+ // Standard generic output if it's not an image.
159
+ uploadStatus = cmb_l10.file +' <strong>'+ attachment.filename +'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+ attachment.url +'" target="_blank" rel="external">'+ cmb_l10.download +'</a> / <a href="#" class="cmb_remove_file_button" rel="'+ formfield +'">'+ cmb_l10.remove_file +'</a>)';
160
+ }
161
+
162
+ // add/display our output
163
+ $formfield.siblings('.cmb_media_status').slideDown().html(uploadStatus);
164
+ }
165
+ });
166
+
167
+ // Finally, open the modal
168
+ file_frames[formfield].open();
169
+ })
170
+ .on( 'click', '.cmb_remove_file_button', function(event) {
171
+ var $self = $(this);
172
+ if ( $self.is( '.attach_list .cmb_remove_file_button' ) ){
173
+ $self.parents('li').remove();
174
+ return false;
175
+ }
176
+ formfield = $self.attr('rel');
177
+ var $container = $self.parents('.img_status');
178
+
179
+ $('input#' + formfield).val('');
180
+ $('input#' + formfield + '_id').val('');
181
+ if ( ! $container.length ) {
182
+ $self.parents('.cmb_media_status').html('');
183
+ } else {
184
+ $container.html('');
185
+ }
186
+ return false;
187
+ })
188
+ .on( 'click', '.add-row-button', function(e) {
189
+
190
+ e.preventDefault();
191
+ self = $(this);
192
+
193
+ var tableselector = '#'+ self.data('selector');
194
+ var $table = $(tableselector);
195
+ var row = $('.empty-row', $table).clone(true);
196
+ row.removeClass('empty-row').addClass('repeat-row');
197
+ row.insertBefore( tableselector +' tbody>tr:last' );
198
+ var input = $('input.cmb_datepicker',row);
199
+ var id = input.attr('id');
200
+ input.attr('id', id + iterator );
201
+ iterator++;
202
+
203
+ // @todo Make a colorpicker field repeatable
204
+ // row.find('.wp-color-result').remove();
205
+ // row.find('input:text.cmb_colorpicker').wpColorPicker();
206
+
207
+ })
208
+ .on( 'click', '.remove-row-button', function(e) {
209
+ e.preventDefault();
210
+ var $self = $(this);
211
+ var $parent = $self.parents('.cmb-repeat-table');
212
+ console.log( 'number of tbodys', $parent.length );
213
+ console.log( 'number of trs', $('tr', $parent).length );
214
+ if ( $('tr', $parent).length > 2 )
215
+ $self.parents('.cmb-repeat-table tr').remove();
216
+ })
217
+
218
+ /**
219
+ * Ajax oEmbed display
220
+ */
221
+
222
+ // ajax when typing
223
+ .on( 'keyup', '.cmb_oembed', function(event) {
224
+ // fire our ajax function
225
+ doCMBajax($(this), event);
226
+ });
227
+
228
+ // ajax on paste
229
+ $('.cmb_oembed').bind( 'paste', function(e) {
230
+ var pasteitem = $(this);
231
+ // paste event is fired before the value is filled, so wait a bit
232
+ setTimeout( function() {
233
+ // fire our ajax function
234
+ doCMBajax(pasteitem, 'paste');
235
+ }, 100);
236
+ }).blur( function() {
237
+ // when leaving the input
238
+ setTimeout( function() {
239
+ // if it's been 2 seconds, hide our spinner
240
+ $('.postbox table.cmb_metabox .cmb-spinner').hide();
241
+ }, 2000);
242
+ });
243
+
244
+ // function for running our ajax
245
+ function doCMBajax(obj, e) {
246
+ // get typed value
247
+ var oembed_url = obj.val();
248
+ // only proceed if the field contains more than 6 characters
249
+ if (oembed_url.length < 6)
250
+ return;
251
+
252
+ // only proceed if the user has pasted, pressed a number, letter, or whitelisted characters
253
+ if (e === 'paste' || e.which <= 90 && e.which >= 48 || e.which >= 96 && e.which <= 111 || e.which == 8 || e.which == 9 || e.which == 187 || e.which == 190) {
254
+
255
+ // get field id
256
+ var field_id = obj.attr('id');
257
+ // get our inputs context for pinpointing
258
+ var context = obj.parents('.cmb_metabox tr td');
259
+
260
+ var embed_container = $('.embed_status', context);
261
+ var oembed_width = obj.width();
262
+ var child_el = $(':first-child', embed_container);
263
+
264
+ oembed_width = ( embed_container.length && child_el.length )
265
+ ? child_el.width()
266
+ : obj.width();
267
+
268
+ // show our spinner
269
+ $('.cmb-spinner', context).show();
270
+ // clear out previous results
271
+ $('.embed_wrap', context).html('');
272
+ // and run our ajax function
273
+ setTimeout( function() {
274
+ // if they haven't typed in 500 ms
275
+ if ($('.cmb_oembed:focus').val() != oembed_url)
276
+ return;
277
+ $.ajax({
278
+ type : 'post',
279
+ dataType : 'json',
280
+ url : window.cmb_l10.ajaxurl,
281
+ data : {
282
+ 'action': 'cmb_oembed_handler',
283
+ 'oembed_url': oembed_url,
284
+ 'oembed_width': oembed_width > 300 ? oembed_width : 300,
285
+ 'field_id': field_id,
286
+ 'object_id': window.cmb_l10.object_id,
287
+ 'object_type': window.cmb_l10.object_type,
288
+ 'cmb_ajax_nonce': window.cmb_l10.ajax_nonce
289
+ },
290
+ success: function(response) {
291
+ // Make sure we have a response id
292
+ if (typeof response.id === 'undefined')
293
+ return;
294
+
295
+ // hide our spinner
296
+ $('.cmb-spinner', context).hide();
297
+ // and populate our results from ajax response
298
+ $('.embed_wrap', context).html(response.result);
299
+ }
300
+ });
301
+
302
+ }, 500);
303
+ }
304
+ }
305
+
306
+ /**
307
+ * Resize oEmbed videos to fit in their respective metaboxes
308
+ */
309
+ function resizeoEmbeds() {
310
+ $('table.cmb_metabox').each( function( index ) {
311
+ var self = $(this);
312
+ var parents = self.parents('.inside');
313
+ if ( ! parents.length )
314
+ return true; // continue
315
+
316
+ var tWidth = parents.width();
317
+ var newWidth = Math.round((tWidth * 0.82)*0.97) - 30;
318
+ if ( newWidth > 639 )
319
+ return true; // continue
320
+
321
+ var child_el = $('.cmb-type-oembed .embed_status', self).children().first();
322
+ var iwidth = child_el.width();
323
+ var iheight = child_el.height();
324
+ var newHeight = Math.round((newWidth * iheight)/iwidth);
325
+ child_el.width(newWidth).height(newHeight);
326
+
327
+ });
328
+ }
329
+
330
+ // on pageload
331
+ setTimeout( resizeoEmbeds, 500);
332
+ // and on window resize
333
+ $(window).on( 'resize', resizeoEmbeds );
334
+
335
+ });
lib/metabox/js/cmb.min.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(e){var b;var d={};var c=0;e(".cmb_timepicker").each(function(){e("#"+jQuery(this).attr("id")).timePicker({startTime:"00:00",endTime:"23:59",show24Hours:false,separator:":",step:30});
2
+ });e(".cmb_datepicker").each(function(){e("#"+jQuery(this).attr("id")).datepicker();});e("#ui-datepicker-div").wrap('<div class="cmb_element" />');if(typeof jQuery.wp==="object"&&typeof jQuery.wp.wpColorPicker==="function"){e("input:text.cmb_colorpicker").wpColorPicker();
3
+ }else{e("input:text.cmb_colorpicker").each(function(g){e(this).after('<div id="picker-'+g+'" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
4
+ e("#picker-"+g).hide().farbtastic(e(this));}).focus(function(){e(this).next().show();}).blur(function(){e(this).next().hide();});}e(".cmb_metabox").on("change",".cmb_upload_file",function(){b=e(this).attr("name");
5
+ e("#"+b+"_id").val("");}).on("click",".cmb_upload_button",function(h){h.preventDefault();var l=e(this);b=l.prev("input").attr("name");var k=e("#"+b);var g=true;
6
+ var j=true;var i=l.hasClass("cmb_upload_list");if(b in d){d[b].open();return;}d[b]=wp.media.frames.file_frame=wp.media({title:e("label[for="+b+"]").text(),button:{text:window.cmb_l10.upload_file},multiple:i?true:false});
7
+ d[b].on("select",function(){if(i){j=d[b].state().get("selection").toJSON();k.val(j.url);e("#"+b+"_id").val(j.id);var m=[];e(j).each(function(){if(this.type&&this.type==="image"){g='<li class="img_status"><img width="50" height="50" src="'+this.url+'" class="attachment-50x50" alt="'+this.filename+'"><p><a href="#" class="cmb_remove_file_button" rel="'+b+"["+this.id+']">'+cmb_l10.remove_image+'</a></p><input type="hidden" id="filelist-'+this.id+'" name="'+b+"["+this.id+']" value="'+this.url+'"></li>';
8
+ }else{g="<li>"+cmb_l10.file+" <strong>"+this.filename+'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+this.url+'" target="_blank" rel="external">'+cmb_l10.download+'</a> / <a href="#" class="cmb_remove_file_button" rel="'+b+"["+this.id+']">'+cmb_l10.remove_file+'</a>)<input type="hidden" id="filelist-'+this.id+'" name="'+b+"["+this.id+']" value="'+this.url+'"></li>';
9
+ }m.push(g);});e(m).each(function(){k.siblings(".cmb_media_status").slideDown().append(this);});}else{j=d[b].state().get("selection").first().toJSON();k.val(j.url);
10
+ e("#"+b+"_id").val(j.id);if(j.type&&j.type==="image"){g='<div class="img_status"><img style="max-width: 350px; width: 100%; height: auto;" src="'+j.url+'" alt="'+j.filename+'" title="'+j.filename+'" /><p><a href="#" class="cmb_remove_file_button" rel="'+b+'">'+cmb_l10.remove_image+"</a></p></div>";
11
+ }else{g=cmb_l10.file+" <strong>"+j.filename+'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+j.url+'" target="_blank" rel="external">'+cmb_l10.download+'</a> / <a href="#" class="cmb_remove_file_button" rel="'+b+'">'+cmb_l10.remove_file+"</a>)";
12
+ }k.siblings(".cmb_media_status").slideDown().html(g);}});d[b].open();}).on("click",".cmb_remove_file_button",function(g){var i=e(this);if(i.is(".attach_list .cmb_remove_file_button")){i.parents("li").remove();
13
+ return false;}b=i.attr("rel");var h=i.parents(".img_status");e("input#"+b).val("");e("input#"+b+"_id").val("");if(!h.length){i.parents(".cmb_media_status").html("");
14
+ }else{h.html("");}return false;}).on("click",".add-row-button",function(j){j.preventDefault();self=e(this);var i="#"+self.data("selector");var h=e(i);var k=e(".empty-row",h).clone(true);
15
+ k.removeClass("empty-row").addClass("repeat-row");k.insertBefore(i+" tbody>tr:last");var g=e("input.cmb_datepicker",k);var l=g.attr("id");g.attr("id",l+c);
16
+ c++;}).on("click",".remove-row-button",function(h){h.preventDefault();var i=e(this);var g=i.parents(".cmb-repeat-table");console.log("number of tbodys",g.length);
17
+ console.log("number of trs",e("tr",g).length);if(e("tr",g).length>2){i.parents(".cmb-repeat-table tr").remove();}}).on("keyup",".cmb_oembed",function(g){f(e(this),g);
18
+ });e(".cmb_oembed").bind("paste",function(h){var g=e(this);setTimeout(function(){f(g,"paste");},100);}).blur(function(){setTimeout(function(){e(".postbox table.cmb_metabox .cmb-spinner").hide();
19
+ },2000);});function f(n,m){var i=n.val();if(i.length<6){return;}if(m==="paste"||m.which<=90&&m.which>=48||m.which>=96&&m.which<=111||m.which==8||m.which==9||m.which==187||m.which==190){var k=n.attr("id");
20
+ var h=n.parents(".cmb_metabox tr td");var l=e(".embed_status",h);var g=n.width();var j=e(":first-child",l);g=(l.length&&j.length)?j.width():n.width();e(".cmb-spinner",h).show();
21
+ e(".embed_wrap",h).html("");setTimeout(function(){if(e(".cmb_oembed:focus").val()!=i){return;}e.ajax({type:"post",dataType:"json",url:window.cmb_l10.ajaxurl,data:{action:"cmb_oembed_handler",oembed_url:i,oembed_width:g>300?g:300,field_id:k,object_id:window.cmb_l10.object_id,object_type:window.cmb_l10.object_type,cmb_ajax_nonce:window.cmb_l10.ajax_nonce},success:function(o){if(typeof o.id==="undefined"){return;
22
+ }e(".cmb-spinner",h).hide();e(".embed_wrap",h).html(o.result);}});},500);}}function a(){e("table.cmb_metabox").each(function(l){var o=e(this);var n=o.parents(".inside");
23
+ if(!n.length){return true;}var k=n.width();var j=Math.round((k*0.82)*0.97)-30;if(j>639){return true;}var h=e(".cmb-type-oembed .embed_status",o).children().first();
24
+ var i=h.width();var m=h.height();var g=Math.round((j*m)/i);h.width(j).height(g);});}setTimeout(a,500);e(window).on("resize",a);});
lib/metabox/js/jquery.timePicker.min.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * A time picker for jQuery.
3
+ *
4
+ * Dual licensed under the MIT and GPL licenses.
5
+ * Copyright (c) 2009 Anders Fajerson
6
+ *
7
+ * @name timePicker
8
+ * @author Anders Fajerson (http://perifer.se)
9
+ * @see http://github.com/perifer/timePicker
10
+ * @example $("#mytime").timePicker();
11
+ * @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
12
+ */
13
+ (function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('<div class="time-picker'+(h.show24Hours?"":" time-picker-12hours")+'"></div>'),r=a("<ul></ul>");for(var s=0;s<o.length;s++)r.append("<li>"+o[s]+"</li>");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=k<o&&o<=l?o:k;var p=a("li:contains("+c(o,h)+")",q);p.length&&(p.addClass(m),q[0].scrollTop=p[0].offsetTop);return!0};a(d).focus(t).click(t),a(d).blur(function(){i||q.hide()});var u=a.browser.opera||a.browser.mozilla?"keypress":"keydown";a(d)[u](function(c){var e;j=!0;var f=q[0].scrollTop;switch(c.keyCode){case 38:if(t())return!1;e=a(n,r);var g=e.prev().addClass(m)[0];g?(e.removeClass(m),g.offsetTop<f&&(q[0].scrollTop=f-g.offsetHeight)):(e.removeClass(m),g=a("li:last",r).addClass(m)[0],q[0].scrollTop=g.offsetTop-g.offsetHeight);return!1;case 40:if(t())return!1;e=a(n,r);var i=e.next().addClass(m)[0];i?(e.removeClass(m),i.offsetTop+i.offsetHeight>f+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery)
lib/metabox/readme.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Custom Metaboxes and Fields for WordPress
2
+
3
+ **Contributors**:
4
+
5
+ * Andrew Norcross ( [@norcross](http://twitter.com/norcross ) / [andrewnorcross.com](http://andrewnorcross.com/) )
6
+ * Jared Atchison ( [@jaredatch](http://twitter.com/jaredatch ) / [jaredatchison.com](http://jaredatchison.com/) )
7
+ * Bill Erickson ( [@billerickson](http://twitter.com/billerickson ) / [billerickson.net](http://billerickson.net/) )
8
+ * Justin Sternberg ( [@jtsternberg](http://twitter.com/jtsternberg ) / [dsgnwrks.pro](http://dsgnwrks.pro) )
9
+
10
+ **Version**: 1.0.0
11
+ **Requires at least**: 3.5
12
+ **Tested up to**: 3.8
13
+ **License**: GPLv2
14
+
15
+ ## Description
16
+
17
+ Custom Metaboxes and Fields (CMB for short) will create metaboxes with custom fields that will blow your mind.
18
+
19
+ Now in version 1.0.0:
20
+ * Bring your metaboxes to the frontend!
21
+ * Create metaboxes to handle user meta and display them on user profile add/edit pages! Or even on the front-end!
22
+
23
+ ##### Links
24
+ * [Github project page](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress)
25
+ * [Documentation (GitHub wiki)](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki)
26
+
27
+ ##### Field Types:
28
+ * text (optionally repeatable)
29
+ * text small (optionally repeatable)
30
+ * text medium (optionally repeatable)
31
+ * text url (optionally repeatable)
32
+ * text email (optionally repeatable)
33
+ * text money (optionally repeatable)
34
+ * date picker
35
+ * date picker (unix timestamp)
36
+ * date time picker combo (unix timestamp)
37
+ * date time picker with time zone combo (serialized DateTime object)
38
+ * time zone dropdown
39
+ * time picker
40
+ * color picker
41
+ * textarea
42
+ * textarea small
43
+ * textarea code
44
+ * select
45
+ * radio
46
+ * radio inline
47
+ * taxonomy radio
48
+ * taxonomy select
49
+ * checkbox
50
+ * multicheck
51
+ * WYSIWYG/TinyMCE
52
+ * Image/file upload
53
+ * oEmbed
54
+
55
+ [More on field types (GitHub wiki)](https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress/wiki/Field-Types)
56
+
57
+ ## Installation
58
+
59
+ This script is easy to install. If you can't figure it out you probably shouldn't be using it.
60
+
61
+ 1. Place `metabox` directory inside of your (activated) theme. E.g. inside `/themes/twentyten/lib/metabox/`.
62
+ 2. Include `init.php` (preferably on the 'init' WordPress hook).
63
+ 3. See `example-functions.php` for further guidance.
64
+ 4. Profit.
65
+
66
+ ## Known Issues
67
+
68
+ * Problem inserting file url inside field for image with caption (issue #50) May be fixed, needs testing.
69
+ * `CMB_META_BOX_URL` does not define properly in WAMP/XAMP (Windows) (issue #31) May be fixed, needs testing.
70
+ * Metabox containing WYSIWYG editor cannot be moved (this is a TinyMCE issue)
71
+
72
+ ## To-do
73
+ * Fix known issues (above)
74
+ * clean up code
75
+ * improve inline documentation
76
+ * move timepicker and datepicker jQuery inline
77
+ * support for multiple configurable timepickers/datepickers
78
+ * add ability to save fields in a single custom field
79
+ * add ability to mark fields as required
80
+ * add ability to define `placeholder` text
81
+ * repeatable fields (halfway there)
82
+ * look at possiblity of tabs
83
+ * look at preserving taxonomy hierarchies
84
+
85
+ ## Changelog
86
+
87
+ ### 1.0.0
88
+ * Added `text_datetime_timestamp_timezone` type, a datetime combo field with an additional timezone drop down, props [@dessibelle](https://github.com/dessibelle)
89
+ * Added `select_timezone` type, a standalone time zone select dropdown. The time zone select can be used with standalone `text_datetime_timestamp` if desired. Props [@dessibelle](https://github.com/dessibelle)
90
+ * Added `text_url` type, a basic url field. Props [@dessibelle](https://github.com/dessibelle)
91
+ * Added `text_email` type, a basic email field. Props [@dessibelle](https://github.com/dessibelle)
92
+ * Added ability to display metabox fields in frontend. Default is true, but can be overriden using the `cmb_allow_frontend filter`. If set to true, an entire metabox form can be output with the `cmb_metabox_form( $meta_box, $object_id, $echo )` function. Props [@dessibelle](https://github.com/dessibelle), [@messenlehner](https://github.com/messenlehner) & [@jtsternberg](https://github.com/jtsternberg).
93
+ * Added hook `cmb_after_table` after all metabox output. Props [@wpsmith](https://github.com/wpsmith)
94
+ * `file_list` now works like a repeatable field. Add as many files as you want. Props [@coreymcollins](https://github.com/coreymcollins)
95
+ * `text`, `text_small`, `text_medium`, `text_url`, `text_email`, & `text_money` fields now all have the option to be repeatable. Props [@jtsternberg](https://github.com/jtsternberg)
96
+ * Custom metaboxes can now be added for user meta. Add them on the user add/edit screen, or in a custom user profile edit page on the front-end. Props [@tw2113](https://github.com/tw2113), [@jtsternberg](https://github.com/jtsternberg)
97
+
98
+ ### 0.9.4
99
+ * Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props [@GaryJones](https://github.com/GaryJones)
100
+ * Added filter for 'std' default fallback value, props [@messenlehner](https://github.com/messenlehner)
101
+ * Ensure oEmbed videos fit in their respective metaboxes, props [@jtsternberg](https://github.com/jtsternberg)
102
+ * Fixed issue where an upload field with 'show_names' disabled wouldn't have the correct button label, props [@jtsternberg](https://github.com/jtsternberg)
103
+ * Better file-extension check for images, props [@GhostToast](https://github.com/GhostToast)
104
+ * New filter, `cmb_valid_img_types`, for whitelisted image file-extensions, props [@jtsternberg](https://github.com/jtsternberg)
105
+
106
+ ### 0.9.3
107
+ * Added field type and field id classes to each cmb table row, props [@jtsternberg](https://github.com/jtsternberg)
108
+
109
+ ### 0.9.2
110
+ * Added post type comparison to prevent storing null values for taxonomy selectors, props [@norcross](https://github.com/norcross)
111
+
112
+ ### 0.9.1
113
+ * Added `oEmbed` field type with ajax display, props [@jtsternberg](https://github.com/jtsternberg)
114
+
115
+ ### 0.9
116
+ * __Note: This release requires WordPress 3.3+__
117
+ * Cleaned up scripts being queued, props [@jaredatch](https://github.com/jaredatch)
118
+ * Cleaned up and reorganized jQuery, props [@GaryJones](https://github.com/GaryJones)
119
+ * Use $pagenow instead of custom $current_page, props [@jaredatch](https://github.com/jaredatch)
120
+ * Fixed CSS, removed inline styles, now all in style.css, props [@jaredatch](https://github.com/jaredatch)
121
+ * Fixed multicheck issues (issue #48), props [@jaredatch](https://github.com/jaredatch)
122
+ * Fixed jQuery UI datepicker CSS conflicting with WordPress UI elements, props [@jaredatch](https://github.com/jaredatch)
123
+ * Fixed zeros not saving in fields, props [@GaryJones](https://github.com/GaryJones)
124
+ * Fixed improper labels on radio and multicheck fields, props [@jaredatch](https://github.com/jaredatch)
125
+ * Fixed fields not rendering properly when in sidebar, props [@jaredatch](https://github.com/jaredatch)
126
+ * Fixed bug where datepicker triggers extra space after footer in Firefox (issue #14), props [@jaredatch](https://github.com/jaredatch)
127
+ * Added jQuery UI datepicker packaged with 3.3 core, props [@jaredatch](https://github.com/jaredatch)
128
+ * Added date time combo picker, props [@jaredatch](https://github.com/jaredatch)
129
+ * Added color picker, props [@jaredatch](https://github.com/jaredatch)
130
+ * Added readme.md markdown file, props [@jaredatch](https://github.com/jaredatch)
131
+
132
+ ### 0.8
133
+ * Added jQuery timepicker, props [@norcross](https://github.com/norcross)
134
+ * Added 'raw' textarea to convert special HTML entities back to characters, props [@norcross](https://github.com/norcross)
135
+ * Added missing examples on example-functions.php, props [@norcross](https://github.com/norcross)
136
+
137
+ ### 0.7
138
+ * Added the new wp_editor() function for the WYSIWYG dialog box, props [@jcpry](https://github.com/jcpry)
139
+ * Created 'cmb_show_on' filter to define your own Show On Filters, props [@billerickson](https://github.com/billerickson)
140
+ * Added page template show_on filter, props [@billerickson](https://github.com/billerickson)
141
+ * Improvements to the 'file' field type, props [@randyhoyt](https://github.com/randyhoyt)
142
+ * Allow for default values on 'radio' and 'radio_inline' field types, props [@billerickson](https://github.com/billerickson)
143
+
144
+ ### 0.6.1
145
+ * Enabled the ability to define your own custom field types (issue #28). props [@randyhoyt](https://github.com/randyhoyt)
146
+
147
+ ### 0.6
148
+ * Added the ability to limit metaboxes to certain posts by id. props [@billerickson](https://github.com/billerickson)
149
+
150
+ ### 0.5
151
+ * Fixed define to prevent notices. props [@destos](https://github.com/destos)
152
+ * Added text_date_timestap option. props [@andrewyno](https://github.com/andrewyno)
153
+ * Fixed WYSIWYG paragraph breaking/spacing bug. props [@wpsmith](https://github.com/wpsmith)
154
+ * Added taxonomy_radio and taxonomies_select options. props [@c3mdigital](https://github.com/c3mdigital)
155
+ * Fixed script causing the dashboard widgets to not be collapsible.
156
+ * Fixed various spacing and whitespace inconsistencies
157
+
158
+ ### 0.4
159
+ * Think we have a release that is mostly working. We'll say the initial release :)
lib/metabox/style.css ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CMB Styling
3
+ */
4
+ table.cmb_metabox tr:first-of-type td, table.cmb_metabox tr:first-of-type th { border:0; }
5
+ table.cmb_metabox td, table.cmb_metabox th { border-top: 1px solid #E9E9E9; }
6
+ table.cmb_metabox th { text-align: right; font-weight:bold;}
7
+ table.cmb_metabox th label { margin-top:5px; display:block;}
8
+ p.cmb_metabox_description { color: #AAA; font-style: italic; margin: 2px 0 !important;}
9
+ span.cmb_metabox_description { color: #AAA; font-style: italic;}
10
+ table.cmb_metabox input, table.cmb_metabox textarea { font-size:12px; padding: 5px; }
11
+ table.cmb_metabox input[type=text], table.cmb_metabox textarea { width: 97%; }
12
+ table.cmb_metabox textarea.cmb_textarea_code { font-family: Consolas,Monaco,monospace; line-height: 16px; }
13
+ table.cmb_metabox input.cmb_text_small { width: 100px; margin-right: 15px;}
14
+ table.cmb_metabox input.cmb_timepicker { width: 100px; margin-right: 15px;}
15
+ table.cmb_metabox input.cmb_text_money { width: 90px; margin-right: 15px;}
16
+ table.cmb_metabox input.cmb_text_medium { width: 230px; margin-right: 15px;}
17
+ table.cmb_metabox input.cmb_upload_file { width: 65%; }
18
+ table.cmb_metabox input.ed_button { padding: 2px 4px; }
19
+ table.cmb_metabox li { font-size:12px; margin: 1px 0 5px 0; line-height: 16px; }
20
+ table.cmb_metabox ul { padding-top:5px; margin: 0; }
21
+ table.cmb_metabox select { font-size:12px; margin-top: 3px;}
22
+ table.cmb_metabox input:focus, table.cmb_metabox textarea:focus { background: #fffff8;}
23
+ .cmb_metabox_title { margin: 0 0 5px 0; padding: 5px 0 0 0; font: italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}
24
+ .cmb_radio_inline { padding: 4px 0 0 0;}
25
+ .cmb_radio_inline_option {display: inline; padding-right: 18px;}
26
+ table.cmb_metabox input[type="radio"] { margin: 0 5px 0 0; padding: 0;}
27
+ table.cmb_metabox input[type="checkbox"] { margin: 0 5px 0 0; padding: 0;}
28
+ table.cmb_metabox .mceLayout {border:1px solid #DFDFDF !important;}
29
+ table.cmb_metabox .mceIframeContainer {background:#FFF;}
30
+ table.cmb_metabox .meta_mce {width:97%;}
31
+ table.cmb_metabox .meta_mce textarea {width:100%;}
32
+ table.cmb_metabox .cmb_media_status { margin: 10px 0 0 0;}
33
+ table.cmb_metabox .cmb_media_status .img_status, table.cmb_metabox .cmb_media_status .embed_status { position: relative; }
34
+ table.cmb_metabox .cmb_media_status .img_status img, table.cmb_metabox .cmb_media_status .embed_status { border:1px solid #DFDFDF; background: #FAFAFA; max-width:350px; padding: 5px; -moz-border-radius: 2px; border-radius: 2px;}
35
+ table.cmb_metabox .cmb_media_status .embed_status { float: left; max-width:800px;}
36
+ table.cmb_metabox .cmb_media_status .img_status .cmb_remove_file_button, table.cmb_metabox .cmb_media_status .embed_status .cmb_remove_file_button { text-indent: -9999px; background: url(images/ico-delete.png); width: 16px; height: 16px; position: absolute; top: -5px; left: -5px;}
37
+ table.cmb_metabox .attach_list li { clear: both; display: inline-block; margin-bottom: 25px; width: 100%; }
38
+ table.cmb_metabox .attach_list li img { float: left; margin-right: 10px; }
39
+ /* Sidebar placement adjustments */
40
+ .inner-sidebar table.cmb_metabox input[type=text], #side-sortables table.cmb_metabox input[type=text], table.cmb_metabox textarea { width: 95%; }
41
+ .inner-sidebar table.cmb_metabox .cmb_media_status .img_status img, #side-sortables table.cmb_metabox .cmb_media_status .img_status img, .inner-sidebar table.cmb_metabox .cmb_media_status .embed_status img, #side-sortables table.cmb_metabox .cmb_media_status .embed_status img { width: 90%; }
42
+ .postbox table.cmb_metabox .cmb-spinner { float: left; }
43
+ /**
44
+ * Color picker
45
+ */
46
+ table.cmb_metabox .wp-color-result, table.cmb_metabox .wp-picker-input-wrap { vertical-align: middle; }
47
+ table.cmb_metabox .wp-color-result, table.cmb_metabox .wp-picker-container { margin: 0 10px 0 0; }
48
+
49
+ /**
50
+ * Timepicker
51
+ */
52
+ div.time-picker { position: absolute; height: 191px; width:6em; /* needed for IE */overflow: auto; background: #fff; border: 1px solid #aaa; z-index: 99; margin: 0;}
53
+ div.time-picker-12hours { width:8em; /* needed for IE */}
54
+ div.time-picker ul { list-style-type: none; margin: 0; padding: 0; }
55
+ div.time-picker li { cursor: pointer; height: 10px; font: 12px/1 Helvetica, Arial, sans-serif; padding: 4px 3px; }
56
+ div.time-picker li.selected { background: #0063CE; color: #fff; }
57
+
58
+ /**
59
+ * jQuery UI CSS Framework 1.8.16
60
+ *
61
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
62
+ * Dual licensed under the MIT or GPL Version 2 licenses.
63
+ * http://jquery.org/license
64
+ *
65
+ * http://docs.jquery.com/UI/Theming/API
66
+ */
67
+ .cmb_element .ui-helper-hidden { display: none; }
68
+ .cmb_element .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
69
+ .cmb_element .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
70
+ .cmb_element .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
71
+ .cmb_element .ui-helper-clearfix { display: inline-block; }
72
+ * html .ui-helper-clearfix { height:1%; }
73
+ .cmb_element .ui-helper-clearfix { display:block; }
74
+ .cmb_element .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
75
+ .cmb_element .ui-state-disabled { cursor: default !important; }
76
+ .cmb_element .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
77
+ .cmb_element .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
78
+ .cmb_element .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
79
+ .cmb_element .ui-widget .ui-widget { font-size: 1em; }
80
+ .cmb_element .ui-widget input, .cmb_element .ui-widget select, .cmb_element .ui-widget textarea, .cmb_element .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
81
+ .cmb_element .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
82
+ .cmb_element .ui-widget-content a { color: #222222; }
83
+ .cmb_element .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
84
+ .cmb_element .ui-widget-header a { color: #222222; }
85
+ .cmb_element .ui-state-default, .cmb_element .ui-widget-content .ui-state-default, .cmb_element .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
86
+ .cmb_element .ui-state-default a, .cmb_element .ui-state-default a:link, .cmb_element .ui-state-default a:visited { color: #555555; text-decoration: none; }
87
+ .cmb_element .ui-state-hover, .cmb_element .ui-widget-content .ui-state-hover, .cmb_element .ui-widget-header .ui-state-hover, .cmb_element .ui-state-focus, .cmb_element .ui-widget-content .ui-state-focus, .cmb_element .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
88
+ .cmb_element .ui-state-hover a, .cmb_element .ui-state-hover a:hover { color: #212121; text-decoration: none; }
89
+ .cmb_element .ui-state-active, .cmb_element .ui-widget-content .ui-state-active, .cmb_element .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
90
+ .cmb_element .ui-state-active a, .cmb_element .ui-state-active a:link, .cmb_element .ui-state-active a:visited { color: #212121; text-decoration: none; }
91
+ .cmb_element .ui-widget :active { outline: none; }
92
+ .cmb_element .ui-state-highlight, .cmb_element .ui-widget-content .ui-state-highlight, .cmb_element .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
93
+ .cmb_element .ui-state-highlight a, .cmb_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
94
+ .cmb_element .ui-state-error, .cmb_element .ui-widget-content .ui-state-error, .cmb_element .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
95
+ .cmb_element .ui-state-error a, .cmb_element .ui-widget-content .ui-state-error a, .cmb_element .ui-widget-header .ui-state-error a { color: #cd0a0a; }
96
+ .cmb_element .ui-state-error-text, .cmb_element .ui-widget-content .ui-state-error-text, .cmb_element .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
97
+ .cmb_element .ui-priority-primary, .cmb_element .ui-widget-content .ui-priority-primary, .cmb_element .ui-widget-header .ui-priority-primary { font-weight: bold; }
98
+ .cmb_element .ui-priority-secondary, .cmb_element .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
99
+ .cmb_element .ui-state-disabled, .cmb_element .ui-widget-content .ui-state-disabled, .cmb_element .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
100
+ .cmb_element .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
101
+ .cmb_element .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
102
+ .cmb_element .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
103
+ .cmb_element .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
104
+ .cmb_element .ui-state-hover .ui-icon, .cmb_element .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
105
+ .cmb_element .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
106
+ .cmb_element .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
107
+ .cmb_element .ui-state-error .ui-icon, .cmb_element .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
108
+ .cmb_element .ui-icon-carat-1-n { background-position: 0 0; }
109
+ .cmb_element .ui-icon-carat-1-ne { background-position: -16px 0; }
110
+ .cmb_element .ui-icon-carat-1-e { background-position: -32px 0; }
111
+ .cmb_element .ui-icon-carat-1-se { background-position: -48px 0; }
112
+ .cmb_element .ui-icon-carat-1-s { background-position: -64px 0; }
113
+ .cmb_element .ui-icon-carat-1-sw { background-position: -80px 0; }
114
+ .cmb_element .ui-icon-carat-1-w { background-position: -96px 0; }
115
+ .cmb_element .ui-icon-carat-1-nw { background-position: -112px 0; }
116
+ .cmb_element .ui-icon-carat-2-n-s { background-position: -128px 0; }
117
+ .cmb_element .ui-icon-carat-2-e-w { background-position: -144px 0; }
118
+ .cmb_element .ui-icon-triangle-1-n { background-position: 0 -16px; }
119
+ .cmb_element .ui-icon-triangle-1-ne { background-position: -16px -16px; }
120
+ .cmb_element .ui-icon-triangle-1-e { background-position: -32px -16px; }
121
+ .cmb_element .ui-icon-triangle-1-se { background-position: -48px -16px; }
122
+ .cmb_element .ui-icon-triangle-1-s { background-position: -64px -16px; }
123
+ .cmb_element .ui-icon-triangle-1-sw { background-position: -80px -16px; }
124
+ .cmb_element .ui-icon-triangle-1-w { background-position: -96px -16px; }
125
+ .cmb_element .ui-icon-triangle-1-nw { background-position: -112px -16px; }
126
+ .cmb_element .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
127
+ .cmb_element .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
128
+ .cmb_element .ui-icon-arrow-1-n { background-position: 0 -32px; }
129
+ .cmb_element .ui-icon-arrow-1-ne { background-position: -16px -32px; }
130
+ .cmb_element .ui-icon-arrow-1-e { background-position: -32px -32px; }
131
+ .cmb_element .ui-icon-arrow-1-se { background-position: -48px -32px; }
132
+ .cmb_element .ui-icon-arrow-1-s { background-position: -64px -32px; }
133
+ .cmb_element .ui-icon-arrow-1-sw { background-position: -80px -32px; }
134
+ .cmb_element .ui-icon-arrow-1-w { background-position: -96px -32px; }
135
+ .cmb_element .ui-icon-arrow-1-nw { background-position: -112px -32px; }
136
+ .cmb_element .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
137
+ .cmb_element .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
138
+ .cmb_element .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
139
+ .cmb_element .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
140
+ .cmb_element .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
141
+ .cmb_element .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
142
+ .cmb_element .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
143
+ .cmb_element .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
144
+ .cmb_element .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
145
+ .cmb_element .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
146
+ .cmb_element .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
147
+ .cmb_element .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
148
+ .cmb_element .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
149
+ .cmb_element .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
150
+ .cmb_element .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
151
+ .cmb_element .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
152
+ .cmb_element .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
153
+ .cmb_element .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
154
+ .cmb_element .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
155
+ .cmb_element .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
156
+ .cmb_element .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
157
+ .cmb_element .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
158
+ .cmb_element .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
159
+ .cmb_element .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
160
+ .cmb_element .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
161
+ .cmb_element .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
162
+ .cmb_element .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
163
+ .cmb_element .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
164
+ .cmb_element .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
165
+ .cmb_element .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
166
+ .cmb_element .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
167
+ .cmb_element .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
168
+ .cmb_element .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
169
+ .cmb_element .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
170
+ .cmb_element .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
171
+ .cmb_element .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
172
+ .cmb_element .ui-icon-arrow-4 { background-position: 0 -80px; }
173
+ .cmb_element .ui-icon-arrow-4-diag { background-position: -16px -80px; }
174
+ .cmb_element .ui-icon-extlink { background-position: -32px -80px; }
175
+ .cmb_element .ui-icon-newwin { background-position: -48px -80px; }
176
+ .cmb_element .ui-icon-refresh { background-position: -64px -80px; }
177
+ .cmb_element .ui-icon-shuffle { background-position: -80px -80px; }
178
+ .cmb_element .ui-icon-transfer-e-w { background-position: -96px -80px; }
179
+ .cmb_element .ui-icon-transferthick-e-w { background-position: -112px -80px; }
180
+ .cmb_element .ui-icon-folder-collapsed { background-position: 0 -96px; }
181
+ .cmb_element .ui-icon-folder-open { background-position: -16px -96px; }
182
+ .cmb_element .ui-icon-document { background-position: -32px -96px; }
183
+ .cmb_element .ui-icon-document-b { background-position: -48px -96px; }
184
+ .cmb_element .ui-icon-note { background-position: -64px -96px; }
185
+ .cmb_element .ui-icon-mail-closed { background-position: -80px -96px; }
186
+ .cmb_element .ui-icon-mail-open { background-position: -96px -96px; }
187
+ .cmb_element .ui-icon-suitcase { background-position: -112px -96px; }
188
+ .cmb_element .ui-icon-comment { background-position: -128px -96px; }
189
+ .cmb_element .ui-icon-person { background-position: -144px -96px; }
190
+ .cmb_element .ui-icon-print { background-position: -160px -96px; }
191
+ .cmb_element .ui-icon-trash { background-position: -176px -96px; }
192
+ .cmb_element .ui-icon-locked { background-position: -192px -96px; }
193
+ .cmb_element .ui-icon-unlocked { background-position: -208px -96px; }
194
+ .cmb_element .ui-icon-bookmark { background-position: -224px -96px; }
195
+ .cmb_element .ui-icon-tag { background-position: -240px -96px; }
196
+ .cmb_element .ui-icon-home { background-position: 0 -112px; }
197
+ .cmb_element .ui-icon-flag { background-position: -16px -112px; }
198
+ .cmb_element .ui-icon-calendar { background-position: -32px -112px; }
199
+ .cmb_element .ui-icon-cart { background-position: -48px -112px; }
200
+ .cmb_element .ui-icon-pencil { background-position: -64px -112px; }
201
+ .cmb_element .ui-icon-clock { background-position: -80px -112px; }
202
+ .cmb_element .ui-icon-disk { background-position: -96px -112px; }
203
+ .cmb_element .ui-icon-calculator { background-position: -112px -112px; }
204
+ .cmb_element .ui-icon-zoomin { background-position: -128px -112px; }
205
+ .cmb_element .ui-icon-zoomout { background-position: -144px -112px; }
206
+ .cmb_element .ui-icon-search { background-position: -160px -112px; }
207
+ .cmb_element .ui-icon-wrench { background-position: -176px -112px; }
208
+ .cmb_element .ui-icon-gear { background-position: -192px -112px; }
209
+ .cmb_element .ui-icon-heart { background-position: -208px -112px; }
210
+ .cmb_element .ui-icon-star { background-position: -224px -112px; }
211
+ .cmb_element .ui-icon-link { background-position: -240px -112px; }
212
+ .cmb_element .ui-icon-cancel { background-position: 0 -128px; }
213
+ .cmb_element .ui-icon-plus { background-position: -16px -128px; }
214
+ .cmb_element .ui-icon-plusthick { background-position: -32px -128px; }
215
+ .cmb_element .ui-icon-minus { background-position: -48px -128px; }
216
+ .cmb_element .ui-icon-minusthick { background-position: -64px -128px; }
217
+ .cmb_element .ui-icon-close { background-position: -80px -128px; }
218
+ .cmb_element .ui-icon-closethick { background-position: -96px -128px; }
219
+ .cmb_element .ui-icon-key { background-position: -112px -128px; }
220
+ .cmb_element .ui-icon-lightbulb { background-position: -128px -128px; }
221
+ .cmb_element .ui-icon-scissors { background-position: -144px -128px; }
222
+ .cmb_element .ui-icon-clipboard { background-position: -160px -128px; }
223
+ .cmb_element .ui-icon-copy { background-position: -176px -128px; }
224
+ .cmb_element .ui-icon-contact { background-position: -192px -128px; }
225
+ .cmb_element .ui-icon-image { background-position: -208px -128px; }
226
+ .cmb_element .ui-icon-video { background-position: -224px -128px; }
227
+ .cmb_element .ui-icon-script { background-position: -240px -128px; }
228
+ .cmb_element .ui-icon-alert { background-position: 0 -144px; }
229
+ .cmb_element .ui-icon-info { background-position: -16px -144px; }
230
+ .cmb_element .ui-icon-notice { background-position: -32px -144px; }
231
+ .cmb_element .ui-icon-help { background-position: -48px -144px; }
232
+ .cmb_element .ui-icon-check { background-position: -64px -144px; }
233
+ .cmb_element .ui-icon-bullet { background-position: -80px -144px; }
234
+ .cmb_element .ui-icon-radio-off { background-position: -96px -144px; }
235
+ .cmb_element .ui-icon-radio-on { background-position: -112px -144px; }
236
+ .cmb_element .ui-icon-pin-w { background-position: -128px -144px; }
237
+ .cmb_element .ui-icon-pin-s { background-position: -144px -144px; }
238
+ .cmb_element .ui-icon-play { background-position: 0 -160px; }
239
+ .cmb_element .ui-icon-pause { background-position: -16px -160px; }
240
+ .cmb_element .ui-icon-seek-next { background-position: -32px -160px; }
241
+ .cmb_element .ui-icon-seek-prev { background-position: -48px -160px; }
242
+ .cmb_element .ui-icon-seek-end { background-position: -64px -160px; }
243
+ .cmb_element .ui-icon-seek-start { background-position: -80px -160px; }
244
+ .cmb_element .ui-icon-seek-first { background-position: -80px -160px; }
245
+ .cmb_element .ui-icon-stop { background-position: -96px -160px; }
246
+ .cmb_element .ui-icon-eject { background-position: -112px -160px; }
247
+ .cmb_element .ui-icon-volume-off { background-position: -128px -160px; }
248
+ .cmb_element .ui-icon-volume-on { background-position: -144px -160px; }
249
+ .cmb_element .ui-icon-power { background-position: 0 -176px; }
250
+ .cmb_element .ui-icon-signal-diag { background-position: -16px -176px; }
251
+ .cmb_element .ui-icon-signal { background-position: -32px -176px; }
252
+ .cmb_element .ui-icon-battery-0 { background-position: -48px -176px; }
253
+ .cmb_element .ui-icon-battery-1 { background-position: -64px -176px; }
254
+ .cmb_element .ui-icon-battery-2 { background-position: -80px -176px; }
255
+ .cmb_element .ui-icon-battery-3 { background-position: -96px -176px; }
256
+ .cmb_element .ui-icon-circle-plus { background-position: 0 -192px; }
257
+ .cmb_element .ui-icon-circle-minus { background-position: -16px -192px; }
258
+ .cmb_element .ui-icon-circle-close { background-position: -32px -192px; }
259
+ .cmb_element .ui-icon-circle-triangle-e { background-position: -48px -192px; }
260
+ .cmb_element .ui-icon-circle-triangle-s { background-position: -64px -192px; }
261
+ .cmb_element .ui-icon-circle-triangle-w { background-position: -80px -192px; }
262
+ .cmb_element .ui-icon-circle-triangle-n { background-position: -96px -192px; }
263
+ .cmb_element .ui-icon-circle-arrow-e { background-position: -112px -192px; }
264
+ .cmb_element .ui-icon-circle-arrow-s { background-position: -128px -192px; }
265
+ .cmb_element .ui-icon-circle-arrow-w { background-position: -144px -192px; }
266
+ .cmb_element .ui-icon-circle-arrow-n { background-position: -160px -192px; }
267
+ .cmb_element .ui-icon-circle-zoomin { background-position: -176px -192px; }
268
+ .cmb_element .ui-icon-circle-zoomout { background-position: -192px -192px; }
269
+ .cmb_element .ui-icon-circle-check { background-position: -208px -192px; }
270
+ .cmb_element .ui-icon-circlesmall-plus { background-position: 0 -208px; }
271
+ .cmb_element .ui-icon-circlesmall-minus { background-position: -16px -208px; }
272
+ .cmb_element .ui-icon-circlesmall-close { background-position: -32px -208px; }
273
+ .cmb_element .ui-icon-squaresmall-plus { background-position: -48px -208px; }
274
+ .cmb_element .ui-icon-squaresmall-minus { background-position: -64px -208px; }
275
+ .cmb_element .ui-icon-squaresmall-close { background-position: -80px -208px; }
276
+ .cmb_element .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
277
+ .cmb_element .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
278
+ .cmb_element .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
279
+ .cmb_element .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
280
+ .cmb_element .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
281
+ .cmb_element .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
282
+ .cmb_element .ui-corner-all, .cmb_element .ui-corner-top, .cmb_element .ui-corner-left, .cmb_element .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
283
+ .cmb_element .ui-corner-all, .cmb_element .ui-corner-top, .cmb_element .ui-corner-right, .cmb_element .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
284
+ .cmb_element .ui-corner-all, .cmb_element .ui-corner-bottom, .cmb_element .ui-corner-left, .cmb_element .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
285
+ .cmb_element .ui-corner-all, .cmb_element .ui-corner-bottom, .cmb_element .ui-corner-right, .cmb_element .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
286
+ .cmb_element .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
287
+ .cmb_element .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
288
+ .cmb_element .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
289
+ .cmb_element .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
290
+ .cmb_element .ui-datepicker .ui-datepicker-prev, .cmb_element .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
291
+ .cmb_element .ui-datepicker .ui-datepicker-prev-hover, .cmb_element .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
292
+ .cmb_element .ui-datepicker .ui-datepicker-prev { left:2px; }
293
+ .cmb_element .ui-datepicker .ui-datepicker-next { right:2px; }
294
+ .cmb_element .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
295
+ .cmb_element .ui-datepicker .ui-datepicker-next-hover { right:1px; }
296
+ .cmb_element .ui-datepicker .ui-datepicker-prev span, .cmb_element .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
297
+ .cmb_element .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
298
+ .cmb_element .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
299
+ .cmb_element .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
300
+ .cmb_element .ui-datepicker select.ui-datepicker-month,
301
+ .cmb_element .ui-datepicker select.ui-datepicker-year { width: 49%;}
302
+ .cmb_element .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
303
+ .cmb_element .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
304
+ .cmb_element .ui-datepicker td { border: 0; padding: 1px; }
305
+ .cmb_element .ui-datepicker td span, .cmb_element .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
306
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
307
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
308
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
309
+ .cmb_element .ui-datepicker.ui-datepicker-multi { width:auto; }
310
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group { float:left; }
311
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
312
+ .cmb_element .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
313
+ .cmb_element .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
314
+ .cmb_element .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
315
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
316
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
317
+ .cmb_element .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
318
+ .cmb_element .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
319
+ .cmb_element .ui-datepicker-rtl { direction: rtl; }
320
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
321
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
322
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
323
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
324
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
325
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
326
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
327
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-group { float:right; }
328
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
329
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
330
+ .cmb_element .ui-datepicker-cover {
331
+ display: none; /*sorry for IE5*/
332
+ display/**/: block; /*sorry for IE5*/
333
+ position: absolute; /*must have*/
334
+ z-index: -1; /*must have*/
335
+ filter: mask(); /*must have*/
336
+ top: -4px; /*must have*/
337
+ left: -4px; /*must have*/
338
+ width: 200px; /*must have*/
339
+ height: 200px; /*must have*/
340
+ }
341
+ #ui-datepicker-div { z-index: 999999 !important; }
342
+ .ui-datepicker-prev:hover,.ui-datepicker-next:hover { cursor: pointer !important; }
343
+ .wp-picker-holder { position: absolute; }
lib/metabox/style.min.css ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ table.cmb_metabox tr:first-of-type td,table.cmb_metabox tr:first-of-type th{border:0}table.cmb_metabox td,table.cmb_metabox th{border-top:1px solid #e9e9e9}
2
+ table.cmb_metabox th{text-align:right;font-weight:bold}table.cmb_metabox th label{margin-top:5px;display:block}p.cmb_metabox_description{color:#AAA;font-style:italic;margin:2px 0!important}
3
+ span.cmb_metabox_description{color:#AAA;font-style:italic}table.cmb_metabox input,table.cmb_metabox textarea{font-size:12px;padding:5px}table.cmb_metabox input[type=text],table.cmb_metabox textarea{width:97%}
4
+ table.cmb_metabox textarea.cmb_textarea_code{font-family:Consolas,Monaco,monospace;line-height:16px}table.cmb_metabox input.cmb_text_small{width:100px;margin-right:15px}
5
+ table.cmb_metabox input.cmb_timepicker{width:100px;margin-right:15px}table.cmb_metabox input.cmb_text_money{width:90px;margin-right:15px}table.cmb_metabox input.cmb_text_medium{width:230px;margin-right:15px}
6
+ table.cmb_metabox input.cmb_upload_file{width:65%}table.cmb_metabox input.ed_button{padding:2px 4px}table.cmb_metabox li{font-size:12px;margin:1px 0 5px 0;line-height:16px}table.cmb_metabox ul{padding-top:5px;margin:0}
7
+ table.cmb_metabox select{font-size:12px;margin-top:3px}table.cmb_metabox input:focus,table.cmb_metabox textarea:focus{background:#fffff8}.cmb_metabox_title{margin:0 0 5px 0;padding:5px 0 0 0;font:italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif}
8
+ .cmb_radio_inline{padding:4px 0 0 0}.cmb_radio_inline_option{display:inline;padding-right:18px}table.cmb_metabox input[type="radio"]{margin:0 5px 0 0;padding:0}
9
+ table.cmb_metabox input[type="checkbox"]{margin:0 5px 0 0;padding:0}table.cmb_metabox .mceLayout{border:1px solid #dfdfdf!important}
10
+ table.cmb_metabox .mceIframeContainer{background:#FFF}table.cmb_metabox .meta_mce{width:97%}table.cmb_metabox .meta_mce textarea{width:100%}table.cmb_metabox .cmb_media_status{margin:10px 0 0 0}
11
+ table.cmb_metabox .cmb_media_status .img_status,table.cmb_metabox .cmb_media_status .embed_status{position:relative}table.cmb_metabox .cmb_media_status .img_status img,table.cmb_metabox .cmb_media_status .embed_status{border:1px solid #dfdfdf;background:#fafafa;max-width:350px;padding:5px;-moz-border-radius:2px;border-radius:2px}
12
+ table.cmb_metabox .cmb_media_status .embed_status{float:left;max-width:800px}table.cmb_metabox .cmb_media_status .img_status .cmb_remove_file_button,table.cmb_metabox .cmb_media_status .embed_status .cmb_remove_file_button{text-indent:-9999px;background:url(images/ico-delete.png);width:16px;height:16px;position:absolute;top:-5px;left:-5px}
13
+ table.cmb_metabox .attach_list li{clear:both;display:inline-block;margin-bottom:25px;width:100%}table.cmb_metabox .attach_list li img{float:left;margin-right:10px}
14
+ .inner-sidebar table.cmb_metabox input[type=text],#side-sortables table.cmb_metabox input[type=text],table.cmb_metabox textarea{width:95%}.inner-sidebar table.cmb_metabox .cmb_media_status .img_status img,#side-sortables table.cmb_metabox .cmb_media_status .img_status img,.inner-sidebar table.cmb_metabox .cmb_media_status .embed_status img,#side-sortables table.cmb_metabox .cmb_media_status .embed_status img{width:90%}
15
+ .postbox table.cmb_metabox .cmb-spinner{float:left}table.cmb_metabox .wp-color-result,table.cmb_metabox .wp-picker-input-wrap{vertical-align:middle}table.cmb_metabox .wp-color-result,table.cmb_metabox .wp-picker-container{margin:0 10px 0 0}
16
+ div.time-picker{position:absolute;height:191px;width:6em;overflow:auto;background:#fff;border:1px solid #aaa;z-index:99;margin:0}div.time-picker-12hours{width:8em}
17
+ div.time-picker ul{list-style-type:none;margin:0;padding:0}div.time-picker li{cursor:pointer;height:10px;font:12px/1 Helvetica,Arial,sans-serif;padding:4px 3px}
18
+ div.time-picker li.selected{background:#0063ce;color:#fff}.cmb_element .ui-helper-hidden{display:none}.cmb_element .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}
19
+ .cmb_element .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.cmb_element .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}
20
+ .cmb_element .ui-helper-clearfix{display:inline-block}* html .ui-helper-clearfix{height:1%}.cmb_element .ui-helper-clearfix{display:block}.cmb_element .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}
21
+ .cmb_element .ui-state-disabled{cursor:default!important}.cmb_element .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}
22
+ .cmb_element .ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.cmb_element .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}
23
+ .cmb_element .ui-widget .ui-widget{font-size:1em}.cmb_element .ui-widget input,.cmb_element .ui-widget select,.cmb_element .ui-widget textarea,.cmb_element .ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}
24
+ .cmb_element .ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.cmb_element .ui-widget-content a{color:#222}
25
+ .cmb_element .ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}
26
+ .cmb_element .ui-widget-header a{color:#222}.cmb_element .ui-state-default,.cmb_element .ui-widget-content .ui-state-default,.cmb_element .ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}
27
+ .cmb_element .ui-state-default a,.cmb_element .ui-state-default a:link,.cmb_element .ui-state-default a:visited{color:#555;text-decoration:none}.cmb_element .ui-state-hover,.cmb_element .ui-widget-content .ui-state-hover,.cmb_element .ui-widget-header .ui-state-hover,.cmb_element .ui-state-focus,.cmb_element .ui-widget-content .ui-state-focus,.cmb_element .ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}
28
+ .cmb_element .ui-state-hover a,.cmb_element .ui-state-hover a:hover{color:#212121;text-decoration:none}.cmb_element .ui-state-active,.cmb_element .ui-widget-content .ui-state-active,.cmb_element .ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}
29
+ .cmb_element .ui-state-active a,.cmb_element .ui-state-active a:link,.cmb_element .ui-state-active a:visited{color:#212121;text-decoration:none}.cmb_element .ui-widget :active{outline:0}
30
+ .cmb_element .ui-state-highlight,.cmb_element .ui-widget-content .ui-state-highlight,.cmb_element .ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}
31
+ .cmb_element .ui-state-highlight a,.cmb_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.cmb_element .ui-state-error,.cmb_element .ui-widget-content .ui-state-error,.cmb_element .ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}
32
+ .cmb_element .ui-state-error a,.cmb_element .ui-widget-content .ui-state-error a,.cmb_element .ui-widget-header .ui-state-error a{color:#cd0a0a}.cmb_element .ui-state-error-text,.cmb_element .ui-widget-content .ui-state-error-text,.cmb_element .ui-widget-header .ui-state-error-text{color:#cd0a0a}
33
+ .cmb_element .ui-priority-primary,.cmb_element .ui-widget-content .ui-priority-primary,.cmb_element .ui-widget-header .ui-priority-primary{font-weight:bold}
34
+ .cmb_element .ui-priority-secondary,.cmb_element .ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}
35
+ .cmb_element .ui-state-disabled,.cmb_element .ui-widget-content .ui-state-disabled,.cmb_element .ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}
36
+ .cmb_element .ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.cmb_element .ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}
37
+ .cmb_element .ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.cmb_element .ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}
38
+ .cmb_element .ui-state-hover .ui-icon,.cmb_element .ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.cmb_element .ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}
39
+ .cmb_element .ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.cmb_element .ui-state-error .ui-icon,.cmb_element .ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}
40
+ .cmb_element .ui-icon-carat-1-n{background-position:0 0}.cmb_element .ui-icon-carat-1-ne{background-position:-16px 0}.cmb_element .ui-icon-carat-1-e{background-position:-32px 0}
41
+ .cmb_element .ui-icon-carat-1-se{background-position:-48px 0}.cmb_element .ui-icon-carat-1-s{background-position:-64px 0}.cmb_element .ui-icon-carat-1-sw{background-position:-80px 0}
42
+ .cmb_element .ui-icon-carat-1-w{background-position:-96px 0}.cmb_element .ui-icon-carat-1-nw{background-position:-112px 0}.cmb_element .ui-icon-carat-2-n-s{background-position:-128px 0}
43
+ .cmb_element .ui-icon-carat-2-e-w{background-position:-144px 0}.cmb_element .ui-icon-triangle-1-n{background-position:0 -16px}.cmb_element .ui-icon-triangle-1-ne{background-position:-16px -16px}
44
+ .cmb_element .ui-icon-triangle-1-e{background-position:-32px -16px}.cmb_element .ui-icon-triangle-1-se{background-position:-48px -16px}.cmb_element .ui-icon-triangle-1-s{background-position:-64px -16px}
45
+ .cmb_element .ui-icon-triangle-1-sw{background-position:-80px -16px}.cmb_element .ui-icon-triangle-1-w{background-position:-96px -16px}.cmb_element .ui-icon-triangle-1-nw{background-position:-112px -16px}
46
+ .cmb_element .ui-icon-triangle-2-n-s{background-position:-128px -16px}.cmb_element .ui-icon-triangle-2-e-w{background-position:-144px -16px}.cmb_element .ui-icon-arrow-1-n{background-position:0 -32px}
47
+ .cmb_element .ui-icon-arrow-1-ne{background-position:-16px -32px}.cmb_element .ui-icon-arrow-1-e{background-position:-32px -32px}.cmb_element .ui-icon-arrow-1-se{background-position:-48px -32px}
48
+ .cmb_element .ui-icon-arrow-1-s{background-position:-64px -32px}.cmb_element .ui-icon-arrow-1-sw{background-position:-80px -32px}.cmb_element .ui-icon-arrow-1-w{background-position:-96px -32px}
49
+ .cmb_element .ui-icon-arrow-1-nw{background-position:-112px -32px}.cmb_element .ui-icon-arrow-2-n-s{background-position:-128px -32px}.cmb_element .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}
50
+ .cmb_element .ui-icon-arrow-2-e-w{background-position:-160px -32px}.cmb_element .ui-icon-arrow-2-se-nw{background-position:-176px -32px}.cmb_element .ui-icon-arrowstop-1-n{background-position:-192px -32px}
51
+ .cmb_element .ui-icon-arrowstop-1-e{background-position:-208px -32px}.cmb_element .ui-icon-arrowstop-1-s{background-position:-224px -32px}.cmb_element .ui-icon-arrowstop-1-w{background-position:-240px -32px}
52
+ .cmb_element .ui-icon-arrowthick-1-n{background-position:0 -48px}.cmb_element .ui-icon-arrowthick-1-ne{background-position:-16px -48px}.cmb_element .ui-icon-arrowthick-1-e{background-position:-32px -48px}
53
+ .cmb_element .ui-icon-arrowthick-1-se{background-position:-48px -48px}.cmb_element .ui-icon-arrowthick-1-s{background-position:-64px -48px}.cmb_element .ui-icon-arrowthick-1-sw{background-position:-80px -48px}
54
+ .cmb_element .ui-icon-arrowthick-1-w{background-position:-96px -48px}.cmb_element .ui-icon-arrowthick-1-nw{background-position:-112px -48px}.cmb_element .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}
55
+ .cmb_element .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.cmb_element .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.cmb_element .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}
56
+ .cmb_element .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.cmb_element .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.cmb_element .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}
57
+ .cmb_element .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.cmb_element .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.cmb_element .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}
58
+ .cmb_element .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.cmb_element .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}
59
+ .cmb_element .ui-icon-arrowreturn-1-w{background-position:-64px -64px}.cmb_element .ui-icon-arrowreturn-1-n{background-position:-80px -64px}.cmb_element .ui-icon-arrowreturn-1-e{background-position:-96px -64px}
60
+ .cmb_element .ui-icon-arrowreturn-1-s{background-position:-112px -64px}.cmb_element .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.cmb_element .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}
61
+ .cmb_element .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.cmb_element .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.cmb_element .ui-icon-arrow-4{background-position:0 -80px}
62
+ .cmb_element .ui-icon-arrow-4-diag{background-position:-16px -80px}.cmb_element .ui-icon-extlink{background-position:-32px -80px}.cmb_element .ui-icon-newwin{background-position:-48px -80px}
63
+ .cmb_element .ui-icon-refresh{background-position:-64px -80px}.cmb_element .ui-icon-shuffle{background-position:-80px -80px}.cmb_element .ui-icon-transfer-e-w{background-position:-96px -80px}
64
+ .cmb_element .ui-icon-transferthick-e-w{background-position:-112px -80px}.cmb_element .ui-icon-folder-collapsed{background-position:0 -96px}.cmb_element .ui-icon-folder-open{background-position:-16px -96px}
65
+ .cmb_element .ui-icon-document{background-position:-32px -96px}.cmb_element .ui-icon-document-b{background-position:-48px -96px}.cmb_element .ui-icon-note{background-position:-64px -96px}
66
+ .cmb_element .ui-icon-mail-closed{background-position:-80px -96px}.cmb_element .ui-icon-mail-open{background-position:-96px -96px}.cmb_element .ui-icon-suitcase{background-position:-112px -96px}
67
+ .cmb_element .ui-icon-comment{background-position:-128px -96px}.cmb_element .ui-icon-person{background-position:-144px -96px}.cmb_element .ui-icon-print{background-position:-160px -96px}
68
+ .cmb_element .ui-icon-trash{background-position:-176px -96px}.cmb_element .ui-icon-locked{background-position:-192px -96px}.cmb_element .ui-icon-unlocked{background-position:-208px -96px}
69
+ .cmb_element .ui-icon-bookmark{background-position:-224px -96px}.cmb_element .ui-icon-tag{background-position:-240px -96px}.cmb_element .ui-icon-home{background-position:0 -112px}
70
+ .cmb_element .ui-icon-flag{background-position:-16px -112px}.cmb_element .ui-icon-calendar{background-position:-32px -112px}.cmb_element .ui-icon-cart{background-position:-48px -112px}
71
+ .cmb_element .ui-icon-pencil{background-position:-64px -112px}.cmb_element .ui-icon-clock{background-position:-80px -112px}.cmb_element .ui-icon-disk{background-position:-96px -112px}
72
+ .cmb_element .ui-icon-calculator{background-position:-112px -112px}.cmb_element .ui-icon-zoomin{background-position:-128px -112px}.cmb_element .ui-icon-zoomout{background-position:-144px -112px}
73
+ .cmb_element .ui-icon-search{background-position:-160px -112px}.cmb_element .ui-icon-wrench{background-position:-176px -112px}.cmb_element .ui-icon-gear{background-position:-192px -112px}
74
+ .cmb_element .ui-icon-heart{background-position:-208px -112px}.cmb_element .ui-icon-star{background-position:-224px -112px}.cmb_element .ui-icon-link{background-position:-240px -112px}
75
+ .cmb_element .ui-icon-cancel{background-position:0 -128px}.cmb_element .ui-icon-plus{background-position:-16px -128px}.cmb_element .ui-icon-plusthick{background-position:-32px -128px}
76
+ .cmb_element .ui-icon-minus{background-position:-48px -128px}.cmb_element .ui-icon-minusthick{background-position:-64px -128px}.cmb_element .ui-icon-close{background-position:-80px -128px}
77
+ .cmb_element .ui-icon-closethick{background-position:-96px -128px}.cmb_element .ui-icon-key{background-position:-112px -128px}.cmb_element .ui-icon-lightbulb{background-position:-128px -128px}
78
+ .cmb_element .ui-icon-scissors{background-position:-144px -128px}.cmb_element .ui-icon-clipboard{background-position:-160px -128px}.cmb_element .ui-icon-copy{background-position:-176px -128px}
79
+ .cmb_element .ui-icon-contact{background-position:-192px -128px}.cmb_element .ui-icon-image{background-position:-208px -128px}.cmb_element .ui-icon-video{background-position:-224px -128px}
80
+ .cmb_element .ui-icon-script{background-position:-240px -128px}.cmb_element .ui-icon-alert{background-position:0 -144px}.cmb_element .ui-icon-info{background-position:-16px -144px}
81
+ .cmb_element .ui-icon-notice{background-position:-32px -144px}.cmb_element .ui-icon-help{background-position:-48px -144px}.cmb_element .ui-icon-check{background-position:-64px -144px}
82
+ .cmb_element .ui-icon-bullet{background-position:-80px -144px}.cmb_element .ui-icon-radio-off{background-position:-96px -144px}.cmb_element .ui-icon-radio-on{background-position:-112px -144px}
83
+ .cmb_element .ui-icon-pin-w{background-position:-128px -144px}.cmb_element .ui-icon-pin-s{background-position:-144px -144px}.cmb_element .ui-icon-play{background-position:0 -160px}
84
+ .cmb_element .ui-icon-pause{background-position:-16px -160px}.cmb_element .ui-icon-seek-next{background-position:-32px -160px}.cmb_element .ui-icon-seek-prev{background-position:-48px -160px}
85
+ .cmb_element .ui-icon-seek-end{background-position:-64px -160px}.cmb_element .ui-icon-seek-start{background-position:-80px -160px}.cmb_element .ui-icon-seek-first{background-position:-80px -160px}
86
+ .cmb_element .ui-icon-stop{background-position:-96px -160px}.cmb_element .ui-icon-eject{background-position:-112px -160px}.cmb_element .ui-icon-volume-off{background-position:-128px -160px}
87
+ .cmb_element .ui-icon-volume-on{background-position:-144px -160px}.cmb_element .ui-icon-power{background-position:0 -176px}.cmb_element .ui-icon-signal-diag{background-position:-16px -176px}
88
+ .cmb_element .ui-icon-signal{background-position:-32px -176px}.cmb_element .ui-icon-battery-0{background-position:-48px -176px}.cmb_element .ui-icon-battery-1{background-position:-64px -176px}
89
+ .cmb_element .ui-icon-battery-2{background-position:-80px -176px}.cmb_element .ui-icon-battery-3{background-position:-96px -176px}.cmb_element .ui-icon-circle-plus{background-position:0 -192px}
90
+ .cmb_element .ui-icon-circle-minus{background-position:-16px -192px}.cmb_element .ui-icon-circle-close{background-position:-32px -192px}.cmb_element .ui-icon-circle-triangle-e{background-position:-48px -192px}
91
+ .cmb_element .ui-icon-circle-triangle-s{background-position:-64px -192px}.cmb_element .ui-icon-circle-triangle-w{background-position:-80px -192px}.cmb_element .ui-icon-circle-triangle-n{background-position:-96px -192px}
92
+ .cmb_element .ui-icon-circle-arrow-e{background-position:-112px -192px}.cmb_element .ui-icon-circle-arrow-s{background-position:-128px -192px}.cmb_element .ui-icon-circle-arrow-w{background-position:-144px -192px}
93
+ .cmb_element .ui-icon-circle-arrow-n{background-position:-160px -192px}.cmb_element .ui-icon-circle-zoomin{background-position:-176px -192px}.cmb_element .ui-icon-circle-zoomout{background-position:-192px -192px}
94
+ .cmb_element .ui-icon-circle-check{background-position:-208px -192px}.cmb_element .ui-icon-circlesmall-plus{background-position:0 -208px}.cmb_element .ui-icon-circlesmall-minus{background-position:-16px -208px}
95
+ .cmb_element .ui-icon-circlesmall-close{background-position:-32px -208px}.cmb_element .ui-icon-squaresmall-plus{background-position:-48px -208px}.cmb_element .ui-icon-squaresmall-minus{background-position:-64px -208px}
96
+ .cmb_element .ui-icon-squaresmall-close{background-position:-80px -208px}.cmb_element .ui-icon-grip-dotted-vertical{background-position:0 -224px}.cmb_element .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}
97
+ .cmb_element .ui-icon-grip-solid-vertical{background-position:-32px -224px}.cmb_element .ui-icon-grip-solid-horizontal{background-position:-48px -224px}
98
+ .cmb_element .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.cmb_element .ui-icon-grip-diagonal-se{background-position:-80px -224px}.cmb_element .ui-corner-all,.cmb_element .ui-corner-top,.cmb_element .ui-corner-left,.cmb_element .ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}
99
+ .cmb_element .ui-corner-all,.cmb_element .ui-corner-top,.cmb_element .ui-corner-right,.cmb_element .ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}
100
+ .cmb_element .ui-corner-all,.cmb_element .ui-corner-bottom,.cmb_element .ui-corner-left,.cmb_element .ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}
101
+ .cmb_element .ui-corner-all,.cmb_element .ui-corner-bottom,.cmb_element .ui-corner-right,.cmb_element .ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}
102
+ .cmb_element .ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.30;filter:Alpha(Opacity=30)}.cmb_element .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.30;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}
103
+ .cmb_element .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.cmb_element .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}
104
+ .cmb_element .ui-datepicker .ui-datepicker-prev,.cmb_element .ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.cmb_element .ui-datepicker .ui-datepicker-prev-hover,.cmb_element .ui-datepicker .ui-datepicker-next-hover{top:1px}
105
+ .cmb_element .ui-datepicker .ui-datepicker-prev{left:2px}.cmb_element .ui-datepicker .ui-datepicker-next{right:2px}.cmb_element .ui-datepicker .ui-datepicker-prev-hover{left:1px}
106
+ .cmb_element .ui-datepicker .ui-datepicker-next-hover{right:1px}.cmb_element .ui-datepicker .ui-datepicker-prev span,.cmb_element .ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}
107
+ .cmb_element .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.cmb_element .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}
108
+ .cmb_element .ui-datepicker select.ui-datepicker-month-year{width:100%}.cmb_element .ui-datepicker select.ui-datepicker-month,.cmb_element .ui-datepicker select.ui-datepicker-year{width:49%}
109
+ .cmb_element .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.cmb_element .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}
110
+ .cmb_element .ui-datepicker td{border:0;padding:1px}.cmb_element .ui-datepicker td span,.cmb_element .ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}
111
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}
112
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}
113
+ .cmb_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.cmb_element .ui-datepicker.ui-datepicker-multi{width:auto}
114
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group{float:left}.cmb_element .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}
115
+ .cmb_element .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.cmb_element .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.cmb_element .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}
116
+ .cmb_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.cmb_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}
117
+ .cmb_element .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.cmb_element .ui-datepicker-row-break{clear:both;width:100%;font-size:0}.cmb_element .ui-datepicker-rtl{direction:rtl}
118
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.cmb_element .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.cmb_element .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}
119
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}
120
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.cmb_element .ui-datepicker-rtl .ui-datepicker-group{float:right}
121
+ .cmb_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.cmb_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}
122
+ .cmb_element .ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}
123
+ #ui-datepicker-div { z-index: 999999 !important; }
124
+ .ui-datepicker-prev:hover,.ui-datepicker-next:hover { cursor: pointer !important; }
125
+ .wp-picker-holder { position: absolute; }
lib/process/ajax.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ This page gets included from lib.ajax and then processes
4
+ the post. This page should never get called by itself.
5
+ */
6
+ if(!empty($_POST)
7
+ && isset($_POST['form_action']))
8
+ {
9
+ switch($_POST['form_action'])
10
+ {
11
+
12
+
13
+
14
+ default:
15
+ echo '-1';
16
+ break;
17
+
18
+ case 'update_options':
19
+ $action = $timelineExpressBase->updateOptions($_POST);
20
+ if($action)
21
+ {
22
+ echo '1';
23
+ }
24
+ else echo '-1';
25
+ break;
26
+
27
+ case 'update_debug_options':
28
+ $action = $timelineExpressBase->updateDebugOptions($_POST);
29
+ if($action)
30
+ {
31
+ echo '1';
32
+ }
33
+ else echo '-1';
34
+ break;
35
+
36
+ case 'yks_mc_reset_plugin_settings':
37
+ $validate_action = $timelineExpressBase->resetPluginSettings($_POST);
38
+ break;
39
+
40
+ }
41
+ }
42
+ ?>
lib/single-announcement-template/how_to_readme.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ By default Timeline Express uses the single-timeline-epxress-announcement.php template file to display all single announcements.
2
+
3
+ If you would like further control in customizing the template, you can copy the template file 'single-timeline-express-announcement.php'
4
+ (located in /timeline-express/lib/single-announcement-template/single-timeline-express-announcement) into your active theme directory root.
5
+
6
+ Timeline Express will then load the template file in place of the default one. You can make any adjustments you would like without fear of
7
+ losing your changes on plugin updates.
lib/single-announcement-template/single-timeline-express-announcement.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The template for displaying single announcements
4
+ * from Timeline Express
5
+ *
6
+ * This page template requires Timeline Express to be installed
7
+ */
8
+
9
+ get_header();
10
+
11
+ global $timelineExpressBase;
12
+
13
+ $timelineExpressBase->addStyles_frontend();
14
+
15
+ ?>
16
+
17
+ <div id="primary" class="site-content">
18
+ <div id="content" role="main">
19
+
20
+ <?php while ( have_posts() ) : the_post(); ?>
21
+
22
+ <?php get_template_part( 'content', 'page' ); ?>
23
+
24
+ <?php endwhile; // end of the loop. ?>
25
+
26
+ </div><!-- #content -->
27
+ </div><!-- #primary -->
28
+
29
+ <?php get_sidebar(); ?>
30
+ <?php get_footer(); ?>
license.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
pages/options.php ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // getting our variables to pass into
3
+ // our donation link
4
+ $current_user_object = wp_get_current_user();
5
+ $current_user_name = $current_user_object->user_firstname;
6
+ $current_user_name .= ' ' . $current_user_object->user_lastname;
7
+ ?>
8
+ <script type="text/javascript">
9
+ jQuery(document).ready(function ($) {
10
+
11
+ // ajax save the WordPress Plugin Options Page
12
+ // Form Options Page
13
+ $('#timeline-express-form').submit(function (e) {
14
+ tinyMCE.triggerSave();
15
+ $('#timeline-express-status').slideUp('fast');
16
+ $.ajax({
17
+ type: 'POST',
18
+ url: ajaxurl,
19
+ data: {
20
+ action: 'timeline_express_settings_form',
21
+ form_action: 'update_options',
22
+ form_data: $('#timeline-express-form').serialize()
23
+ },
24
+ dataType: 'json',
25
+ success: function (RESPONSE) {
26
+ if (RESPONSE == '1') {
27
+ $('#timeline-express-status').html('<div class=updated><p><?php _e('The options were saved successfully!', 'plugin-boilerplate'); ?></p></div>');
28
+ $('#timeline-express-status').slideDown('fast');
29
+ } else {
30
+ $('#timeline-express-status').html("<div class=error><p><?php _e("The options could not be saved (or you did not change them).", "plugin-boilerplate"); ?></p></div>");
31
+ $('#timeline-express-status').slideDown('fast');
32
+ console.log(RESPONSE);
33
+ }
34
+ },
35
+ error : function(RESPONSE) {
36
+ console.log(RESPONSE.responseText);
37
+ }
38
+ });
39
+ e.preventDefault();
40
+ });
41
+
42
+
43
+ // Reset Plugin Ajax Request
44
+ $('#timeline-express-reset-plugin-settings').click(function(e) {
45
+ $("<div id='timeline_express_reset_plugin_settings'><div class='dashicons dashicons-dismiss'></div><p><?php _e("Are you sure you want to revert 'Timeline Express' settings? This cannot be undone.", "plugin-boilerplate" ); ?></p></div>").dialog({
46
+ title : "Revert Settings?",
47
+ buttons : {
48
+ "Yes" : function() {
49
+ $.ajax({
50
+ type: 'POST',
51
+ url: ajaxurl,
52
+ data: {
53
+ action: 'timeline_express_settings_form',
54
+ form_action: 'timeline_express_reset_plugin_settings'
55
+ },
56
+ dataType: 'json',
57
+ success: function () {
58
+ $( "#timeline_express_reset_plugin_settings" ).html('<p><?php _e("Timeline Express settings have successfully been reset", "plugin-boilerplate" ); ?></p><span class="timeline-express-reset-plugin-settings-preloader-container"><img class="timeline-express-reset-plugin-settings-preloader" src="<?php echo plugin_dir_url(__FILE__).'../images/preloader.gif'; ?>" alt="preloader" /></span>');
59
+ $( "#timeline_express_reset_plugin_settings" ).next().hide();
60
+ $( "#timeline_express_reset_plugin_settings" ).prev().text("Success!");
61
+ setTimeout(function() {
62
+ location.reload();
63
+ }, 2000);
64
+ },
65
+ error: function() {
66
+ alert('Error resetting plugin settings. If the error persists, uninstall and reinstall the plugin to reset your options.');
67
+ }
68
+ });
69
+ },
70
+ "Cancel" : function() {
71
+ $(this).dialog("close");
72
+ }
73
+ },
74
+ modal: true,
75
+ resizable: false
76
+ });
77
+ e.preventDefault();
78
+ });
79
+
80
+ });
81
+
82
+
83
+ function changeRandomTrimLengthCheckbox() {
84
+ var newOptinValue = jQuery('input[name="excerpt-random-length"]').prop('checked');
85
+ if ( newOptinValue == '1' ) {
86
+ jQuery('input[name="excerpt-trim-length"]').fadeOut('fast',function() {
87
+ jQuery('input[name="excerpt-random-length"]').css('margin-left','0em');
88
+ });
89
+ jQuery('#random-lenth-text-container').removeClass('random-length-text');
90
+ } else {
91
+ jQuery('input[name="excerpt-random-length"]').css('margin-left','.5em');
92
+ jQuery('input[name="excerpt-trim-length"]').fadeIn('fast');
93
+ jQuery('#random-lenth-text-container').addClass('random-length-text');
94
+ }
95
+ }
96
+ // toggle delete post checkbox text
97
+ function toggleDeleteCheckClass() {
98
+ var deletePostsCheckboxValue = jQuery('input[name="delete-announcement-posts-on-uninstallation"]').prop('checked');
99
+ if ( deletePostsCheckboxValue == true ) {
100
+ jQuery('.delete-no').addClass('delete-yes');
101
+ jQuery('.delete-yes').removeClass('delete-no');
102
+ } else {
103
+ jQuery('.delete-yes').addClass('delete-no');
104
+ jQuery('.delete-no').removeClass('delete-yes');
105
+ }
106
+ }
107
+
108
+ function toggle_delete_checkbox() {
109
+ var deletePostsCheckboxValue = jQuery('input[name="delete-announcement-posts-on-uninstallation"]').prop('checked');
110
+ if ( deletePostsCheckboxValue == false ) {
111
+ jQuery('.delete-no').addClass('delete-yes');
112
+ jQuery('.delete-yes').removeClass('delete-no');
113
+ jQuery('input[name="delete-announcement-posts-on-uninstallation"]').attr('checked',true);
114
+ } else {
115
+ jQuery('.delete-yes').addClass('delete-no');
116
+ jQuery('.delete-no').removeClass('delete-yes');
117
+ jQuery('input[name="delete-announcement-posts-on-uninstallation"]').attr('checked',false);
118
+ }
119
+ }
120
+ </script>
121
+
122
+ <!-- get and store our api key option -->
123
+ <?php
124
+ // set up the options for our WYSIWYG editors
125
+ // for the optin messages
126
+ $no_event_messages_parameters = array(
127
+ 'teeny' => true,
128
+ 'textarea_rows' => 15,
129
+ 'tabindex' => 1,
130
+ 'textarea_name' => 'no-events-message',
131
+ 'drag_drop_upload' => true
132
+ );
133
+
134
+ // used to dictate the active tab
135
+ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'settings';
136
+ ?>
137
+ <div class="wrap">
138
+
139
+ <!-- evan herman logo on all settings pages -->
140
+ <div id="timeline_express_review_this_plugin_container">
141
+ <a href="http://www.evan-herman.com/contact/?contact-name=<?php echo $current_user_name; ?>&contact-reason=I want to make a donation for all your hard work" target="_blank" title="Cosnider Making a Donation For Continued Support">
142
+ <span class="timeline_express_need_support">
143
+ <strong>
144
+ <?php _e( 'Please Consider', 'plugin-boilerplate' ); ?> <br />
145
+ <?php _e( 'Making a Donation', 'plugin-boilerplate' ); ?> <br />
146
+ <div class="fa fa-paypal"></div>
147
+ </strong>
148
+ </span>
149
+ </a>
150
+ <a href="https://wordpress.org/support/plugin/timeline-express" target="_blank" title="Timeline Express Support">
151
+ <span class="timeline_express_need_support">
152
+ <strong>
153
+ <?php _e( 'Need Help?', 'plugin-boilerplate' ); ?> <br />
154
+ <?php _e( 'Get Support Now!', 'plugin-boilerplate' ); ?> <br />
155
+ <div class="dashicons dashicons-plus-alt"></div>
156
+ </strong>
157
+ </span>
158
+ </a>
159
+ <a href="http://wordpress.org/support/view/plugin-reviews/timeline-express" target="_blank" title="Review Timeline Express">
160
+ <span class="timeline_express_leave_us_a_review">
161
+ <strong>
162
+ <?php _e( 'Loving the plugin?', 'plugin-boilerplate' ); ?> <br />
163
+ <?php _e( 'Leave us a nice review', 'plugin-boilerplate' ); ?> <br />
164
+ <div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div><div class="dashicons dashicons-star-filled"></div>
165
+ </strong>
166
+ </span>
167
+ </a>
168
+ <a href="http://www.Evan-Herman.com" target="_blank" class="timeline_express_header_logo" style="margin-top:10px;">
169
+ <img src="<?php echo TIMELINE_EXPRESS_URL . 'images/evan_herman_logo.png'; ?>" alt="Evan Herman" width=65 title="Evan Herman" />
170
+ </a>
171
+ </div>
172
+
173
+ <!-- tabs -->
174
+ <h2 class="nav-tab-wrapper">
175
+ <a href="?post_type=te_announcements&page=timeline-express-settings&tab=settings" class="nav-tab <?php echo $active_tab == 'settings' ? 'nav-tab-active' : ''; ?>"><?php _e('Timeline Express','plugin-boilerplate'); ?></a>
176
+ </h2>
177
+
178
+ <h2 id="timeline-express-page-header">
179
+ <div id="timeline-express-icon" class="icon32"></div><?php _e('Timeline Express Settings','plugin-boilerplate'); ?>
180
+ </h2>
181
+
182
+ <div class="timeline-express-status" id="timeline-express-status"></div>
183
+
184
+ <?php if ( $active_tab == 'settings' ) { ?>
185
+
186
+
187
+ <form method="post" name="timeline-express-form" id="timeline-express-form">
188
+ <table class="form-table timeline-express-form">
189
+ <tbody>
190
+
191
+ <!-- Timeline Express Title -->
192
+ <tr valign="top">
193
+ <th scope="row"><label for="timeline-title"><?php _e('Timeline Title','plugin-boilerplate'); ?></label></th>
194
+ <td>
195
+ <input name="timeline-title" type="text" id="timeline-title" value="<?php echo stripslashes( $this->timeline_express_optionVal['timeline-title'] ); ?>" class="regular-text" />
196
+ <select name="timeline-title-alignment" id="timeline-title-alignment" class="regular-text" style="height:27px; margin-top:-3px;" />
197
+ <option value="left"<?php echo ($this->timeline_express_optionVal['timeline-title-alignment'] === 'left' ? ' selected' : ''); ?>><?php _e('Left','plugin-boilerplate'); ?></option>
198
+ <option value="center"<?php echo ($this->timeline_express_optionVal['timeline-title-alignment'] === 'center' ? ' selected' : ''); ?>><?php _e('Center','plugin-boilerplate'); ?></option>
199
+ <option value="right"<?php echo ($this->timeline_express_optionVal['timeline-title-alignment'] === 'right' ? ' selected' : ''); ?>><?php _e('Right','plugin-boilerplate'); ?></option>
200
+ </select>
201
+ <select name="timeline-title-size" id="timeline-title-size" class="regular-text" style="height:27px; margin-top:-3px;" />
202
+ <option value="h1"<?php echo ($this->timeline_express_optionVal['timeline-title-size'] === 'h1' ? ' selected' : ''); ?>><?php _e('H1','plugin-boilerplate'); ?></option>
203
+ <option value="h2"<?php echo ($this->timeline_express_optionVal['timeline-title-size'] === 'h2' ? ' selected' : ''); ?>><?php _e('H2','plugin-boilerplate'); ?></option>
204
+ <option value="h3"<?php echo ($this->timeline_express_optionVal['timeline-title-size'] === 'h3' ? ' selected' : ''); ?>><?php _e('H3','plugin-boilerplate'); ?></option>
205
+ <option value="h4"<?php echo ($this->timeline_express_optionVal['timeline-title-size'] === 'h4' ? ' selected' : ''); ?>><?php _e('H4','plugin-boilerplate'); ?></option>
206
+ </select>
207
+ </td>
208
+ </tr>
209
+ <!-- Timeline Express Title -->
210
+ <tr>
211
+ <td></td>
212
+ <td class="timeline-express-settings-description">
213
+ <?php _e('Enter the title for the time line // Select the alignment // Select the font size','plugin-boilerplate'); ?><br />
214
+ </td>
215
+ </tr>
216
+ <!-- Preferred Form Layout (table or div) -->
217
+ <tr valign="top">
218
+ <th scope="row"><label for="announcement-time-frame"><?php _e('Time Frame','plugin-boilerplate'); ?></label></th>
219
+ <td>
220
+ <select name="announcement-time-frame" id="announcement-time-frame" class="regular-text" />
221
+ <option value="0"<?php echo ($this->timeline_express_optionVal['announcement-time-frame'] === '0' ? ' selected' : ''); ?>><?php _e('Future Events','plugin-boilerplate'); ?></option>
222
+ <option value="1"<?php echo ($this->timeline_express_optionVal['announcement-time-frame'] === '1' ? ' selected' : ''); ?>><?php _e('All Events (past+future)','plugin-boilerplate'); ?></option>
223
+ <option value="2"<?php echo ($this->timeline_express_optionVal['announcement-time-frame'] === '2' ? ' selected' : ''); ?>><?php _e('Past Events','plugin-boilerplate'); ?></option>
224
+ </select>
225
+ </td>
226
+ </tr>
227
+ <tr>
228
+ <td></td>
229
+ <!-- Query Time Description -->
230
+ <td class="timeline-express-settings-description">
231
+ <?php _e('Select the time frame to query events from.','plugin-boilerplate'); ?>
232
+ </td>
233
+ </tr>
234
+ <!-- Excerpt Trim Length -->
235
+ <tr valign="top">
236
+ <th scope="row"><label for="excerpt-trim-length"><?php _e('Announcement Exceprt Length','plugin-boilerplate'); ?></label></th>
237
+ <td>
238
+ <input <?php if( $this->timeline_express_optionVal['excerpt-random-length'] == '1' ) { ?> style="display:none;" <?php } ?> type="number" name="excerpt-trim-length" min="25" max="200" value="<?php echo $this->timeline_express_optionVal['excerpt-trim-length']; ?>"><label for="excerpt-random-length"><input type="checkbox" id="excerpt-random-length" name="excerpt-random-length" onclick="changeRandomTrimLengthCheckbox();" value="1" <?php checked( $this->timeline_express_optionVal['excerpt-random-length'] , '1' ); ?> <?php if( $this->timeline_express_optionVal['excerpt-random-length'] == '0' ) { ?> style="margin-left:.5em;" <?php } ?>><span id="random-lenth-text-container"<?php if( $this->timeline_express_optionVal['excerpt-random-length'] == '0' ) { ?> class="random-length-text" <?php } ?>>random length</label></span>
239
+ </td>
240
+ </tr>
241
+ <tr>
242
+ <td></td>
243
+ <!-- Excerpt Trim Length Description -->
244
+ <td class="timeline-express-settings-description">
245
+ <?php _e('set the length of the excerpt for each announcement. ( min=25;max=200 eg: 50 = 50 characters )','plugin-boilerplate'); ?>
246
+ </td>
247
+ </tr>
248
+ <!-- Toggle Date Visibility -->
249
+ <tr valign="top">
250
+ <th scope="row"><label for="date-visibility"><?php _e('Date Visibility','plugin-boilerplate'); ?></label></th>
251
+ <td>
252
+ <select name="date-visibility" id="date-visibility" class="regular-text" />
253
+ <option value="1"<?php echo ($this->timeline_express_optionVal['date-visibility'] === '1' ? ' selected' : ''); ?>><?php _e('Visible','plugin-boilerplate'); ?></option>
254
+ <option value="0"<?php echo ($this->timeline_express_optionVal['date-visibility'] === '0' ? ' selected' : ''); ?>><?php _e('Hidden','plugin-boilerplate'); ?></option>
255
+ </select>
256
+ </td>
257
+ </tr>
258
+ <tr>
259
+ <td></td>
260
+ <!-- Toggle Date Visibility Description -->
261
+ <td class="timeline-express-settings-description">
262
+ <?php _e('toggle the visibility of the date next to the icon.','plugin-boilerplate'); ?>
263
+ </td>
264
+ </tr>
265
+ <!-- Toggle Read Visibility More -->
266
+ <tr valign="top">
267
+ <th scope="row"><label for="read-more-visibility"><?php _e('Read More Visibility','plugin-boilerplate'); ?></label></th>
268
+ <td>
269
+ <select name="read-more-visibility" id="read-more-visibility" class="regular-text" />
270
+ <option value="1" <?php selected( $this->timeline_express_optionVal['read-more-visibility'] , '1' ); ?>><?php _e('Visible','plugin-boilerplate'); ?></option>
271
+ <option value="0" <?php selected( $this->timeline_express_optionVal['read-more-visibility'] , '0' ); ?>><?php _e('Hidden','plugin-boilerplate'); ?></option>
272
+ </select>
273
+ </td>
274
+ </tr>
275
+ <tr>
276
+ <td></td>
277
+ <!-- Toggle Read More Visibility Description -->
278
+ <td class="timeline-express-settings-description">
279
+ <?php _e('toggle the visibility of the read more button. hide to prevent users from viewing the full announcement.','plugin-boilerplate'); ?>
280
+ </td>
281
+ </tr>
282
+ <tr valign="top">
283
+ <!-- Default Announcement Icon -->
284
+ <th scope="row"><label for="default-announcement-icon"><?php _e('Default Icon','plugin-boilerplate'); ?></label></th>
285
+ <td>
286
+ <input name="default-announcement-icon" type="text" id="default-announcement-icon" value="<?php echo $this->timeline_express_optionVal['default-announcement-icon']; ?>" class="regular-text" />
287
+ </td>
288
+ </tr>
289
+ <tr>
290
+ <td></td>
291
+ <!-- Default Announcement Icon Description -->
292
+ <td class="timeline-express-settings-description">
293
+ <?php _e('Enter the font-awesome class name that you would like to use a default icon for new events. ie: fa-clock-alt','plugin-boilerplate'); ?> <a href="http://fortawesome.github.io/Font-Awesome/cheatsheet/" target="_blank" style="font-size:12px;font-style:em;">cheat sheet</a>
294
+ </td>
295
+ </tr>
296
+ <tr valign="top">
297
+ <!-- Default Announcement Color -->
298
+ <th scope="row"><label for="default-announcement-color"><?php _e('Default Announcement Color','plugin-boilerplate'); ?></label></th>
299
+ <td>
300
+ <input name="default-announcement-color" type="text" id="default-announcement-color" value="<?php echo $this->timeline_express_optionVal['default-announcement-color']; ?>" class="regular-text color-picker-field" />
301
+ </td>
302
+ </tr>
303
+ <tr>
304
+ <td></td>
305
+ <!-- Default Announcement Color -->
306
+ <td class="timeline-express-settings-description">
307
+ <?php _e('Select the default color for all new events. Note : this setting can be overwritten','plugin-boilerplate'); ?>
308
+ </td>
309
+ </tr>
310
+ <tr valign="top">
311
+ <!-- Single Announcement Container Background -->
312
+ <th scope="row"><label for="announcement-bg-color"><?php _e('Announcement Container Background','plugin-boilerplate'); ?></label></th>
313
+ <td>
314
+ <input type="text" name="announcement-bg-color" class="color-picker-field" value="<?php echo $this->timeline_express_optionVal['announcement-bg-color']; ?>" />
315
+ </td>
316
+ </tr>
317
+ <tr>
318
+ <td></td>
319
+ <!-- Custom Interest Group Label Description -->
320
+ <td class="timeline-express-settings-description">
321
+ <?php _e('Select the background color of the announcement container.','plugin-boilerplate'); ?>
322
+ </td>
323
+ </tr>
324
+ <tr valign="top">
325
+ <!-- Single Announcement Box Shadow Color -->
326
+ <th scope="row"><label for="announcement-box-shadow-color"><?php _e('Announcement Shadow Color','plugin-boilerplate'); ?></label></th>
327
+ <td>
328
+ <input type="text" name="announcement-box-shadow-color" class="color-picker-field" value="<?php echo $this->timeline_express_optionVal['announcement-box-shadow-color']; ?>" />
329
+ </td>
330
+ </tr>
331
+ <tr>
332
+ <td></td>
333
+ <!-- Custom Interest Group Label Description -->
334
+ <td class="timeline-express-settings-description">
335
+ <?php _e('Select the shadow color for the announcement container.','plugin-boilerplate'); ?>
336
+ </td>
337
+ </tr>
338
+ <tr valign="top">
339
+ <!-- Background Line Color -->
340
+ <th scope="row"><label for="announcement-background-line-color"><?php _e('Background Line Color','plugin-boilerplate'); ?></label></th>
341
+ <td>
342
+ <input type="text" name="announcement-background-line-color" class="color-picker-field" value="<?php echo $this->timeline_express_optionVal['announcement-background-line-color']; ?>" />
343
+ </td>
344
+ </tr>
345
+ <tr>
346
+ <td></td>
347
+ <!-- Background Line Color Description -->
348
+ <td class="timeline-express-settings-description">
349
+ <?php _e('Select the color of the line in the background of the timeline.','plugin-boilerplate'); ?>
350
+ </td>
351
+ </tr>
352
+ <tr valign="top">
353
+ <!-- No Events Message -->
354
+ <th scope="row"><label for="no-events-message"><?php _e('No Events Message','plugin-boilerplate'); ?></label></th>
355
+ <td>
356
+ <?php wp_editor( stripslashes( $this->timeline_express_optionVal['no-events-message'] ) , 'no-events-message', $no_event_messages_parameters); ?>
357
+ </td>
358
+ </tr>
359
+ <tr>
360
+ <td></td>
361
+ <!-- No Events Message Description -->
362
+ <td class="timeline-express-settings-description">
363
+ <em><?php _e('This is the message that will display when no announcements are found.','plugin-boilerplate'); ?></em>
364
+ </td>
365
+ </tr>
366
+ <tr valign="top">
367
+ <!-- Background Line Color -->
368
+ <th scope="row"><label for="delete-announcement-posts-on-uninstallation"><?php _e('Delete Announcements On Uninstall?','plugin-boilerplate'); ?></label></th>
369
+ <td>
370
+ <input type="checkbox" name="delete-announcement-posts-on-uninstallation" onclick="toggleDeleteCheckClass();" <?php checked( $this->timeline_express_optionVal['delete-announcement-posts-on-uninstallation'] , '1' ); ?> value="1" /><span class="<?php if( $this->timeline_express_optionVal['delete-announcement-posts-on-uninstallation'] == '0' ) { ?> delete-no <?php } else { ?> delete-yes <?php } ?>" onclick="toggle_delete_checkbox();"></span>
371
+ </td>
372
+ </tr>
373
+ <tr>
374
+ <td></td>
375
+ <!-- Background Line Color Description -->
376
+ <td class="timeline-express-settings-description">
377
+ <?php _e('select this to delete all announcement posts from the data base on plugin uninstallation. this can not be undone, once they are deleted they are gone forever. If you want to keep them, export your announcements before uninstalling.','plugin-boilerplate'); ?>
378
+ </td>
379
+ </tr>
380
+ <tr>
381
+ <td></td>
382
+ <td><input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e( 'Save Settings' , 'plugin-boilerplate' ); ?>"><input type="submit" name="timeline-express-reset-plugin-settings" id="timeline-express-reset-plugin-settings" class="button timeline-express-red-button" value="<?php _e( 'Reset Plugin Settings' , 'plugin-boilerplate' ); ?>"></td>
383
+ </tr>
384
+
385
+ </tbody>
386
+ </table>
387
+ </form>
388
+
389
+ <?php } ?>
390
+
391
+ </div>
392
+ <!-- end Timeline Express settings page -->
pages/welcome.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //
3
+ // Welcome Page Template
4
+ // Users are redirected here upon activation
5
+ //
6
+
7
+ $current_user_object = wp_get_current_user();
8
+ $current_user_name = $current_user_object->user_firstname;
9
+ $current_user_name .= ' ' . $current_user_object->user_lastname;
10
+
11
+ ?>
12
+ <script>
13
+ jQuery(document).ready(function() {
14
+ jQuery(window).resize(function() {
15
+ var window_width = jQuery(window).width();
16
+ console.log(window_width);
17
+ var height = jQuery( '.slides' ).css('height');
18
+ var new_height = parseFloat( '.40' ) * parseInt( window_width );
19
+ console.log(new_height);
20
+ jQuery( '.slides' ).css('height',new_height+'px');
21
+ jQuery( '.slides' ).find('li').find('div').css('height',new_height+'px');
22
+ });
23
+ });
24
+ </script>
25
+ <!-- used for the media query -->
26
+ <meta name="viewport" content="width=device-width" />
27
+
28
+ <div class="wrap yksme-page-about">
29
+
30
+ <div id="ykseme-icon" class="icon32"></div>
31
+
32
+ <div id="welcome-page-content" class="col-md-9">
33
+
34
+ <!-- Brand and toggle get grouped for better mobile display -->
35
+ <div class="navbar-header">
36
+
37
+ <a href="http://www.Evan-Herman.com" target="_blank" class="timeline_express_header_logo" style="margin-top:10px; float:right; margin-right:15px;">
38
+ <img src="<?php echo TIMELINE_EXPRESS_URL . 'images/evan_herman_logo.png'; ?>" alt="Evan Herman" width=65 title="Evan Herman" />
39
+ </a>
40
+
41
+ <h1 id="timeline-express-page-header">
42
+ <div id="timeline-express-icon" class="icon32"></div><?php _e('Welcome to Timeline Express','timeline-express'); ?> v<?php echo TIMELINE_EXPRESS_VERSION_CURRENT; ?>
43
+ </h1>
44
+
45
+ <p style="font-size:20px;"><?php _e( "Thanks for installing Timeline Express. We know you're going to find this free plugin super helpful and easy to use! To get started, hover over 'Timeline Express', in the admin menu, and click" , "timeline-express" ); ?> <a href="<?php echo admin_url(); ?>post-new.php?post_type=te_announcements"><?php _e( "'New Announcement'" , "timeline-express" ); ?></a><?php _e( " to start adding announcements your timeline!" , "timeline-express" ); ?></p>
46
+
47
+ <p style="font-size:20px;"><?php _e( 'or head over to the' , 'timeline-express' ); ?> <a class="button-secondary" href="<?php echo admin_url(); ?>options-general.php?page=timeline-express-settings"><?php _e( "Settings Page" , "timeline-express" ); ?></a> <?php _e( 'to customize and style your form' , 'timeline-express' ); ?></p>
48
+
49
+ </div>
50
+
51
+ <hr />
52
+
53
+ <div class="row">
54
+
55
+ <div class="col-md-6 timeline-screenshot">
56
+ <h2><?php _e( 'Create a Beautiful Timeline In Minutes' , 'timeline-express' ); ?></h2>
57
+ <p><?php _e( 'Create a vertical and responsive, CSS3 animated timeline fast...without ever writing a single line of code.' , 'timeline-express' ); ?></p>
58
+
59
+ <div class="font-awesome-background">
60
+ <h1 style="width:350px;display:block;margin:0 auto;line-height:1;margin-bottom:2em;background:#F1F1F1;padding:.5em;"><?php _e( 'Font Awesome Included' , 'timeline-express' ); ?></h1>
61
+ <p style="display:block;background:#F1F1F1;padding:.5em;font-size:18px;"><em><?php _e( 'Hundreds of icons to choose from to make your announcements really stand out!' , 'timeline-express' ); ?></em></p>
62
+ </div>
63
+
64
+ <hr />
65
+
66
+ <div class="slides">
67
+ <ul>
68
+ <li>
69
+ <div class="intuitive-post-creation"></div>
70
+ <h2 class="promo-text"><?php _e( 'Intuitive Custom Post Creation Screen' , 'timeline-express' ); ?></h2>
71
+ </li>
72
+ <li>
73
+ <div class="admin-manage-announcements"></div>
74
+ <h2 class="promo-text"><?php _e( 'Manange Announcements Easily' , 'timeline-express' ); ?></h2>
75
+ </li>
76
+ <li>
77
+ <div class="customize-your-timeline"></div>
78
+ <h2 class="promo-text"><?php _e( 'Stylize The Timeline' , 'timeline-express' ); ?></h2>
79
+ </li>
80
+ </ul>
81
+ </div>
82
+
83
+ <hr style="margin-bottom:0;" />
84
+
85
+ <div class="timeline-express-image">
86
+ <h2 style="display:block;text-align:center;padding-top:4em;"><?php _e( 'Timeline Express // Sample Timeline' , 'timeline-express' ); ?></h2><img style="width:60%;display:block;margin:0 auto;padding-top:1em;" src="<?php echo TIMELINE_EXPRESS_URL . 'images/welcome/timeline-screenshot.png'; ?>" alt="Sample Timeline Express" title="Timeline Express Example" >
87
+ </div>
88
+
89
+ <hr style="margin-top:0;" />
90
+
91
+ </div>
92
+
93
+ </div>
94
+
95
+
96
+ <div id="welcome-page-sidebar" class="col-md-3">
97
+
98
+ <em><?php _e( 'this free plugin was made with' , 'timeline-express' ); ?><div class="dashicons dashicons-heart"></div>, <?php _e( 'by' , 'timeline-express' ); ?> <a href="http://www.evan-herman.com" target="_blank">Evan Herman</a></em><span style="float:right;"><?php _e( 'Please consider making a' , 'timeline-express' ); ?> <a href="http://www.evan-herman.com/contact/?contact-name=<?php echo $current_user_name; ?>&contact-reason=I want to make a donation for all your hard work" target="_blank"><?php _e( 'donation' , 'timeline-express' ); ?></a> <?php _e( 'if you need support in any way.' , 'timeline-express' ); ?></span>
99
+ <hr />
100
+
101
+ <div class="social-media-buttons" style="height:40px;">
102
+ <strong style="display:inline-block;float:left;margin-top:10px;font-size:16px;"><?php _e( 'Keep Up With Me Elsewhere ' , 'timeline-express' ); ?>:</strong>
103
+ <span style="display:inline-block;width:115px; margin-left:15px;margin-top:5px;">
104
+ <a href="http://facebook.com/yikesinc" title="WordPress" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/wordpress-icon.png" style="border: 0px none;" alt="Evan Herman - WordPress Profile" height="24" width="24"></a>
105
+ <a href="http://twitter.com/evanmherman" title="Twitter" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/twitter.png" style="border: 0px none;" alt="Evan Herman - Twitter Profile" height="24" width="24"></a>
106
+ <a href="https://www.linkedin.com/profile/view?id=46246110" title="Linkedin" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/linkedin.png" alt="Evan Herman - LinkedIn Profile" border="0" height="24" width="24"></a>
107
+ <a href="http://www.evan-herman.com/feed/" title="RSS Feed" target="_blank" class="evan_herman_about_icon"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/rss_icon.png" alt="Evan Herman - RSS Feed" border="0" height="24" width="24"></a>
108
+ </span>
109
+ <a style="float:right;" href="http://www.evan-herman.com" title="EH Development Shop" target="_blank"><img src="<?php echo TIMELINE_EXPRESS_URL; ?>/images/evan_herman_logo.png" alt="Evan Herman" class="timeline_express_header_logo" /></a>
110
+ </div>
111
+
112
+
113
+ </div>
114
+
115
+ </div>
readme.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Timeline Express ===
2
+ Contributors: eherman24
3
+ Donate link: http://www.evan-herman.com/contact/?contact-reason=I%20want%20to%20make%20a%20donation%20for%20all%20your%20hard%20work
4
+ Tags: vertical, timeline, animated, css3, animations, evan, herman, evan herman, easy, time, line, font awesome, font, awesome, announcements, notifications, simple, events, calendar, scroll, triggered, scrolling, animated, fade, in, fade in
5
+ Requires at least: 3.9
6
+ Tested up to: 4.0
7
+ Stable tag: 1.0
8
+ License: GPLv2 or later
9
+
10
+ Timeline express allows you to create a beautiful vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
11
+
12
+ == Description ==
13
+
14
+ Timeline express allows you to create a vertical animated timeline of announcement posts , without writing a single line of code. You simply create the 'announcement' posts, set the announcement date and publish. The timeline will populate automatically in chronological order, based on the announcement date. Easily limit the announcements displayed to Upcoming announcements, past announcements or simply display all of them.
15
+
16
+ **Features**
17
+
18
+ * Hundreds of Font awesome icons included. Specify a different icon for each announcement
19
+ * CSS3 animations on scroll
20
+ * Set the color of the announcement
21
+ * Specify the length to trim each announcemnt, or randomize it
22
+ * Hide the date of the announcement
23
+ * Hide the 'read more' button for each announcement
24
+ * Specify an image to display for each announcement
25
+ * Delete announcements on uninstallation (so no orphan posts are hanging around in your database)
26
+ * Easy to use shortcode to place the timeline wherever your heart desires ( `[timeline-express]` )
27
+ * TinyMCE button to generate the shortcode
28
+ * Highly extensible
29
+ * Translatable
30
+
31
+ == Installation ==
32
+
33
+ 1. Download the plugin .zip file
34
+ 2. Log in to yourdomain.com/wp-admin
35
+ 3. Click Plugins -> Add New -> Upload
36
+ 4. Activate the plugin
37
+ 6. On the left hand menu, hover over 'Timeline Express' and click 'New Announcement'
38
+ 7. Begin populating the timeline with events. (Note: Events will appear in chronological order according to the <strong>announcement date</strong>)
39
+ 8. Once you have populated the timeline, head over to the settings page (Settings > Timeline Express) to customize your timeline.
40
+ 9. Create a new page, and enter the shortcode [timeline-express] to display the vertical timeline (Note: Timeline Express displays best on full width pages)
41
+
42
+ == Frequently Asked Questions ==
43
+
44
+ = How do I use this plugin? =
45
+ Begin by simply installing the plugin. Once the plugin has been installed, go ahead and begin creating announcement posts. You'll find a new menu item just below 'Posts'.
46
+ After you have a substantial number of announcements set up, you're ready to display the timeline on the front end of your site.
47
+
48
+ Timeline express displays best on full width pages, but is not limited to them. Create a new page, and drop the shortcode into the page - `[timeline-express]`.
49
+ Publish your page, and view it on the front end the see your new super sweet timeline! (scroll for animation effects!)
50
+
51
+ = What template is the single announcement post using? Can I customize it at all? I want to do x, y or z. =
52
+ The single announcement post is using a custom template file that comes pre-bundled with the plugin. If you want to customize the template for whatever reason
53
+ you can do so, by creating a directory in your active theme called 'timeline-express'. Once the directory is created, simply copy the file titled 'single-timeline-express-announcement.php' into
54
+ the newly created 'timeline-express' directory in your theme. Timeline express will then automagically pull in the newly created template in your theme root. You can go ahead and customize
55
+ it to your hearts desire without fear of losing any changes in future updates!
56
+
57
+ = Can I create more than one timeline? =
58
+ At the moment no, but I will consider adding that into a future update if people show enough interest.
59
+
60
+ = At what width are the breakpoints set? =
61
+ Breakpoints are set at 822px. The timeline will shift/re-adjust automatically using masonry based on the height of each announcement container.
62
+
63
+ = How can I translate this plugin? =
64
+ The text-domain for all gettext functions is `timeline-express`.
65
+
66
+ If you enjoy this plugin and want to contribute, I'm always looking for people to help translate the plugin into any of the following languages, credit will be given where credit is due :
67
+
68
+ * Arabic
69
+ * Chinese
70
+ * English
71
+ * French
72
+ * German
73
+ * Greek
74
+ * Hebrew
75
+ * Hindi
76
+ * Hong Kong
77
+ * Italian
78
+ * Japanese
79
+ * Korean
80
+ * Persian
81
+ * Portuguese (Brazilian)
82
+ * Portuguese (European)
83
+ * Romanian
84
+ * Russian
85
+ * Spanish
86
+ * Swedish
87
+ * Taiwanese
88
+ * Tamil
89
+ * Urdu
90
+ * Vietnamese
91
+ * Welsh
92
+
93
+ Read the Codex article "[I18n for WordPress Developers]"(http://codex.wordpress.org/I18n_for_WordPress_Developers) for more information.
94
+
95
+ == Future Ideas ==
96
+
97
+ Have an idea for a future release feature? I love hearing about new ideas! You can get in contact with me through the contact form on my website, <a href="http://www.evan-herman.com/contact/" target="_blank">Evan-Herman.com</a>.
98
+
99
+ == Screenshots ==
100
+
101
+ 1. Timeline Express announcement post creation screen
102
+ 2. Timeline Express announcement management on the 'Edit Announcements' page
103
+ 3. Timeline Express sample timeline with multiple icons/colors
104
+ 4. Timeline Express responsive (mobile version)
105
+ 5. Timeline Express full settings page
106
+
107
+ == Changelog ==
108
+ = 1.0.0 =
109
+ * Initial Release to the wordpress respository
110
+
111
+ == Upgrade Notice ==
112
+
113
+ = 1.0.0 =
114
+ * Initial Release to the wordpress respository
timeline-express.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ #_________________________________________________ PLUGIN
4
+ Plugin Name: Timeline Express
5
+ Plugin URI: http://www.evan-herman.com
6
+ Description: Create a beautiful vertical, CSS3 animated and responsive timeline in minutes flat without writing code.
7
+ Version: 1.0
8
+ Author: Evan Herman
9
+ Author URI: http://www.evan-herman.com
10
+ License: GPL2
11
+
12
+ #_________________________________________________ LICENSE
13
+ Copyright 2012-14 Evan Herman (email : evan.m.herman@gmail.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License, version 2, as
17
+ published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+
28
+ #_________________________________________________ CONSTANTS
29
+
30
+ /** Configuration **/
31
+ if(!defined('TIMELINE_EXPRESS_DEBUG')) define('TIMELINE_EXPRESS_DEBUG', false);
32
+ if(!defined('TIMELINE_EXPRESS_VERSION_CURRENT')) define('TIMELINE_EXPRESS_VERSION_CURRENT', '1.0');
33
+ if(!defined('TIMELINE_EXPRESS_REQ_PHP')) define('TIMELINE_EXPRESS_REQ_PHP', '5.0');
34
+ if(!defined('TIMELINE_EXPRESS_AUTHOR')) define('TIMELINE_EXPRESS_AUTHOR', 'Evan Herman');
35
+ if(!defined('TIMELINE_EXPRESS_SITE')) define('TIMELINE_EXPRESS_SITE', site_url().'/');
36
+ if(!defined('TIMELINE_EXPRESS_PREFIX')) define('TIMELINE_EXPRESS_PREFIX', 'timeline_express_');
37
+ if(!defined('TIMELINE_EXPRESS_PATH')) define('TIMELINE_EXPRESS_PATH', ABSPATH.'wp-content/plugins/timeline-express/');
38
+ if(!defined('TIMELINE_EXPRESS_URL')) define('TIMELINE_EXPRESS_URL', plugins_url('timeline-express/'));
39
+ if(!defined('TIMELINE_EXPRESS_URL_WP')) define('TIMELINE_EXPRESS_URL_WP', get_bloginfo('url'));
40
+ if(!defined('TIMELINE_EXPRESS_URL_WP_ADM')) define('TIMELINE_EXPRESS_URL_WP_ADM', TIMELINE_EXPRESS_URL_WP.'/wp-admin/');
41
+
42
+ /** Database Tables **/
43
+ if(!defined('TIMELINE_EXPRESS_OPTION')) define('TIMELINE_EXPRESS_OPTION', TIMELINE_EXPRESS_PREFIX.'storage');
44
+
45
+ // Conditional check for SSL enabled site
46
+ if(!defined('TIMELINE_EXPRESS_URL_WP_AJAX')) {
47
+ if ( is_ssl() ) {
48
+ define('TIMELINE_EXPRESS_URL_WP_AJAX', admin_url('admin-ajax.php', 'https'));
49
+ } else {
50
+ define('TIMELINE_EXPRESS_URL_WP_AJAX', admin_url('admin-ajax.php', 'http'));
51
+ }
52
+ }
53
+ if(!defined('TIMELINE_EXPRESS_URL_CURRENT')) define('TIMELINE_EXPRESS_URL_CURRENT', $_SERVER['REQUEST_URI']);
54
+
55
+
56
+ /** Localization **/
57
+ // include translated files
58
+ function timeline_express_text_domain_init() {
59
+ load_plugin_textdomain('timeline-express', false, dirname(plugin_basename(__FILE__)) . '/languages');
60
+ }
61
+ add_action('init', 'timeline_express_text_domain_init');
62
+
63
+ /** Initial Configuration **/
64
+ if(TIMELINE_EXPRESS_DEBUG) error_reporting(E_ALL ^ E_NOTICE);
65
+
66
+ /** Include Required Plugin Files **/
67
+ // main boilerplate class file
68
+ require_once TIMELINE_EXPRESS_PATH.'classes/class.timeline-express.php';
69
+ // ajax functions
70
+ require_once TIMELINE_EXPRESS_PATH.'lib/lib.ajax.php';
71
+
72
+ /** Initialize the plugin's base class **/
73
+ $timelineExpressBase = new timelineExpressBase();
74
+
75
+ /** Activation Hooks **/
76
+ register_activation_hook(__FILE__, array(&$timelineExpressBase, 'activate'));
77
+ register_deactivation_hook(__FILE__, array(&$timelineExpressBase, 'deactivate'));
78
+ register_uninstall_hook(__FILE__, array('timelineExpressBase', 'uninstall'));