var NLN = ''; // @fixme
var NDGe = form.find('[name=notice_data-geo]');
var check = form.find('[name=notice_data-geo]');
- var label = $('label[for='+check.attr('id')+']');
+ var label = form.find('label.notice_data-geo');
function removeNoticeDataGeo(error) {
label
*/
NoticeGeoStatus: function(form, status, lat, lon, url)
{
- var form = $('#form_notice');
var wrapper = form.find('.geo_status_wrapper');
if (wrapper.length == 0) {
wrapper = $('<div class="'+SN.C.S.Success+' geo_status_wrapper"><button class="close" style="float:right">×</button><div class="geo_status"></div></div>');
function __construct($out=null, $action=null, $content=null, $user=null, $inreplyto=null, $lat=null, $lon=null, $location_id=null, $location_ns=null)
{
+ $this->id_suffix = time();
+
parent::__construct($out);
$this->action = $action;
function id()
{
- return 'form_notice';
+ return 'form_notice_' . $this->id_suffix;
}
/**
$this->out->elementStart('div', array('class' => 'notice_data-geo_wrap',
'title' => common_local_url('geocode')));
- $this->out->checkbox('notice_data-geo', _('Share my location'), true);
+
+ // @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->element('input', array(
+ 'name' => 'notice_data-geo',
+ 'type' => 'checkbox',
+ 'class' => 'checkbox',
+ 'id' => $this->id() . '-notice_data-geo',
+ 'checked' => true, // ?
+ ));
+ $this->out->text(' ');
+ $this->out->element('label', array('class' => 'notice_data-geo',
+ 'for' => $this->id() . '-notice_data-geo'),
+ _('Share my location'));
+
$this->out->elementEnd('div');
$this->out->inlineScript(' var NoticeDataGeo_text = {'.
'ShareDisable: ' .json_encode(_('Do not share my location')).','.
.realtime-popup #form_notice label[for=notice_data-attach],
.realtime-popup #form_notice #notice_data-attach,
-.realtime-popup #form_notice label[for=notice_data-geo] {
+.realtime-popup #form_notice label.notice_data-geo {
top:0;
}
text-shadow:none;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
.entity_silence input.submit,
.entity_delete input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
.form_notice a#notice_data-geo_name {
background-position:0 -1711px;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
text-shadow:none;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
text-shadow:none;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
background-color:transparent;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.form_notice label[for=notice_data-attach] {
text-shadow:none;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.entity_silence input.submit,
.entity_delete input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,
.form_notice label[for=notice_data-attach] {
background-position: 0 -328px;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position: 0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position: 0 -1846px;
}
text-shadow:none;
}
-.form_notice label[for=notice_data-geo] {
+.form_notice label.notice_data-geo {
background-position:0 -1780px;
}
-.form_notice label[for=notice_data-geo].checked {
+.form_notice label.notice_data-geo.checked {
background-position:0 -1846px;
}
.entity_role_administrator input.submit,
.entity_role_moderator input.submit,
.notice-options .repeated,
-.form_notice label[for=notice_data-geo],
+.form_notice label.notice_data-geo,
button.minimize,
.form_reset_key input.submit,
.entity_clear input.submit,