From ed3d68435f042ff6bc212022058310255db0e1bd Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 13 Apr 2009 05:39:23 +0000 Subject: Using farbtastic jQuery plugin to select design colours. --- actions/designsettings.php | 61 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) (limited to 'actions') diff --git a/actions/designsettings.php b/actions/designsettings.php index 87afdac8a..05293f712 100644 --- a/actions/designsettings.php +++ b/actions/designsettings.php @@ -88,19 +88,34 @@ class DesignsettingsAction extends AccountSettingsAction $this->elementEnd('ul'); $this->elementEnd('fieldset'); - $this->elementStart('fieldset', array('id' => 'settings_design_colour')); + $this->elementStart('fieldset', array('id' => 'settings_design_color')); $this->element('legend', null, _('Change colours')); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); - $this->element('p', null, _('Edit text colours')); + $this->input('color-1', _('Background color'), '#F0F2F5', null); $this->elementEnd('li'); - $this->elementEnd('ul'); + $this->elementStart('li'); + $this->input('color-2', _('Content background color'), '#FFFFFF', null); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('color-3', _('Sidebar background color'), '#CEE1E9', null); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('color-4', _('Text color'), '#000000', null); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->input('color-5', _('Link color'), '#002E6E', null); + $this->elementEnd('li'); + $this->elementEnd('ul'); + $this->element('div', array('id' => 'color-picker')); $this->elementEnd('fieldset'); + $this->submit('save', _('Save')); $this->elementEnd('fieldset'); $this->elementEnd('form'); + } /** @@ -169,4 +184,44 @@ class DesignsettingsAction extends AccountSettingsAction $this->showForm(_('Password saved.'), true); */ } + + + /** + * Add the jCrop stylesheet + * + * @return void + */ + + function showStylesheets() + { + parent::showStylesheets(); + $farbtasticStyle = + common_path('theme/default/base/css/farbtastic.css?version='.LACONICA_VERSION); + + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => $farbtasticStyle, + 'media' => 'screen, projection, tv')); + } + + /** + * Add the jCrop scripts + * + * @return void + */ + + function showScripts() + { + parent::showScripts(); + +// if ($this->mode == 'crop') { + $farbtasticPack = common_path('js/farbtastic/farbtastic.js'); + $farbtasticGo = common_path('js/farbtastic/farbtastic.go.js'); + + $this->element('script', array('type' => 'text/javascript', + 'src' => $farbtasticPack)); + $this->element('script', array('type' => 'text/javascript', + 'src' => $farbtasticGo)); +// } + } } -- cgit v1.2.3-54-g00ecf