public/js/editor.js
function(data, name, $field, $el, field, callback) {
      data[name] = $field.val();
      if (field.required && !data[name].length) {
        return apos.afterYield(_.partial(callback, 'required'));
      }
      if (field.max && (data[name].length > field.max)) {
        var $fieldset = self.findFieldset($el, name);
        $fieldset.addClass('apos-error-max');
        return apos.afterYield(_.partial(callback, 'max'));
      }
      return apos.afterYield(callback);
    }
function(data, name, $field, $el, field, callback) {
      data[name] = $field.val();
      if (field.required && !data[name].length) {
        return apos.afterYield(_.partial(callback, 'required'));
      }
      if (field.max && (data[name].length > field.max)) {
        var $fieldset = self.findFieldset($el, name);
        $fieldset.addClass('apos-error-max');
        return apos.afterYield(_.partial(callback, 'max'));
      }
      return apos.afterYield(callback);
    }
function ( data , name , $field , $el , field , callback ) { data [ name ] = $field . val ( ) ; if ( field . required && ! data [ name ] . length ) { return apos . afterYield ( _ . partial ( callback , 'required' ) ) ; } if ( field . max && ( data [ name ] . length > field . max ) ) { var $fieldset = self . findFieldset ( $el , name ) ; $fieldset . addClass ( 'apos-error-max' ) ; return apos . afterYield ( _ . partial ( callback , 'max' ) ) ; } return apos . afterYield ( callback ) ; }
The rest are very simple because the server does the serious sanitization work and the representation in the DOM is a simple form element
The rest are very simple because the server does the serious sanitization work and the representation in the DOM is a simple form element