Просмотр файла templates/web_default/js/shcms_code.js

Размер файла: 4.97Kb
		(function($) {
		$(function() {

			$('select').selectbox();

			$('#add').click(function(e) {
				$(this).parents('div.section').append('<br /><br /><select><option>-- Выберите --</option><option>Пункт 1</option><option>Пункт 2</option><option>Пункт 3</option><option>Пункт 4</option><option>Пункт 5</option></select>');
				$('select').selectbox();
				e.preventDefault();
			})

			$('#add2').click(function(e) {
				var options = '';
				for (i = 1; i <= 5; i++) {
					options += '<option>Option ' + i + '</option>';
				}
				$(this).parents('div.section').find('select').each(function() {
					$(this).append(options);
				})
				$('select').trigger('refresh');
				e.preventDefault();
			})

			$('#che').click(function(e) {
				$(this).parents('div.section').find('option:nth-child(5)').attr('selected', true);
				$('select').trigger('refresh');
				e.preventDefault();
			})

		})
		})(jQuery)
		
$(document).ready(function() {

	$('#password').keyup(function(){
		$('#result').html(checkStrength($('#password').val()))
	})	
	
	function checkStrength(password){
    
	//initial strength
    var strength = 0
	
    //if the password length is less than 6, return message.
    if (password.length < 6) { 
		$('#result').removeClass()
		$('#result').addClass('short')
		return 'Cлишком короткий' 
	}
    
    //length is ok, lets continue.
	
	//if length is 8 characters or more, increase strength value
	if (password.length > 7) strength += 1
	
	//if password contains both lower and uppercase characters, increase strength value
	if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  strength += 1
	
	//if it has numbers and characters, increase strength value
	if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  strength += 1 
	
	//if it has one special character, increase strength value
    if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/))  strength += 1
	
	//if it has two special characters, increase strength value
    if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
	
	//now we have calculated strength value, we can return messages
	
	//if value is less than 2
	if (strength < 2 ) {
		$('#result').removeClass()
		$('#result').addClass('weak')
		return 'Легкий'			
	} else if (strength == 2 ) {
		$('#result').removeClass()
		$('#result').addClass('good')
		return 'Хороший'		
	} else {
		$('#result').removeClass()
		$('#result').addClass('strong')
		return 'Тяжелый'
	}
}
});		

/*JQUERY UI PARAM VAR*/

  $(function() {
  	
		$( "#dialog" ).dialog({
			autoOpen: false,
			width: 270,
		});

 
    $( "#opener" ).click(function() {
      $( "#dialog" ).dialog( "open" );
    });
  });
    
	$(function() {
		
		$("#datepicker").datepicker($.datepicker.regional["ru"],{dateFormat:'dd.mm.yy'});
		$("#datepicker2").datepicker($.datepicker.regional["ru"],{dateFormat:'dd.mm.yy'});
    
	});
	
	(function($) {
		$(function() {
		
			$('input, select').styler();
		
		});
	});
    
$(document).ready(function() {
 var wbbOpt = {
  lang: "ru"
 }
 $('#editor').wysibb({
        smileList: 
        [
            {title:CURLANG.sm1, img: '<img src="/engine/template/smilies/2.gif" class="sm">', bbcode:":)"},
            {title:CURLANG.sm8, img: '<img src="/engine/template/smilies/3.gif" class="sm">', bbcode:":("},
            {title:CURLANG.sm1, img: '<img src="/engine/template/smilies/1.gif" class="sm">', bbcode:":D"},
            {title:CURLANG.sm3, img: '<img src="/engine/template/smilies/6.gif" class="sm">', bbcode:":so:"},
            {title:CURLANG.sm4, img: '<img src="/engine/template/smilies/11.gif" class="sm">', bbcode:":P"},
            {title:CURLANG.sm5, img: '<img src="/engine/template/smilies/9.gif" class="sm">', bbcode:":ir:"},
            {title:CURLANG.sm6, img: '<img src="/engine/template/smilies/12.gif" class="sm">', bbcode:":cry:"},
            {title:CURLANG.sm7, img: '<img src="/engine/template/smilies/13.gif" class="sm">', bbcode:":rage:"},
            {title:CURLANG.sm9, img: '<img src="/engine/template/smilies/23.gif" class="sm">', bbcode:":think:"},
            {title:CURLANG.sm10, img: '<img src="/engine/template/smilies/14.gif" class="sm">', bbcode:":B"},
            {title:CURLANG.sm11, img: '<img src="/engine/template/smilies/25.gif" class="sm">', bbcode:":roul:"},
            {title:CURLANG.sm12, img: '<img src="/engine/template/smilies/27.gif" class="sm">', bbcode:":o"},
            {title:CURLANG.sm13, img: '<img src="/engine/template/smilies/31.gif" class="sm">', bbcode:":appl:"},
            {title:CURLANG.sm14, img: '<img src="/engine/template/smilies/32.gif" class="sm">', bbcode:":idnk:"},
            {title:CURLANG.sm15, img: '<img src="/engine/template/smilies/45.gif" class="sm">', bbcode:":E"},
            {title:CURLANG.sm16, img: '<img src="/engine/template/smilies/37.gif" class="sm">', bbcode:":alc:"}		
			
			
        ]
    });
});