Merge branch '1.9.1' of dev.sourcefabric.org:airtime into 1.9.1
This commit is contained in:
commit
fa50c93914
|
@ -58,6 +58,12 @@ $pages = array(
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'directory-config'
|
'action' => 'directory-config'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'label' => 'Support Settings',
|
||||||
|
'module' => 'default',
|
||||||
|
'controller' => 'Preference',
|
||||||
|
'action' => 'support-setting'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
@ -7,9 +7,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
/* Initialize action controller here */
|
/* Initialize action controller here */
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext/*->addActionContext('register', 'json')
|
$ajaxContext->addActionContext('server-browse', 'json')
|
||||||
->addActionContext('remindme', 'json')*/
|
|
||||||
->addActionContext('server-browse', 'json')
|
|
||||||
->addActionContext('change-stor-directory', 'json')
|
->addActionContext('change-stor-directory', 'json')
|
||||||
->addActionContext('reload-watch-directory', 'json')
|
->addActionContext('reload-watch-directory', 'json')
|
||||||
->addActionContext('remove-watch-directory', 'json')
|
->addActionContext('remove-watch-directory', 'json')
|
||||||
|
@ -30,8 +28,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
$values = $form->getValues();
|
$values = $form->getValues();
|
||||||
|
|
||||||
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
|
||||||
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
||||||
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]);
|
||||||
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
||||||
|
@ -45,30 +42,51 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
|
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
|
||||||
|
|
||||||
Application_Model_Preference::SetPhone($values["preferences_support"]["Phone"]);
|
|
||||||
Application_Model_Preference::SetEmail($values["preferences_support"]["Email"]);
|
|
||||||
Application_Model_Preference::SetStationWebSite($values["preferences_support"]["StationWebSite"]);
|
|
||||||
Application_Model_Preference::SetSupportFeedback($values["preferences_support"]["SupportFeedback"]);
|
|
||||||
Application_Model_Preference::SetPublicise($values["preferences_support"]["Publicise"]);
|
|
||||||
|
|
||||||
$form->getSubForm('preferences_support')->Logo->receive();
|
|
||||||
$imagePath = $form->getSubForm('preferences_support')->Logo->getFileName();
|
|
||||||
|
|
||||||
Application_Model_Preference::SetStationCountry($values["preferences_support"]["Country"]);
|
|
||||||
Application_Model_Preference::SetStationCity($values["preferences_support"]["City"]);
|
|
||||||
Application_Model_Preference::SetStationDescription($values["preferences_support"]["Description"]);
|
|
||||||
Application_Model_Preference::SetStationLogo($imagePath);
|
|
||||||
|
|
||||||
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$logo = Application_Model_Preference::GetStationLogo();
|
|
||||||
if($logo){
|
|
||||||
$this->view->logoImg = $logo;
|
|
||||||
}
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function supportSettingAction()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$baseUrl = $request->getBaseUrl();
|
||||||
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js','text/javascript');
|
||||||
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
|
$form = new Application_Form_SupportSettings();
|
||||||
|
|
||||||
|
if ($request->isPost()) {
|
||||||
|
if ($form->isValid($request->getPost())) {
|
||||||
|
$values = $form->getValues();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
|
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||||
|
Application_Model_Preference::SetEmail($values["Email"]);
|
||||||
|
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||||
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
|
|
||||||
|
$form->Logo->receive();
|
||||||
|
$imagePath = $form->Logo->getFileName();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||||
|
Application_Model_Preference::SetStationCity($values["City"]);
|
||||||
|
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||||
|
Application_Model_Preference::SetStationLogo($imagePath);
|
||||||
|
|
||||||
|
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
|
if($logo){
|
||||||
|
$this->view->logoImg = $logo;
|
||||||
|
}
|
||||||
|
$this->view->form = $form;
|
||||||
|
}
|
||||||
|
|
||||||
public function directoryConfigAction()
|
public function directoryConfigAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
|
@ -9,19 +9,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
||||||
));
|
));
|
||||||
|
|
||||||
//Station name
|
|
||||||
$this->addElement('text', 'stationName', array(
|
|
||||||
'class' => 'input_text',
|
|
||||||
'label' => 'Station Name',
|
|
||||||
'required' => true,
|
|
||||||
'filters' => array('StringTrim'),
|
|
||||||
'validators' => array('NotEmpty'),
|
|
||||||
'value' => Application_Model_Preference::GetValue("station_name"),
|
|
||||||
'decorators' => array(
|
|
||||||
'ViewHelper'
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||||
if($defaultFade == ""){
|
if($defaultFade == ""){
|
||||||
$defaultFade = '00:00:00.000000';
|
$defaultFade = '00:00:00.000000';
|
||||||
|
|
|
@ -18,8 +18,8 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
||||||
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
||||||
|
|
||||||
$support_pref = new Application_Form_SupportPreferences();
|
/*$support_pref = new Application_Form_SupportPreferences();
|
||||||
$this->addSubForm($support_pref, 'preferences_support');
|
$this->addSubForm($support_pref, 'preferences_support');*/
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
'class' => 'ui-button ui-state-default right-floated',
|
'class' => 'ui-button ui-state-default right-floated',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Application_Form_SupportPreferences extends Zend_Form_SubForm
|
class Application_Form_SupportSettings extends Zend_Form
|
||||||
{
|
{
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
|
@ -8,9 +8,21 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/preferences_support.phtml')),
|
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
||||||
array('File', array('viewScript' => 'form/preferences_support.phtml', 'placement' => false)))
|
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//Station name
|
||||||
|
$this->addElement('text', 'stationName', array(
|
||||||
|
'class' => 'input_text',
|
||||||
|
'label' => 'Station Name',
|
||||||
|
'required' => false,
|
||||||
|
'filters' => array('StringTrim'),
|
||||||
|
'value' => Application_Model_Preference::GetValue("station_name"),
|
||||||
|
'decorators' => array(
|
||||||
|
'ViewHelper'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
// Phone number
|
// Phone number
|
||||||
$this->addElement('text', 'Phone', array(
|
$this->addElement('text', 'Phone', array(
|
||||||
|
@ -134,18 +146,26 @@ class Application_Form_SupportPreferences extends Zend_Form_SubForm
|
||||||
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
|
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($checkboxPrivacy);
|
$this->addElement($checkboxPrivacy);
|
||||||
|
|
||||||
|
// submit button
|
||||||
|
$submit = new Zend_Form_Element_Submit("submit");
|
||||||
|
$submit->class = 'ui-button ui-state-default right-floated';
|
||||||
|
$submit->setIgnore(true)
|
||||||
|
->setLabel("Submit")
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($submit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwriting isValid function
|
// overwriting isValid function
|
||||||
public function isValid ($data)
|
public function isValid ($data)
|
||||||
{
|
{
|
||||||
parent::isValid($data);
|
$isValid = parent::isValid($data);
|
||||||
$checkPrivacy = $this->getElement('Privacy');
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
||||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
$checkPrivacy->addError("You have to agree to privacy policy.");
|
||||||
return false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
return true;
|
return $isValid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,6 @@
|
||||||
<?php echo $this->element->getSubform('preferences_soundcloud') ?>
|
<?php echo $this->element->getSubform('preferences_soundcloud') ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="collapsible-header" id="support-heading"><span class="arrow-icon"></span>Support Settings</h3>
|
|
||||||
<div class="collapsible-content" id="support-settings" style="display: none;">
|
|
||||||
<?php echo $this->element->getSubform('preferences_support') ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="button-bar bottom" id="submit-element">
|
<div class="button-bar bottom" id="submit-element">
|
||||||
<?php echo $this->element->getElement('submit') ?>
|
<?php echo $this->element->getElement('submit') ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,21 +1,5 @@
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
|
|
||||||
<dt id="stationName-label" class="block-display">
|
|
||||||
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
|
|
||||||
<span class="info-text-small">(Required)</span> :
|
|
||||||
</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="stationName-element" class="block-display">
|
|
||||||
<?php echo $this->element->getElement('stationName') ?>
|
|
||||||
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
|
|
||||||
<ul class='errors'>
|
|
||||||
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
|
|
||||||
<li><?php echo $error; ?></li>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
<?php endif; ?>
|
|
||||||
</dd>
|
|
||||||
<dt id="stationDefaultFade-label" class="block-display">
|
<dt id="stationDefaultFade-label" class="block-display">
|
||||||
<label class="optional" for="stationDefaultFade"><?php echo $this->element->getElement('stationDefaultFade')->getLabel() ?></label>
|
<label class="optional" for="stationDefaultFade"><?php echo $this->element->getElement('stationDefaultFade')->getLabel() ?></label>
|
||||||
</dt>
|
</dt>
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
|
<dt id="stationName-label" class="block-display">
|
||||||
|
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?> :
|
||||||
|
</label>
|
||||||
|
</dt>
|
||||||
|
<dd id="stationName-element" class="block-display">
|
||||||
|
<?php echo $this->element->getElement('stationName') ?>
|
||||||
|
<?php if($this->element->getElement('stationName')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('stationName')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</dd>
|
||||||
<dd id="SupportFeedback-element" style="width:90%;">
|
<dd id="SupportFeedback-element" style="width:90%;">
|
||||||
<div class="info-text">Help Airtime improve by letting us know you are using it. This info
|
<div class="info-text">Help Airtime improve by letting us know you are using it. This info
|
||||||
will be collected regularly in order to improve your user experience.</div>
|
will be collected regularly in order to improve your user experience.</div>
|
||||||
|
@ -30,10 +44,10 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to promote your station, "Send support feedback" must be enabled</p></div>
|
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to promote your station, "Send support feedback" must be enabled</p></div>
|
||||||
<dl id="public-info" style="display:none;">
|
<dl id="public-info" style="display:none;">
|
||||||
<dt id="Phone-label" class="block-display">
|
<dt id="Phone-label" class="block-display">
|
||||||
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
<label class="optional" for="Phone"><?php echo $this->element->getElement('Phone')->getLabel() ?></label>
|
||||||
<span class="info-text-small">(for verification purposes only, will not be published)</span>
|
<span class="info-text-small">(for verification purposes only, will not be published)</span>
|
||||||
|
@ -144,7 +158,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<br>
|
<br>
|
||||||
<label class="optional" for="Privacy">
|
<label class="optional" for="Privacy">
|
||||||
<?php echo $this->element->getElement('Privacy') ?>
|
<?php echo $this->element->getElement('Privacy') ?>
|
||||||
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||||
</label>
|
</label>
|
||||||
|
@ -156,4 +170,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
|
||||||
|
<h2>Support Setting</h2>
|
||||||
|
<form method="post" action="/Preference/support-setting" enctype="multipart/form-data">
|
||||||
|
<div id="support-settings">
|
||||||
|
<?php echo $this->statusMsg ?>
|
||||||
|
<?php echo $this->form ?>
|
||||||
|
</div>
|
||||||
|
<div class="button-bar bottom" id="submit-element">
|
||||||
|
<?php echo $this->form->getElement('submit') ?>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -4,39 +4,9 @@ function showErrorSections() {
|
||||||
$("#soundcloud-settings").show();
|
$("#soundcloud-settings").show();
|
||||||
$(window).scrollTop($("soundcloud-settings .errors").position().top);
|
$(window).scrollTop($("soundcloud-settings .errors").position().top);
|
||||||
}
|
}
|
||||||
if($("#support-settings .errors").length > 0) {
|
|
||||||
$("#support-settings").show();
|
|
||||||
$(window).scrollTop($("#support-settings .errors").position().top);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resizeImg(ele){
|
|
||||||
var img = $(ele);
|
|
||||||
|
|
||||||
var width = ele.width;
|
|
||||||
var height = ele.height;
|
|
||||||
|
|
||||||
// resize img proportionaly
|
|
||||||
if( width > height && width > 450){
|
|
||||||
var ratio = 450/width;
|
|
||||||
img.css("width", "450px");
|
|
||||||
var newHeight = height * ratio;
|
|
||||||
img.css("height", newHeight );
|
|
||||||
|
|
||||||
}else if( width < height && height > 450){
|
|
||||||
var ratio = 450/height;
|
|
||||||
img.css("height", "450px");
|
|
||||||
var newWidth = width * ratio;
|
|
||||||
img.css("width", newWidth );
|
|
||||||
}else if( width == height && width > 450){
|
|
||||||
img.css("height", "450px");
|
|
||||||
img.css("width", "450px" );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var form = $("form");
|
|
||||||
|
|
||||||
$('.collapsible-header').live('click',function() {
|
$('.collapsible-header').live('click',function() {
|
||||||
$(this).next().toggle('fast');
|
$(this).next().toggle('fast');
|
||||||
|
@ -44,36 +14,5 @@ $(document).ready(function() {
|
||||||
return false;
|
return false;
|
||||||
}).next().hide();
|
}).next().hide();
|
||||||
|
|
||||||
$("#SupportFeedback").click( function(){
|
|
||||||
var pub = $("#Publicise");
|
|
||||||
if( !$(this).is(':checked') ){
|
|
||||||
pub.removeAttr("checked");
|
|
||||||
pub.attr("disabled", true);
|
|
||||||
}else{
|
|
||||||
pub.removeAttr("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var promote = $("#Publicise");
|
|
||||||
if(!$("#SupportFeedback").is(':checked')){
|
|
||||||
promote.removeAttr("checked");
|
|
||||||
promote.attr("disabled", true);
|
|
||||||
}
|
|
||||||
promote.live('click', function(){
|
|
||||||
if($(this).is(':checked')){
|
|
||||||
$("#public-info").show();
|
|
||||||
}else{
|
|
||||||
$("#public-info").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if( promote.is(":checked")){
|
|
||||||
$("#public-info").show();
|
|
||||||
}
|
|
||||||
|
|
||||||
showErrorSections();
|
showErrorSections();
|
||||||
|
|
||||||
$('.toggle legend').click(function() {
|
|
||||||
$('.toggle').toggleClass('closed');
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
function showErrorSections() {
|
||||||
|
|
||||||
|
if($("soundcloud-settings .errors").length > 0) {
|
||||||
|
$("#soundcloud-settings").show();
|
||||||
|
$(window).scrollTop($("soundcloud-settings .errors").position().top);
|
||||||
|
}
|
||||||
|
if($("#support-settings .errors").length > 0) {
|
||||||
|
$("#support-settings").show();
|
||||||
|
$(window).scrollTop($("#support-settings .errors").position().top);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function resizeImg(ele){
|
||||||
|
var img = $(ele);
|
||||||
|
|
||||||
|
var width = ele.width;
|
||||||
|
var height = ele.height;
|
||||||
|
|
||||||
|
// resize img proportionaly
|
||||||
|
if( width > height && width > 450){
|
||||||
|
var ratio = 450/width;
|
||||||
|
img.css("width", "450px");
|
||||||
|
var newHeight = height * ratio;
|
||||||
|
img.css("height", newHeight );
|
||||||
|
|
||||||
|
}else if( width < height && height > 450){
|
||||||
|
var ratio = 450/height;
|
||||||
|
img.css("height", "450px");
|
||||||
|
var newWidth = width * ratio;
|
||||||
|
img.css("width", newWidth );
|
||||||
|
}else if( width == height && width > 450){
|
||||||
|
img.css("height", "450px");
|
||||||
|
img.css("width", "450px" );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
var form = $("form");
|
||||||
|
|
||||||
|
$("#SupportFeedback").click( function(){
|
||||||
|
var pub = $("#Publicise");
|
||||||
|
if( !$(this).is(':checked') ){
|
||||||
|
pub.removeAttr("checked");
|
||||||
|
pub.attr("disabled", true);
|
||||||
|
}else{
|
||||||
|
pub.removeAttr("disabled");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var promote = $("#Publicise");
|
||||||
|
if(!$("#SupportFeedback").is(':checked')){
|
||||||
|
promote.removeAttr("checked");
|
||||||
|
promote.attr("disabled", true);
|
||||||
|
}
|
||||||
|
promote.live('click', function(){
|
||||||
|
if($(this).is(':checked')){
|
||||||
|
$("#public-info").show();
|
||||||
|
}else{
|
||||||
|
$("#public-info").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if( promote.is(":checked")){
|
||||||
|
$("#public-info").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
showErrorSections();
|
||||||
|
|
||||||
|
$('.toggle legend').click(function() {
|
||||||
|
$('.toggle').toggleClass('closed');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue