[*] Modules : use jQuery in blocknewsletter to remove @todo comment - thanks @romainberger
This commit is contained in:
@@ -33,20 +33,31 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<form action="{$link->getPageLink('index')}" method="post">
|
<form action="{$link->getPageLink('index')}" method="post">
|
||||||
<p>
|
<p>
|
||||||
{* @todo use jquery (focusin, focusout) instead of onblur and onfocus *}
|
<input class="inputNew" id="newsletter-input" type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}">
|
||||||
<input type="text" name="email" size="18"
|
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
|
||||||
value="{if isset($value) && $value}{$value}{else}{l s='Your email address' mod='blocknewsletter'}{/if}"
|
|
||||||
onfocus="javascript:if(this.value=='{l s='Your email address' mod='blocknewsletter' js=1}')this.value='';"
|
|
||||||
onblur="javascript:if(this.value=='')this.value='{l s='Your email address' mod='blocknewsletter' js=1}';"
|
|
||||||
class="inputNew" />
|
|
||||||
<!--<select name="action">
|
|
||||||
<option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option>
|
|
||||||
<option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option>
|
|
||||||
</select>-->
|
|
||||||
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
|
|
||||||
<input type="hidden" name="action" value="0" />
|
<input type="hidden" name="action" value="0" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /Block Newsletter module-->
|
<!-- /Block Newsletter module-->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var placeholder = "{l s='your e-mail' mod='blocknewsletter' js=1}";
|
||||||
|
{literal}
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#newsletter-input').on({
|
||||||
|
focus: function() {
|
||||||
|
if ($(this).val() == placeholder) {
|
||||||
|
$(this).val('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
blur: function() {
|
||||||
|
if ($(this).val() == '') {
|
||||||
|
$(this).val(placeholder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
<!-- Block Newsletter module-->
|
<!-- Block Newsletter module-->
|
||||||
|
|
||||||
<div id="newsletter_block_left" class="block">
|
<div id="newsletter_block_left" class="block">
|
||||||
<p class="title_block">{l s='Newsletter' mod='blocknewsletter'}</p>
|
<p class="title_block">{l s='Newsletter' mod='blocknewsletter'}</p>
|
||||||
<div class="block_content">
|
<div class="block_content">
|
||||||
@@ -32,16 +33,31 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<form action="{$link->getPageLink('index')}" method="post">
|
<form action="{$link->getPageLink('index')}" method="post">
|
||||||
<p>
|
<p>
|
||||||
{* @todo use jquery (focusin, focusout) instead of onblur and onfocus *}
|
<input class="inputNew" id="newsletter-input" type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}">
|
||||||
<input type="text" name="email" size="18"
|
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
|
||||||
value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}"
|
|
||||||
onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter' js=1}')this.value='';"
|
|
||||||
onblur="javascript:if(this.value=='')this.value='{l s='your e-mail' mod='blocknewsletter' js=1}';"
|
|
||||||
class="inputNew" />
|
|
||||||
<input type="submit" value="ok" class="button_mini" name="submitNewsletter" />
|
|
||||||
<input type="hidden" name="action" value="0" />
|
<input type="hidden" name="action" value="0" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /Block Newsletter module-->
|
<!-- /Block Newsletter module-->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var placeholder = "{l s='your e-mail' mod='blocknewsletter' js=1}";
|
||||||
|
{literal}
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#newsletter-input').on({
|
||||||
|
focus: function() {
|
||||||
|
if ($(this).val() == placeholder) {
|
||||||
|
$(this).val('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
blur: function() {
|
||||||
|
if ($(this).val() == '') {
|
||||||
|
$(this).val(placeholder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user