We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Переключатели ON/OFF | Forum

Ivan Kovalev
Ivan Kovalev Mar 14 '13
Недавно мною было найдено вот это чудо)) proto.io/freebies/onoff/
Сие чудо создает на чистом CSS переключатели аля iOs & Android и др.

код который они предлагают выглядит следующим образом:

...
<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
<label class="onoffswitch-label" for="myonoffswitch">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
...


В Oxwall, например, в файле ow_system_plugins/base/views/controllers/user_search_index.html код выглядит так:


<td class="ow_label">
{label name=$question.name}
</td>
<td class="ow_value">
{input name=$question.name}
<div style="height:1px;"></div>
{error name=$question.name}
</td>


В исходном коде страницы, все выглядит так:


<tr class="ow_alt1 ">
<td class="ow_label">
<label>Пол</label>
</td>
<td class="ow_value">
<ul class="ow_checkbox_group clearfix">
<li style="width:100%">
<input name="sex[]" id="input_52438355" type="checkbox" value="1">
<label for="input_52438355">Мужской</label>
</li>
<li style="width:100%">
<input name="sex[]" id="input_42517090" type="checkbox" value="2">
<label for="input_42517090">Женский</label>
</li>
</ul>
<div style="height:1px;"></div>
<span id="input_42517090_error" style="display:none;" class="error"></span>
</td>
</tr>


Что весьма фигово, ибо не ясно где и как генерируется из тех переменных такие куски кода, не ясно как id инпута генерится, каким образом указать лейблу на id инпута, кто-нибудь, что-нибудь шарит где и как рождаются переменные для лейбла, которые в свою очередь нужны для привязки к инпуту?


пока смог сделать только так:


<td class="ow_label">
<div class="onoffswitch">
{input name=$action.action id=$action.action class="onoffswitch-checkbox"}
<label class="onoffswitch-label" for="{$action.action}">
<!--{label class="onoffswitch-label" name=$action.action}-->
<div class="onoffswitch-inner">
<div class="onoffswitch-active"><div class="onoffswitch-switch">YES</div></div>
<div class="onoffswitch-inactive"><div class="onoffswitch-switch">NO</div></div>
</div>
</label>
</div>
</td>

(это отсюда: ow_plugins/notifications/views/controllers/notifications_settings.html)



The Forum post is edited by Ivan Kovalev Mar 14 '13
Attachments:
  Безымянный.png (5.95Kb)
REHMAN
REHMAN Feb 21
every woman needs fine jewelries because it becomes a fashion statement of your personality; website
REHMAN
REHMAN Feb 26
Hi, I just ran across your weblog via Bing. Your viewpoint is truly pertinent to my life right now, and I’m really pleased I discovered your website. get paid playing games
REHMAN
REHMAN Mar 9
A cool article at that time partner ! Regards for that article . webpage
REHMAN
REHMAN Mar 16
This unique website is amazing. We continually come upon something new as well as various appropriate here. Thank you for which information. topcer88 slot
REHMAN
REHMAN Mar 16
This unique website is amazing. We continually come upon something new as well as various appropriate here. Thank you for which information. topcer88 slot
REHMAN
REHMAN Mar 21
The the next occasion Someone said a weblog, Hopefully it doesnt disappoint me just as much as this place. I mean, I know it was my choice to read, but I actually thought youd have something fascinating to say. All I hear is a lot of whining about something that you could fix if you werent too busy in search of attention. 오피쓰
REHMAN
REHMAN Mar 25
Countless online communities include singles organizations of which attempt enjoyment boca raton breast lift pursuits mutually, and this also is actually wonderful substitute adult dating technique. Activities for instance pedaling, bowling, curling, motion picture a short time, dance and also humor golf equipment are sorted because of the singles party, but it lets an evenly-distributed group of contributors to acquire an exciting along with unconventional night time. By using concentration don that exercise once more rather then building a amorous association, it will take a lot of strain over singles as well as attractions manifest far more normally inside this type of setting up. Home of Football News
REHMAN
REHMAN Mar 25
Right wow messages are bound to show your and supply memorialize the speacial couple. Beginner sound system to high in volume crowds should always take a look at all of the wonderful value behind presenting and public speaking, which is to be someone’s truck. best man speeches brother login topcer88
REHMAN
REHMAN Mar 26
I am glad to read this post, it’s an impressive one. I am always searching for good posts and articles and this is what I found here, I hope you will be adding more in future. erotik film izle
REHMAN
REHMAN Mar 26
Hello there, simply become aware of your weblog thru Google, and located that it is really informative. I’m going to be careful for brussels. I’ll be grateful when you continue this in future. Numerous people shall be benefited from your writing. Cheers! Healthy Way of Living
REHMAN
REHMAN Mar 27
You could certainly see your enthusiasm in the paintings you write. The sector hopes for even more passionate writers such as you who are not afraid to mention how they believe. Always go after your heart. login topcer88
REHMAN
REHMAN Apr 15
There is perceptibly a lot to identify about this. I believe you made various good points in features also. Fintech Zoom
REHMAN
REHMAN Apr 17
It’s how you can tell if a is actually working or otherwise. Nhà cái 78Win
REHMAN
REHMAN Apr 17
It’s how you can tell if a is actually working or otherwise. Nhà cái 78Win