Skip to content

Commit

Permalink
Merge pull request #7 from supercool/develop
Browse files Browse the repository at this point in the history
1.3.1
  • Loading branch information
joshangell committed Jan 9, 2015
2 parents dbd40ce + 0b9cdac commit 7fffb47
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 64 deletions.
4 changes: 2 additions & 2 deletions buttonbox/ButtonBoxPlugin.php
Expand Up @@ -20,7 +20,7 @@ public function getName()

public function getVersion()
{
return '1.3';
return '1.3.1';
}

public function getDeveloper()
Expand All @@ -30,7 +30,7 @@ public function getDeveloper()

public function getDeveloperUrl()
{
return 'http://www.supercooldesign.co.uk';
return 'http://plugins.supercooldesign.co.uk';
}

}
67 changes: 36 additions & 31 deletions buttonbox/fieldtypes/ButtonBox_ColoursFieldType.php
Expand Up @@ -10,9 +10,6 @@
* @link http://www.supercooldesign.co.uk
*/

/**
*
*/
class ButtonBox_ColoursFieldType extends BaseOptionsFieldType
{
/**
Expand Down Expand Up @@ -57,10 +54,10 @@ public function getInputHtml($name, $value)


/**
* @inheritDoc BaseElementFieldType::getSettingsHtml()
*
* @return string|null
*/
* @inheritDoc BaseElementFieldType::getSettingsHtml()
*
* @return string|null
*/
public function getSettingsHtml()
{
$options = $this->getOptions();
Expand All @@ -74,22 +71,6 @@ public function getSettingsHtml()
'value' => '',
'cssColour' => ''
)
// array(
// 'label' => 'Green',
// 'value' => 'green',
// 'cssColour' => '#328d7e',
// 'default' => true
// ),
// array(
// 'label' => 'Navy',
// 'value' => 'navy',
// 'cssColour' => '#17333a'
// ),
// array(
// 'label' => 'Brown',
// 'value' => 'brown',
// 'cssColour' => '#818b80'
// )
);
}

Expand Down Expand Up @@ -133,26 +114,50 @@ public function getSettingsHtml()
// =========================================================================

/**
* @inheritDoc BaseOptionsFieldType::getOptionsSettingsLabel()
*
* @return string
*/
* @inheritDoc BaseOptionsFieldType::getOptionsSettingsLabel()
*
* @return string
*/
protected function getOptionsSettingsLabel()
{
return Craft::t('Colour Options');
}


/**
* @inheritDoc BaseSavableComponentType::defineSettings()
*
* @return array
*/
* @inheritDoc BaseSavableComponentType::defineSettings()
*
* @return array
*/
protected function defineSettings()
{
return array(
'options' => array(AttributeType::Mixed, 'default' => array())
);
}


/**
* Returns the default field value.
*
* @return array|string|null
*/
protected function getDefaultValue()
{

foreach ($this->getOptions() as $option)
{

if ( !empty($option['default']) )
{
return $option['value'];
}

}

return $this->getOptions()[0]['value'];

}


}
67 changes: 36 additions & 31 deletions buttonbox/fieldtypes/ButtonBox_TextSizeFieldType.php
Expand Up @@ -10,9 +10,6 @@
* @link http://www.supercooldesign.co.uk
*/

/**
*
*/
class ButtonBox_TextSizeFieldType extends BaseOptionsFieldType
{
/**
Expand Down Expand Up @@ -57,10 +54,10 @@ public function getInputHtml($name, $value)


/**
* @inheritDoc BaseElementFieldType::getSettingsHtml()
*
* @return string|null
*/
* @inheritDoc BaseElementFieldType::getSettingsHtml()
*
* @return string|null
*/
public function getSettingsHtml()
{
$options = $this->getOptions();
Expand All @@ -74,22 +71,6 @@ public function getSettingsHtml()
'value' => '',
'pxVal' => ''
)
// array(
// 'label' => 'Medium',
// 'value' => 'medium',
// 'pxVal' => '16',
// 'default' => true
// ),
// array(
// 'label' => 'Large',
// 'value' => 'large',
// 'pxVal' => '24'
// ),
// array(
// 'label' => 'Mega',
// 'value' => 'mega',
// 'pxVal' => '36'
// )
);
}

Expand Down Expand Up @@ -132,26 +113,50 @@ public function getSettingsHtml()
// =========================================================================

/**
* @inheritDoc BaseOptionsFieldType::getOptionsSettingsLabel()
*
* @return string
*/
* @inheritDoc BaseOptionsFieldType::getOptionsSettingsLabel()
*
* @return string
*/
protected function getOptionsSettingsLabel()
{
return Craft::t('Text Size Options');
}


/**
* @inheritDoc BaseSavableComponentType::defineSettings()
*
* @return array
*/
* @inheritDoc BaseSavableComponentType::defineSettings()
*
* @return array
*/
protected function defineSettings()
{
return array(
'options' => array(AttributeType::Mixed, 'default' => array())
);
}


/**
* Returns the default field value.
*
* @return array|string|null
*/
protected function getDefaultValue()
{

foreach ($this->getOptions() as $option)
{

if ( !empty($option['default']) )
{
return $option['value'];
}

}

return $this->getOptions()[0]['value'];

}


}
10 changes: 10 additions & 0 deletions release-notes.json
@@ -1,4 +1,14 @@
[
{
"version" : "1.3.1",
"date" : "9-1-2015",
"notes" : [
{
"type" : "fixed",
"message" : "Fixed a bug where fancy options fields (text size and colours) were not showing if there was no default option selected."
}
]
},
{
"version" : "1.3",
"date" : "3-12-2014",
Expand Down

0 comments on commit 7fffb47

Please sign in to comment.