Changeset 538753
- Timestamp:
- 05/02/2012 01:31:18 AM (14 years ago)
- Location:
- wodtogether-whiteboards/trunk
- Files:
-
- 1 added
- 1 edited
-
wodtogether-whiteboards.js (added)
-
wodtogether-whiteboards.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wodtogether-whiteboards/trunk/wodtogether-whiteboards.php
r537787 r538753 44 44 add_settings_field('wodtogether_required_category', 'Required Category', 'wodtogether_setting_required_category', 'wodtogether', 'wodtogether_main'); 45 45 add_settings_field('wodtogether_iframe_height', 'iFrame Height (in pixels)', 'wodtogether_setting_iframe_height', 'wodtogether', 'wodtogether_main'); 46 add_settings_field('wodtogether_auto_resize', 'Attempt Auto-Resize', 'wodtogether_setting_auto_resize', 'wodtogether', 'wodtogether_main'); 46 47 add_settings_field('wodtogether_show_wods', 'Show WOD Details by Default', 'wodtogether_setting_show_wods', 'wodtogether', 'wodtogether_main'); 47 48 } … … 83 84 echo "<input id='wodtogether_iframe_height' name='wodtogether_options[iframe_height]' size='20' type='text' value='{$options['iframe_height']}' />"; 84 85 } 86 function wodtogether_setting_auto_resize() { 87 $options = get_option('wodtogether_options'); 88 89 $checked = (isset($options['auto_resize']) && $options['auto_resize']) ? ' checked' : ''; 90 echo "<input id='wodtogether_auto_resize' name='wodtogether_options[auto_resize]' {$checked} type='checkbox' value='1' /> 91 <p><strong>Recommended!</strong> This will attempt to automatically resize the whiteboard iframe so there are no scrollbars.</p>"; 92 } 85 93 function wodtogether_setting_show_wods() { 86 94 $options = get_option('wodtogether_options'); … … 115 123 * END WODTogether Settings 116 124 */ 117 125 118 126 // count how many whiteboards have been loaded for this page 119 127 $whiteboarded = 0; 128 $wodtogetherSettings = get_option('wodtogether_options'); 129 130 if ($wodtogetherSettings['auto_resize']) { 131 wp_enqueue_script('wodtogether-whiteboards', 132 WP_PLUGIN_URL . '/wodtogether-whiteboards/wodtogether-whiteboards.js', 133 array('jquery') 134 ); 135 } 120 136 121 137 /** … … 126 142 { 127 143 global $whiteboarded; 128 129 $wodtogetherSettings = get_option('wodtogether_options'); 144 global $wodtogetherSettings; 130 145 131 146 if (isset($wodtogetherSettings['required_category']) && $wodtogetherSettings['required_category']) { … … 155 170 if ($whiteboarded >= 5) { 156 171 return $input . "<br /><a href=\"http://wodtogether.com/whiteboard/view/date/{$date}/gym/{$gym_id}/embed/remote{$show_wods}\">View Whitebaord</a>"; 157 } 172 } 158 173 $whiteboarded++; 159 $whiteboardIframeHtml = "<br /> <iframe width=\"98%\" height=\"{$height}\" src=\"http://wodtogether.com/whiteboard/view/date/{$date}/gym/{$gym_id}/embed/remote{$show_wods}\"></iframe>"; 160 161 174 $whiteboardIframeHtml = "<br /> <iframe width=\"98%\" height=\"{$height}\" src=\"http://wodtogether.com/whiteboard/view/date/{$date}/gym/{$gym_id}/embed/remote{$show_wods}\" id=\"wb_{$date}_{$gym_id}\"></iframe>"; 162 175 163 176 return $input . $whiteboardIframeHtml;
Note: See TracChangeset
for help on using the changeset viewer.