options fix

This commit is contained in:
Claude 2012-04-14 15:08:52 +02:00
parent d490ad81c9
commit d42b171303
3 changed files with 21 additions and 6 deletions

View File

@ -93,12 +93,12 @@ class Main extends CI_Controller
array(
'field' => 'code',
'label' => 'Main Paste',
'rules' => 'required'
'rules' => 'required',
) ,
array(
'field' => 'lang',
'label' => 'Language',
'rules' => 'min_length[1]|required|callback__valid_lang'
'rules' => 'min_length[1]|required|callback__valid_lang',
) ,
);
@ -243,7 +243,7 @@ class Main extends CI_Controller
function view_options()
{
if ($this->input->post('submit'))
if (!$this->input->post('submit'))
{
$data = $this->_view_options_prep();
$this->load->view('view/view_options', $data);
@ -251,8 +251,18 @@ class Main extends CI_Controller
else
{
$this->load->library('form_validation');
$rules['full_width'] = 'max_length[1]';
$rules['view_raw'] = 'max_length[1]';
$rules = array(
array(
'field' => 'full_width',
'label' => 'full_width',
'rules' => 'max_length[1]',
) ,
array(
'field' => 'view_raw',
'label' => 'view_raw',
'rules' => 'max_length[1]',
) ,
);
$this->form_validation->set_rules($rules);
if ($this->form_validation->run() == false)

View File

@ -19,6 +19,7 @@
</div>
</div>
<!-- the 'new' raw mode is like the pastebin.com raw mode. makes no sense to enable that by default
<div class="item">
<label for="view_raw">View Raw
<span class="instruction">This changes the default paste view to the raw view. Useful for dialup + low bandwith users.</span>
@ -28,7 +29,8 @@
echo form_checkbox($set);
?><p>Use the raw view by default</p>
</div>
</div>
</div>
-->
<div><button type="submit" value="submit" name="submit">Save</button></div>
<div class="spacer"></div>

View File

@ -23,6 +23,9 @@ ST.show = function() {
ST.expand = function() {
$('.expand').click(function() {
if($('.paste').hasClass('full')) {
return false;
}
var window_width = $(window).width();
var spacer = 20;
if (window_width < 900) {