de-IDifying labels in notice form to fix issue with geo pin activating the wrong place when cloning the form

Note that changes to the attachment from <label for/><input id/> to <label><input></label> affect some of the existing styles which attempt to place them both in the same place based on having a common parent. Only 'neo' has been fully tested and fixed for this case, as the others all fail due to the new layout anyway. :)
This commit is contained in:
Brion Vibber 2011-03-08 12:01:12 -08:00
parent 9185364f5a
commit ba1ada2880
34 changed files with 111 additions and 98 deletions

View File

@ -187,12 +187,14 @@ class NoticeForm extends Form
if (common_config('attachments', 'uploads')) { if (common_config('attachments', 'uploads')) {
$this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
// TRANS: Input label in notice form for adding an attachment. // TRANS: Input label in notice form for adding an attachment.
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); $this->out->elementStart('label', array('class' => 'notice_data-attach'));
$this->out->element('input', array('id' => 'notice_data-attach', $this->out->text(_('Attach'));
$this->out->element('input', array('class' => 'notice_data-attach',
'type' => 'file', 'type' => 'file',
'name' => 'attach', 'name' => 'attach',
// TRANS: Title for input field to attach a file to a notice. // TRANS: Title for input field to attach a file to a notice.
'title' => _('Attach a file.'))); 'title' => _('Attach a file.')));
$this->out->elementEnd('label');
} }
if ($this->action) { if ($this->action) {
$this->out->hidden('notice_return-to', $this->action, 'returnto'); $this->out->hidden('notice_return-to', $this->action, 'returnto');
@ -210,6 +212,7 @@ class NoticeForm extends Form
// @fixme checkbox method allows no way to change the id without changing the name // @fixme checkbox method allows no way to change the id without changing the name
//$this->out->checkbox('notice_data-geo', _('Share my location'), true); //$this->out->checkbox('notice_data-geo', _('Share my location'), true);
$this->out->elementStart('label', 'notice_data-geo');
$this->out->element('input', array( $this->out->element('input', array(
'name' => 'notice_data-geo', 'name' => 'notice_data-geo',
'type' => 'checkbox', 'type' => 'checkbox',
@ -218,10 +221,9 @@ class NoticeForm extends Form
'checked' => true, // ? 'checked' => true, // ?
)); ));
$this->out->text(' '); $this->out->text(' ');
$this->out->element('label', array('class' => 'notice_data-geo',
'for' => $this->id() . '-notice_data-geo'),
// TRANS: Field label to add location to a notice. // TRANS: Field label to add location to a notice.
_('Share my location')); $this->out->text(_('Share my location'));
$this->out->elementEnd('label');
$this->out->elementEnd('div'); $this->out->elementEnd('div');
// TRANS: Text to not share location for a notice in notice form. // TRANS: Text to not share location for a notice in notice form.

View File

@ -108,7 +108,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
#form_notice label[for="notice_data-attach"] { #form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -17,13 +17,13 @@ max-width:451px;
display:none; display:none;
} }
.realtime-popup #form_notice label[for=notice_data-attach], .realtime-popup #form_notice label.notice_data-attach,
.realtime-popup #form_notice #notice_data-attach, .realtime-popup #form_notice input.notice_data-attach,
.realtime-popup #form_notice label.notice_data-geo { .realtime-popup #form_notice label.notice_data-geo {
top:0; top:0;
} }
.realtime-popup #form_notice #notice_data-attach { .realtime-popup #form_notice input.notice_data-attach {
left:auto; left:auto;
right:0; right:0;
} }

View File

@ -597,19 +597,19 @@ float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px; margin-bottom:7px;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:absolute; position:absolute;
top:25px; top:25px;
right:10.5%; right:10.5%;
cursor:pointer; cursor:pointer;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
width:16px; width:16px;
height:16px; height:16px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
padding:0; padding:0;
height:16px; height:16px;
} }

View File

@ -462,11 +462,11 @@ float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px; margin-bottom:7px;
} }
#form_notice label[for=notice_data-attach] { #form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
} }
#form_notice label[for=notice_data-attach], #form_notice label.notice_data-attach,
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
position:absolute; position:absolute;
top:25px; top:25px;
right:49px; right:49px;
@ -474,7 +474,7 @@ width:16px;
height:16px; height:16px;
cursor:pointer; cursor:pointer;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
text-indent:-279px; text-indent:-279px;
} }
#form_notice #notice_submit label { #form_notice #notice_submit label {

View File

@ -172,14 +172,14 @@ color:#333333;
#form_notice.warning .count { #form_notice.warning .count {
color:#000000; color:#000000;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,

View File

@ -114,8 +114,8 @@ address {
height: 54px; height: 54px;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
top: 27px; top: 27px;
} }

View File

@ -61,7 +61,7 @@ line-height:auto;
color:#FFFFFF; color:#FFFFFF;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }

View File

@ -94,7 +94,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
.form_notice label[for="notice_data-attach"] { .form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -161,8 +161,8 @@ address {
border-radius: 6px; border-radius: 6px;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
top: 27px; top: 27px;
right: 86px; right: 86px;
} }
@ -594,7 +594,7 @@ padding-right:0;
right: 6px !important; right: 6px !important;
} }
.realtime-popup .form_notice label[for=notice_data-attach], .realtime-popup .form_notice #notice_data-attach { .realtime-popup .form_notice label.notice_data-attach, .realtime-popup .form_notice input.notice_data-attach {
right: 74px; right: 74px;
top: 3px !important; top: 3px !important;
} }

View File

@ -65,7 +65,7 @@ line-height:auto;
color:#FFFFFF; color:#FFFFFF;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }

View File

@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
.form_notice label[for="notice_data-attach"] { .form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -493,19 +493,19 @@ float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px; margin-bottom:7px;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:absolute; position:absolute;
top:25px; top:25px;
right:10.5%; right:10.5%;
cursor:pointer; cursor:pointer;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
width:16px; width:16px;
height:16px; height:16px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
padding:0; padding:0;
height:16px; height:16px;
} }
@ -1602,7 +1602,7 @@ background:none;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,
@ -1787,10 +1787,10 @@ color:#000000;
#form_notice.warning .count { #form_notice.warning .count {
color:#000000; color:#000000;
} }
#form_notice label[for=notice_data-attach] { #form_notice label.notice_data-attach {
background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%; background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }

View File

@ -34,7 +34,7 @@ height:16px;
width:16px; width:16px;
display:block; display:block;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
filter: alpha(opacity = 0); filter: alpha(opacity = 0);
left:33.5%; left:33.5%;
} }

View File

@ -152,14 +152,14 @@ color:#333333;
.entity_actions .dialogbox input { .entity_actions .dialogbox input {
color:#000000; color:#000000;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,

View File

@ -16,7 +16,7 @@ background-color:#C8D1D5;
.form_notice .count + label { .form_notice .count + label {
background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }
.notice-options form.form_favor input.submit { .notice-options form.form_favor input.submit {

View File

@ -153,14 +153,14 @@ color:#333333;
.entity_actions .dialogbox input { .entity_actions .dialogbox input {
color:#000000; color:#000000;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,

View File

@ -16,7 +16,7 @@ background-color:#D9DADB;
.form_notice .count + label { .form_notice .count + label {
background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }
.notice-options form.form_favor input.submit { .notice-options form.form_favor input.submit {

View File

@ -234,7 +234,7 @@ p.instructions {
/*-- FORMS --*/ /*-- FORMS --*/
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,
@ -292,7 +292,7 @@ button.minimize,
.form_notice label.notice_data-geo.checked { .form_notice label.notice_data-geo.checked {
background-position:0 -1846px; background-position:0 -1846px;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
button.close { button.close {
@ -937,19 +937,19 @@ z-index:2;
.form_notice label { .form_notice label {
float:left; float:left;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:absolute; position:absolute;
top:2em; top:2em;
right: 3em; right: 3em;
cursor:pointer; cursor:pointer;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
width:16px; width:16px;
height:16px; height:16px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity: 0; opacity: 0;
padding:0; padding:0;
height:1.6em; height:1.6em;

View File

@ -45,7 +45,7 @@ padding:0 4px;
background:transparent url(../images/icons/icons-01.png) no-repeat 0 -328px; background:transparent url(../images/icons/icons-01.png) no-repeat 0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }
.form_notice .notice_data-geo_wrap label { .form_notice .notice_data-geo_wrap label {

View File

@ -114,7 +114,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
#form_notice label[for="notice_data-attach"] { #form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -160,8 +160,7 @@ address {
border-radius: 6px; border-radius: 6px;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach {
.form_notice #notice_data-attach {
top: 27px; top: 27px;
right: 86px; right: 86px;
} }
@ -612,7 +611,7 @@ padding-right:0;
right: 6px !important; right: 6px !important;
} }
.realtime-popup .form_notice label[for=notice_data-attach], .realtime-popup .form_notice #notice_data-attach { .realtime-popup .form_notice label.notice_data-attach, .realtime-popup .form_notice input.notice_data-attach {
right: 74px; right: 74px;
top: 3px !important; top: 3px !important;
} }

View File

@ -22,11 +22,11 @@ display:block;
width: 106px; width: 106px;
max-width: 106px; max-width: 106px;
} }
.form_notice #notice_data-attach_selected, .form_notice input.notice_data-attach_selected,
.form_notice #notice_data-geo_selected { .form_notice #notice_data-geo_selected {
width:78.75%; width:78.75%;
} }
.form_notice #notice_data-attach_selected button, .form_notice input.notice_data-attach_selected button,
.form_notice #notice_data-geo_selected button { .form_notice #notice_data-geo_selected button {
padding:0 4px; padding:0 4px;
} }
@ -65,7 +65,7 @@ line-height:auto;
color:#FFFFFF; color:#FFFFFF;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }

View File

@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
.form_notice label[for="notice_data-attach"] { .form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -450,19 +450,24 @@ float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px; margin-bottom:7px;
} }
#form_notice label[for=notice_data-attach], #form_notice label.notice_data-attach,
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
position:absolute; position:absolute;
top:25px;
cursor:pointer; cursor:pointer;
} }
#form_notice label[for=notice_data-attach] { #form_notice label.notice_data-attach {
top:25px;
}
#form_notice input.notice_data-attach {
top:0;
}
#form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
left:394px; left:394px;
width:16px; width:16px;
height:16px; height:16px;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
left:183px; left:183px;
padding:0; padding:0;
height:16px; height:16px;

View File

@ -192,14 +192,14 @@ color:#333333;
#form_notice.warning .count { #form_notice.warning .count {
color:#000000; color:#000000;
} }
#form_notice label[for=notice_data-attach] { #form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,

View File

@ -226,21 +226,28 @@ address .poweredby {
color: #333 !important; color: #333 !important;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:absolute; position:absolute;
top: 31px;
right: 88px;
cursor:pointer; cursor:pointer;
} }
.form_notice label.notice_data-attach {
top: 31px;
right: 88px;
}
.form_notice input.notice_data-attach {
/* Positioned inside the label */
top: 0;
right: 0;
}
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
text-indent:-9999px; text-indent:-9999px;
width:16px; width:16px;
height:16px; height:16px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
padding:0; padding:0;
height:16px; height:16px;
} }
@ -348,7 +355,7 @@ address .poweredby {
opacity: 1; opacity: 1;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
@ -1724,7 +1731,7 @@ body.realtime-popup {
width: 86px; width: 86px;
} }
.realtime-popup .form_notice label[for=notice_data-attach], .form_notice #notice_data-attach { .realtime-popup .form_notice label.notice_data-attach {
right: 70px; right: 70px;
} }
@ -1734,7 +1741,7 @@ body.realtime-popup {
/* icons */ /* icons */
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,
@ -1921,7 +1928,7 @@ background-position:0 -1648px;
#new_group a { #new_group a {
background-position:0 -1054px; background-position:0 -1054px;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position: 0 -328px; background-position: 0 -328px;
} }
.form_notice label.notice_data-geo { .form_notice label.notice_data-geo {

View File

@ -61,7 +61,7 @@ line-height:auto;
color:#FFFFFF; color:#FFFFFF;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }

View File

@ -230,8 +230,8 @@ h6 {font-size: 1em;}
border: 1px solid #9495b7; border: 1px solid #9495b7;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
top: 27px; top: 27px;
right: 86px; right: 86px;
} }

View File

@ -63,7 +63,7 @@ line-height:auto;
color:#FFFFFF; color:#FFFFFF;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }

View File

@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
.form_notice label[for="notice_data-attach"] { .form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;

View File

@ -328,15 +328,15 @@ a,
color:#000000; color:#000000;
} }
.form_notice label[for=notice_data-attach] { .form_notice label.notice_data-attach {
background-position:0 -328px; background-position:0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
opacity:0; opacity:0;
} }
.form_notice label[for=notice_data-attach], .form_notice label.notice_data-attach,
#export_data li a.rss, #export_data li a.rss,
#export_data li a.atom, #export_data li a.atom,
#export_data li a.foaf, #export_data li a.foaf,

View File

@ -9,7 +9,7 @@ background-color:#C8D1D5;
.form_notice .count + label { .form_notice .count + label {
background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px;
} }
.form_notice #notice_data-attach { .form_notice input.notice_data-attach {
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }
.notice-options form.form_favor input.submit { .notice-options form.form_favor input.submit {

View File

@ -109,7 +109,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator
#form_notice label[for="notice_data-attach"] { #form_notice label[for="notice_data-attach"] {
display:none; display:none;
} }
#form_notice #notice_data-attach { #form_notice input.notice_data-attach {
position:static; position:static;
clear:both; clear:both;
width:65%; width:65%;