Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package Make
- */
- ?>
- <script>
- /* based on http://github.com/NV/placeholder.js/ */
- function inputPlaceholder (input, placeholder, color) {
- if (!input) return null;
- var placeholder_color = color || '#AAA';
- var default_color = input.style.color;
- if (input.value === '' || input.value == placeholder) {
- input.value = placeholder;
- input.style.color = placeholder_color;
- }
- var add_event = /*@cc_on'attachEvent'||@*/'addEventListener';
- input[add_event](/*@cc_on'on'+@*/'focus', function(){
- input.style.color = default_color;
- if (input.value == placeholder) {
- input.value = '';
- }
- }, false);
- input[add_event](/*@cc_on'on'+@*/'blur', function(){
- if (input.value === '') {
- input.value = placeholder;
- input.style.color = placeholder_color;
- } else {
- input.style.color = default_color;
- }
- }, false);
- input.form && input.form[add_event](/*@cc_on'on'+@*/'submit', function(){
- if (input.value == placeholder) {
- input.value = '';
- }
- }, false);
- return input;
- }
- function getElementsByClassName(classname, node) {
- if(!node) node = document.getElementsByTagName("body")[0];
- var a = [];
- var re = new RegExp('\\b' + classname + '\\b');
- var els = node.getElementsByTagName("*");
- for(var i=0,j=els.length; i<j; i++)
- if(re.test(els[i].className))a.push(els[i]);
- return a;
- }
- function ecwid_set_placeholder() {
- var search_box = getElementsByClassName('ecwid-SearchPanel-field')[0];
- if (search_box) {
- inputPlaceholder(search_box,'Поиск');
- clearInterval(ecwid_set_placeholder_interval);
- }
- }
- var ecwid_set_placeholder_interval;
- ecwid_set_placeholder_interval = setInterval('ecwid_set_placeholder();',100);
- </script>
- <div class="search-form">
- <div calss="search-field">
- <script type="text/javascript" src="http://app.ecwid.com/script.js?4120544" charset="utf-8"></script>
- <script type="text/javascript"> xSearchPanel("id=my-search-4120544"); </script>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement