static/kelmu.editor.js
function() {
      element.find('a, button').mousemove(function(e) {
        if (buttonPickerEnabled) {
          if (e.target !== buttonToPickElement) {
            buttonToPickCounter = 0;
            buttonToPickElement = e.target;
          }

          buttonToPickCounter += 1;
          if (buttonToPickCounter > 50) {
            element.find('a, button').css('border', '');
            $(e.target).css('border', 'solid 2px green');

            var createSelector = function(element) {
              if (element.attr('id')) {
                return '#' + element.attr('id');
              } else {
                var classes = element.attr('class').split(/\s/);
                return classes.map(function(x) {
                  return '.' + x;
                }).join('');
              }
            };

            if (buttonToPick === 'undo') {
              editor.find('.kelmu-editor-undo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'redo') {
              editor.find('.kelmu-editor-redo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'step') {
              editor.find('.kelmu-editor-step-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'begin') {
              editor.find('.kelmu-editor-begin-button').val(createSelector($(e.target)));
            }

            buttonPickerEnabled = false;
            buttonToPickCounter = 0;

            setTimeout(function() {
              element.find('a, button').css('border', '');
            }, 5000);

          }
        }
      });
      buttonPickerCreated = true;
    }
function() {
      element.find('a, button').mousemove(function(e) {
        if (buttonPickerEnabled) {
          if (e.target !== buttonToPickElement) {
            buttonToPickCounter = 0;
            buttonToPickElement = e.target;
          }

          buttonToPickCounter += 1;
          if (buttonToPickCounter > 50) {
            element.find('a, button').css('border', '');
            $(e.target).css('border', 'solid 2px green');

            var createSelector = function(element) {
              if (element.attr('id')) {
                return '#' + element.attr('id');
              } else {
                var classes = element.attr('class').split(/\s/);
                return classes.map(function(x) {
                  return '.' + x;
                }).join('');
              }
            };

            if (buttonToPick === 'undo') {
              editor.find('.kelmu-editor-undo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'redo') {
              editor.find('.kelmu-editor-redo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'step') {
              editor.find('.kelmu-editor-step-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'begin') {
              editor.find('.kelmu-editor-begin-button').val(createSelector($(e.target)));
            }

            buttonPickerEnabled = false;
            buttonToPickCounter = 0;

            setTimeout(function() {
              element.find('a, button').css('border', '');
            }, 5000);

          }
        }
      });
      buttonPickerCreated = true;
    }
function ( ) { element . find ( 'a, button' ) . mousemove ( function ( e ) { if ( buttonPickerEnabled ) { if ( e . target !== buttonToPickElement ) { buttonToPickCounter = 0 ; buttonToPickElement = e . target ; } buttonToPickCounter += 1 ; if ( buttonToPickCounter > 50 ) { element . find ( 'a, button' ) . css ( 'border' , '' ) ; $ ( e . target ) . css ( 'border' , 'solid 2px green' ) ; var createSelector = function ( element ) { if ( element . attr ( 'id' ) ) { return '#' + element . attr ( 'id' ) ; } else { var classes = element . attr ( 'class' ) . split ( / \s / ) ; return classes . map ( function ( x ) { return '.' + x ; } ) . join ( '' ) ; } } ; if ( buttonToPick === 'undo' ) { editor . find ( '.kelmu-editor-undo-button' ) . val ( createSelector ( $ ( e . target ) ) ) ; } else if ( buttonToPick === 'redo' ) { editor . find ( '.kelmu-editor-redo-button' ) . val ( createSelector ( $ ( e . target ) ) ) ; } else if ( buttonToPick === 'step' ) { editor . find ( '.kelmu-editor-step-button' ) . val ( createSelector ( $ ( e . target ) ) ) ; } else if ( buttonToPick === 'begin' ) { editor . find ( '.kelmu-editor-begin-button' ) . val ( createSelector ( $ ( e . target ) ) ) ; } buttonPickerEnabled = false ; buttonToPickCounter = 0 ; setTimeout ( function ( ) { element . find ( 'a, button' ) . css ( 'border' , '' ) ; } , 5000 ) ; } } } ) ; buttonPickerCreated = true ; }
Traces mouse moves above buttons in order to bind animation buttons with Kelmu.
Traces mouse moves above buttons in order to bind animation buttons with Kelmu .