Changed multiple select for days of weekend to 'chosen'. Cleaned up some code. Removed success message when changing timezone.

This commit is contained in:
Marvin Thomas Rabe 2011-10-02 15:51:24 +02:00
parent ba49bcd5a9
commit daee88fd26
6 changed files with 22 additions and 26 deletions

View File

@ -4,7 +4,7 @@ $(document).ready(function(){
// Serialize the data // Serialize the data
var post = $( "#timezone" ).serialize(); var post = $( "#timezone" ).serialize();
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){ $.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
OC.msg.finishedSaving('#calendar .msg', data); //OC.msg.finishedSaving('#calendar .msg', data);
}); });
return false; return false;
}); });
@ -27,12 +27,7 @@ $(document).ready(function(){
$("#selectweekend_" + day).attr('selected',true); $("#selectweekend_" + day).attr('selected',true);
} }
} }
$("#weekend").multiselect({ $("#weekend").chosen();
header: false,
noneSelectedText: $('#weekend').attr('title'),
selectedList: 2,
minWidth:'auto',
});
}); });
$("#timeformat").change( function(){ $("#timeformat").change( function(){
var data = $("#timeformat").serialize(); var data = $("#timeformat").serialize();

View File

@ -27,7 +27,12 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>'; echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endif; endif;
endforeach;?> endforeach;?>
</select><span class="msg"></span>&nbsp;&nbsp; </select>&nbsp;&nbsp;
<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
</select><br />
<label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label> <label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label>
<select style="display: none;" id="firstdayofweek" name="firstdayofweek"> <select style="display: none;" id="firstdayofweek" name="firstdayofweek">
<?php <?php
@ -36,21 +41,16 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>'; echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
} }
?> ?>
</select>&nbsp;&nbsp; </select><br />
<label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label> <label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label>
<select id="weekend" name="weekend[]" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>"> <select id="weekend" name="weekend[]" style="width: 50%;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
<?php <?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){ for($i = 0;$i <= 6;$i++){
echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>'; echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
} }
?> ?>
</select>&nbsp;&nbsp; </select><br />
<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
<option value="24" id="24h"><?php echo $l->t("24 h"); ?></option>
<option value="ampm" id="ampm"><?php echo $l->t("am/pm"); ?></option>
</select>&nbsp;&nbsp;
<label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label> <label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label>
<input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <strong><?php echo $l->t("Minutes");?></strong> <input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <strong><?php echo $l->t("Minutes");?></strong>
<br /> <br />

View File

@ -7,7 +7,7 @@
$(document).ready(function(){ $(document).ready(function(){
function applyMultiplySelect(element){ function applyMultiplySelect(element){
var checked=[]; var checked=[];
var user=element.data('username') var user=element.data('username');
if(element.data('userGroups')){ if(element.data('userGroups')){
checked=element.data('userGroups').split(', '); checked=element.data('userGroups').split(', ');
} }
@ -24,7 +24,7 @@ $(document).ready(function(){
}, },
function(){} function(){}
); );
} };
}else{ }else{
checkHandeler=false; checkHandeler=false;
} }
@ -88,7 +88,6 @@ $(document).ready(function(){
var uid=img.parent().parent().data('uid'); var uid=img.parent().parent().data('uid');
var input=$('<input>'); var input=$('<input>');
var quota=img.parent().children('span').text(); var quota=img.parent().children('span').text();
img
if(quota=='None'){ if(quota=='None'){
quota=''; quota='';
} }

View File

@ -9,9 +9,12 @@ require_once('../lib/base.php');
OC_Util::checkLoggedIn(); OC_Util::checkLoggedIn();
// Highlight navigation entry // Highlight navigation entry
OC_Util::addScript( "settings", "personal" ); OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( "settings", "settings" ); OC_Util::addScript( 'core', 'multiselect' );
OC_App::setActiveNavigationEntry( "personal" ); OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );
// calculate the disc space // calculate the disc space
$used=OC_Filesystem::filesize('/'); $used=OC_Filesystem::filesize('/');
@ -33,7 +36,7 @@ foreach($languageCodes as $lang){
} }
// Return template // Return template
$tmpl = new OC_Template( "settings", "personal", "user"); $tmpl = new OC_Template( 'settings', 'personal', 'user');
$tmpl->assign('usage',OC_Helper::humanFileSize($used)); $tmpl->assign('usage',OC_Helper::humanFileSize($used));
$tmpl->assign('total_space',OC_Helper::humanFileSize($total)); $tmpl->assign('total_space',OC_Helper::humanFileSize($total));
$tmpl->assign('usage_relative',$relative); $tmpl->assign('usage_relative',$relative);

View File

@ -8,8 +8,8 @@
require_once('../lib/base.php'); require_once('../lib/base.php');
OC_Util::checkLoggedIn(); OC_Util::checkLoggedIn();
OC_Util::addStyle( "settings", "settings" ); OC_Util::addStyle( 'settings', 'settings' );
OC_App::setActiveNavigationEntry( "settings" ); OC_App::setActiveNavigationEntry( 'settings' );
$tmpl = new OC_Template( 'settings', 'settings', 'user'); $tmpl = new OC_Template( 'settings', 'settings', 'user');
$forms=OC_App::getForms('settings'); $forms=OC_App::getForms('settings');

View File

@ -10,7 +10,6 @@ OC_Util::checkAdminUser();
// We have some javascript foo! // We have some javascript foo!
OC_Util::addScript( 'settings', 'users' ); OC_Util::addScript( 'settings', 'users' );
OC_Util::addScript( 'core', 'multiselect' );
OC_Util::addStyle( 'settings', 'settings' ); OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' ); OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' ); OC_Util::addStyle( '3rdparty', 'chosen' );