Author: gropher
(2009/04/08 11:31) About 3 years ago
- Bugs fixed.
1
<? echo form_tag('post/create', array('method' => 'post', 'enctype' => 'multipart/form-data', 'onsubmit' => "return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})") ) ?>
2
<b><label for="text"><? echo __('Как дела? Что делаешь?') ?></label></b><br/>
3
<? echo textarea_tag('text', null, array('rows' => 2 , 'cols' => 50)) ?><br/>
4
<label for="mood"><? echo __('Настроение') ?>:</label>
<div class='mood'>
5
<? echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')) ?>
6
<? echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')) ?>
7
<? echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad') ) ?>
8
<? if(isset($blog_id)): ?>
9
<? echo input_file_tag('picture',array("style" => 'display:none')) ?>
10
<? echo link_to_function(__('картинка из файла'), 'showPictureUpload()', array('id' => 'more_file')) ?>
11
<? echo input_tag('picture_url', null, array("style" => 'display:none')) ?>
12
<? echo link_to_function(__('картинка из URL'), 'showPictureURL()', array('id' => 'more_url')) ?>
13
<? echo submit_tag(__('Написать')) ?>
14
</div>
15
16
<? echo input_hidden_tag('blog_id', $blog_id) ?>
17
<? endif ?>
18
<? if(isset($mypage)): ?>
19
<? echo input_hidden_tag('mypage', true) ?>
20
21
</form>
22
<script>
23
function showPictureUpload()
24
var radioHeight = "46";
25
26
document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');
27
var Custom = {
28
init: function()
29
{
30
var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;
31
var inputs = document.getElementsByTagName("input"), span = Array();
for(a = 0; a < inputs.length; a++)
32
33
if(inputs[a].type == "radio" && inputs[a].className.substr(0,6) == "styled")
34
...
span[a] = document.createElement("span");
36
35
span[a].className = inputs[a].type + inputs[a].className.substr(6);
37
inputs[a].style.display = "none";
38
if(inputs[a].checked == true)
39
40
position = "0 -" + (radioHeight*2) + "px";
41
span[a].style.backgroundPosition = "0 -" + (radioHeight*2) + "px";;
span[a].style.backgroundPosition = position;
42
}
43
inputs[a].parentNode.insertBefore(span[a], inputs[a]);
44
inputs[a].onchange = Custom.clear;
<? echo form_tag('post/create', array('method' => 'post', 'enctype' => 'multipart/form-data', 'onsubmit' => "return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})") ) ?><? echo form_tag('post/create', array('method' => 'post', 'enctype' => 'multipart/form-data', 'onsubmit' => "return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})") ) ?><b><label for="text"><? echo __('Как дела? Что делаешь?') ?></label></b><br/><b><label for="text"><? echo __('Как дела? Что делаешь?') ?></label></b><br/><? echo textarea_tag('text', null, array('rows' => 2 , 'cols' => 50)) ?><br/><? echo textarea_tag('text', null, array('rows' => 2 , 'cols' => 50)) ?><br/><label for="mood"><? echo __('Настроение') ?>:</label><div class='mood'><? echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')) ?><label for="mood"><? echo __('Настроение') ?>:</label><? echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')) ?><? echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')) ?><? echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad') ) ?><? echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')) ?><? if(isset($blog_id)): ?><? echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad') ) ?><? echo input_file_tag('picture',array("style" => 'display:none')) ?><? echo link_to_function(__('картинка из файла'), 'showPictureUpload()', array('id' => 'more_file')) ?><? echo input_tag('picture_url', null, array("style" => 'display:none')) ?><? echo link_to_function(__('картинка из URL'), 'showPictureURL()', array('id' => 'more_url')) ?><? echo submit_tag(__('Написать')) ?></div><? if(isset($blog_id)): ?><? echo input_hidden_tag('blog_id', $blog_id) ?><? echo input_hidden_tag('blog_id', $blog_id) ?><? echo input_hidden_tag('mypage', true) ?><? echo input_hidden_tag('mypage', true) ?><? echo input_file_tag('picture',array("style" => 'display:none')) ?><? echo link_to_function(__('картинка из файла'), 'showPictureUpload()', array('id' => 'more_file')) ?><? echo input_tag('picture_url', null, array("style" => 'display:none')) ?><? echo link_to_function(__('картинка из URL'), 'showPictureURL()', array('id' => 'more_url')) ?><? echo submit_tag(__('Написать')) ?>document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; filter: alpha(opacity=0); z-index: 5; }</style>');var Custom = {var Custom = {{{var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active;var inputs = document.getElementsByTagName("input"), span = Array();{{span[a] = document.createElement("span");span[a] = document.createElement("span");{{position = "0 -" + (radioHeight*2) + "px";span[a].style.backgroundPosition = "0 -" + (radioHeight*2) + "px";;span[a].style.backgroundPosition = position;