<commit_before>'use strict';

angular.module('pw.canvas-painter')
  .directive('pwCanvas', function () {
    return {
      restrict: 'AE',
      scope: {
        options: '='
      },
      templateUrl: '../templates/canvas.html', 
      link: function postLink(scope, el, attrs) {

        var isTouch = true; // !!('ontouchstart' in window);
        var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );

        var PAINT_START = isTouch ? 'touchstart' : 'mousedown';
        var PAINT_MOVE = isTouch ? 'touchmove' : 'mousemove';
        var PAINT_END = isTouch ? 'touchend' : 'mouseup';

        //set default options
        var options = scope.options
        options.width = options.width || 400;
        options.height = options.height || 300;
        options.backgroundColor = options.backgroundColor || '#fff';
        options.color = options.color || '#000';
        options.undoEnabled = options.undoEnabled || false;<commit_msg>added simple touch detection<commit_after>'use strict';

angular.module('pw.canvas-painter')
  .directive('pwCanvas', function () {
    return {
      restrict: 'AE',
      scope: {
        options: '='
      },
      templateUrl: '../templates/canvas.html', 
      link: function postLink(scope, el, attrs) {

        var isTouch = !!('ontouchstart' in window);
        var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );

        var PAINT_START = isTouch ? 'touchstart' : 'mousedown';
        var PAINT_MOVE = isTouch ? 'touchmove' : 'mousemove';
        var PAINT_END = isTouch ? 'touchend' : 'mouseup';

        //set default options
        var options = scope.options
        options.width = options.width || 400;
        options.height = options.height || 300;
        options.backgroundColor = options.backgroundColor || '#fff';
        options.color = options.color || '#000';
        options.undoEnabled = options.undoEnabled || false;
{'fraction_non_alphanumeric': 0.14278350515463917, 'fraction_numerical': 0.009278350515463918, 'mean_word_length': 2.5944444444444446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3252958', 'n_tokens_mistral': 589, 'n_tokens_neox': 563, 'n_words': 129}