<?php
include_once("c_demo_sign.php");
class c_page_cab_demo_sign_v2 extends c_page_cab_demo_sign
{
  public $h1='Магнит - Проверка плагинов экранной подписи 2' ;


 function block_main()
 { $this->page_title() ;
  ?><style>
	* {
		-webkit-user-select: none;
		-moz-user-select: none;
		user-select: none;
	}


	fieldset {
		position: absolute;
		border: 5px solid #aaa;
		background: #aaa;
		right: 0px;
		bottom: 0px;
	}
	canvas {
		outline: 5px solid #aaa;
		background: #fff;
	}
	input[type=submit], input[type=reset] {
		font-size: larger;
	}
  </style>
  <link rel="stylesheet" href="/<?echo _CLASS_LOCAL_?>/ext/demo_sign/signature-pad-master/assets/jquery.signaturepad.css">
  <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>-->
	<form method="POST" action="">
		<canvas class="pad"></canvas>
		<fieldset>
			<input type="reset" value="clear" />
		</fieldset>
	</form>

  <script src="/<?echo _CLASS_LOCAL_?>/ext/demo_sign/signature-pad-master/jquery.signaturepad.js"></script>
  <button id="test_sign">test</button>
  <script>
  var api ;
  (function(window) {
    var $canvas,
        onResize = function(event) {
          $canvas.attr({
            height: 400,
            width: 700
          });
        };

    $j(document).ready(function() {
      $canvas = $j('canvas');
      window.addEventListener('orientationchange', onResize, false);
      window.addEventListener('resize', onResize, false);
      onResize();

      api =$j('form').signaturePad({
        drawOnly: true,
        defaultAction: 'drawIt',
        validateFields: false,
        lineWidth: 0,
        output: null,
        sigNav: null,
        name: null,
        typed: null,
        clear: 'input[type=reset]',
        typeIt: null,
        drawIt: null,
        typeItDesc: null,
        drawItDesc: null
      });



    });



  }(this));

  $j('body').on('click','button#test_sign',test_sign) ;

  function test_sign()
  {

      var sig = api.getSignatureImage();
      console.log(sig) ;
  }
  </script>
  <script src="/<?echo _CLASS_LOCAL_?>/ext/demo_sign/signature-pad-master/assets/json2.min.js"></script>
   <?

 }








}



?>
