Permalink
Browse files

v1.1 13/11/11

- added "background" options
- typography can now be called individually
  • Loading branch information...
1 parent 109a9f2 commit 2221ae79310c27ef13ff9f25f9f5f50d442c993a @syamilmj committed Nov 12, 2011
View
@@ -29,7 +29,12 @@ Website: http://aquagraphite.com
CHANGELOG:
-Update 10 Nov 2011
+v1.0 10 Nov 2011
+- added version number
- shaved off most if not all of the "undefined index" errors
- disable/enable layout block by drag and drop
-- slider title will update upon typing
+- slider title will update upon typing
+
+v1.1 13 Nov 2011
+- added new option "background"
+- typography option may now be called individually
@@ -124,14 +124,6 @@ function optionsframework_options_page(){
<div style="clear:both;"></div>
</div><!--wrap-->
-<div id="of_backup">
-<?php
- $data = serialize(get_option(OPTIONS));
- echo "<textarea cols=\"8\" rows=\"8\">";
- print_r($data);
- echo "</textarea>";
-?>
-</div>
<?php
}
@@ -336,6 +328,15 @@ function(){
$('.of-radio-img-label').hide();
$('.of-radio-img-img').show();
$('.of-radio-img-radio').hide();
+
+ //Masked Inputs (background images as radio buttons)
+ $('.of-radio-bg-img').click(function(){
+ $(this).parent().parent().find('.of-radio-bg-img').removeClass('of-radio-bg-selected');
+ $(this).addClass('of-radio-bg-selected');
+ });
+ $('.of-radio-bg-label').hide();
+ $('.of-radio-bg-img').show();
+ $('.of-radio-bg-radio').hide();
// COLOR Picker
$('.colorSelector').each(function(){
@@ -920,51 +921,72 @@ public static function optionsframework_machine($options) {
$typography_stored = $data[$value['id']];
/* Font Size */
- $output .= '<div class="select_wrapper typography-size">';
- $output .= '<select class="of-typography of-typography-size select" name="'.$value['id'].'[size]" id="'. $value['id'].'_size">';
- for ($i = 9; $i < 20; $i++){
- $test = $i.'px';
- $output .= '<option value="'. $i .'px" ' . selected($typography_stored['size'], $test, false) . '>'. $i .'px</option>';
- }
-
- $output .= '</select></div>';
+
+ if(isset($typography_stored['size'])) {
+
+ $output .= '<div class="select_wrapper typography-size">';
+ $output .= '<select class="of-typography of-typography-size select" name="'.$value['id'].'[size]" id="'. $value['id'].'_size">';
+ for ($i = 9; $i < 20; $i++){
+ $test = $i.'px';
+ $output .= '<option value="'. $i .'px" ' . selected($typography_stored['size'], $test, false) . '>'. $i .'px</option>';
+ }
+
+ $output .= '</select></div>';
+
+ }
/* Font Face */
- $output .= '<div class="select_wrapper typography-face">';
- $output .= '<select class="of-typography of-typography-face select" name="'.$value['id'].'[face]" id="'. $value['id'].'_face">';
-
- $faces = array('arial'=>'Arial',
- 'verdana'=>'Verdana, Geneva',
- 'trebuchet'=>'Trebuchet',
- 'georgia' =>'Georgia',
- 'times'=>'Times New Roman',
- 'tahoma'=>'Tahoma, Geneva',
- 'palatino'=>'Palatino',
- 'helvetica'=>'Helvetica*' );
- foreach ($faces as $i=>$face) {
- $output .= '<option value="'. $i .'" ' . selected($typography_stored['face'], $i, false) . '>'. $face .'</option>';
- }
-
- $output .= '</select></div>';
+
+ if(isset($typography_stored['face'])) {
+
+ $output .= '<div class="select_wrapper typography-face">';
+ $output .= '<select class="of-typography of-typography-face select" name="'.$value['id'].'[face]" id="'. $value['id'].'_face">';
+
+ $faces = array('arial'=>'Arial',
+ 'verdana'=>'Verdana, Geneva',
+ 'trebuchet'=>'Trebuchet',
+ 'georgia' =>'Georgia',
+ 'times'=>'Times New Roman',
+ 'tahoma'=>'Tahoma, Geneva',
+ 'palatino'=>'Palatino',
+ 'helvetica'=>'Helvetica*' );
+ foreach ($faces as $i=>$face) {
+ $output .= '<option value="'. $i .'" ' . selected($typography_stored['face'], $i, false) . '>'. $face .'</option>';
+ }
+
+ $output .= '</select></div>';
+
+ }
/* Font Weight */
- $output .= '<div class="select_wrapper typography-style">';
- $output .= '<select class="of-typography of-typography-style select" name="'.$value['id'].'[style]" id="'. $value['id'].'_style">';
- $styles = array('normal'=>'Normal',
- 'italic'=>'Italic',
- 'bold'=>'Bold',
- 'bold italic'=>'Bold Italic');
-
- foreach ($styles as $i=>$style){
- $output .= '<option value="'. $i .'" ' . selected($typography_stored['style'], $i, false) . '>'. $style .'</option>';
+ if(isset($typography_stored['style'])) {
+
+ $output .= '<div class="select_wrapper typography-style">';
+ $output .= '<select class="of-typography of-typography-style select" name="'.$value['id'].'[style]" id="'. $value['id'].'_style">';
+ $styles = array('normal'=>'Normal',
+ 'italic'=>'Italic',
+ 'bold'=>'Bold',
+ 'bold italic'=>'Bold Italic');
+
+ foreach ($styles as $i=>$style){
+
+ $output .= '<option value="'. $i .'" ' . selected($typography_stored['style'], $i, false) . '>'. $style .'</option>';
+ }
+ $output .= '</select></div>';
+
+ }
+
+ /* Font Color */
+
+ if(isset($typography_stored['color'])) {
+
+ $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector"><div style="background-color: '.$typography_stored['color'].'"></div></div>';
+ $output .= '<input class="of-color of-typography of-typography-color" name="'.$value['id'].'[color]" id="'. $value['id'] .'_color" type="text" value="'. $typography_stored['color'] .'" />';
+
}
- $output .= '</select></div>';
- /* Font Color */
- $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector"><div style="background-color: '.$typography_stored['color'].'"></div></div>';
- $output .= '<input class="of-color of-typography of-typography-color" name="'.$value['id'].'[color]" id="'. $value['id'] .'_color" type="text" value="'. $typography_stored['color'] .'" />';
- break;
+ break;
case 'border':
if(!isset($data[$value['id'] . '_width'])) $data[$value['id'] . '_width'] ='';
@@ -1028,7 +1050,31 @@ public static function optionsframework_machine($options) {
$output .= '</span>';
}
- break;
+ break;
+ case 'background':
+
+ $i = 0;
+
+ $select_value = $data[$value['id']];
+
+ foreach ($value['options'] as $key => $option)
+ {
+ $i++;
+
+ $checked = '';
+ $selected = '';
+ if(NULL!=checked($select_value, $option, false)) {
+ $checked = checked($select_value, $option, false);
+ $selected = 'of-radio-bg-selected';
+ }
+ $output .= '<span>';
+ $output .= '<input type="radio" id="of-radio-bg-' . $value['id'] . $i . '" class="checkbox of-radio-bg-radio" value="'.$option.'" name="'.$value['id'].'" '.$checked.' />';
+ $output .= '<div class="of-radio-bg-label">'. $key .'</div>';
+ $output .= '<div class="of-radio-bg-img '. $selected .'" style="background: url('.$option.')" onClick="document.getElementById(\'of-radio-bg-'. $value['id'] . $i.'\').checked = true;"></div>';
+ $output .= '</span>';
+ }
+
+ break;
case "info":
$info_text = $value['std'];
$output .= '<div class="of-info">'.$info_text.'</div>';
View
@@ -403,6 +403,23 @@ border-radius: 2px;
#of_container .controls .of-radio-img-img:hover {
opacity:.8;
}
+
+#of_container .controls .of-radio-bg-img {
+ width:50px;
+ height:50px;
+ border:3px solid #f9f9f9;
+ margin:0 5px 10px 0;
+ display:none;
+ cursor:pointer;
+ float:left;
+}
+#of_container .controls .of-radio-bg-selected {
+ border:3px solid #ccc
+}
+#of_container .controls .of-radio-bg-img:hover {
+ opacity:.8;
+}
+
#of_container .controls .of-border-width {
width:70px;
float:left
View
Binary file not shown.
Binary file not shown.
@@ -50,6 +50,21 @@ function of_options(){
}
}
+//Background Images Reader
+$bg_images_path = STYLESHEETPATH. '/images/bg/'; // change this to where you store your bg images
+$bg_images_url = get_bloginfo('template_url').'/images/bg/'; // change this to where you store your bg images
+$bg_images = array();
+
+if ( is_dir($bg_images_path) ) {
+ if ($bg_images_dir = opendir($bg_images_path) ) {
+ while ( ($bg_images_file = readdir($bg_images_dir)) !== false ) {
+ if(stristr($bg_images_file, ".png") !== false) {
+ $bg_images[] = $bg_images_url . $bg_images_file;
+ }
+ }
+ }
+}
+
/*-----------------------------------------------------------------------------------*/
/* TO DO: Add options/functions that use these */
/*-----------------------------------------------------------------------------------*/
@@ -112,6 +127,20 @@ function of_options(){
"id" => "pingu_slider",
"std" => "",
"type" => "slider");
+
+$of_options[] = array( "name" => "Background Images",
+ "desc" => "Select a background pattern.",
+ "id" => "custom_bg",
+ "std" => $bg_images_url."bg0.png",
+ "type" => "background",
+ "options" => $bg_images,
+ );
+
+$of_options[] = array( "name" => "Typography",
+ "desc" => "Typography option with each property can be called individually.",
+ "id" => "custom_type",
+ "std" => array('size' => '12px','style' => 'bold italic'),
+ "type" => "typography");
$of_options[] = array( "name" => "General Settings",
"type" => "heading");
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2221ae7

Please sign in to comment.