Skip to content

Instantly share code, notes, and snippets.

@raphlinus
Created December 29, 2017 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphlinus/d346636c9fd07614eb3b07dca9bedaa6 to your computer and use it in GitHub Desktop.
Save raphlinus/d346636c9fd07614eb3b07dca9bedaa6 to your computer and use it in GitHub Desktop.
A typical xi-editor update notification sampled from an edit session
{"method":"update","params":{"update":{"ops":[{"n":6374,"op":"invalidate"},{"n":18,"op":"invalidate"},{"n":87,"op":"invalidate"},{"n":101,"op":"invalidate"},{"n":6580,"op":"skip"},{"n":56,"op":"copy"},{"n":63,"op":"invalidate"},{"n":63,"op":"skip"},{"n":56,"op":"copy"},{"n":61,"op":"invalidate"},{"n":61,"op":"skip"},{"n":56,"op":"copy"},{"n":59,"op":"invalidate"},{"n":59,"op":"skip"},{"n":56,"op":"copy"},{"n":57,"op":"invalidate"},{"n":57,"op":"skip"},{"n":56,"op":"copy"},{"n":55,"op":"invalidate"},{"n":55,"op":"skip"},{"n":56,"op":"copy"},{"n":53,"op":"invalidate"},{"n":53,"op":"skip"},{"n":56,"op":"copy"},{"n":52,"op":"invalidate"},{"n":52,"op":"skip"},{"n":56,"op":"copy"},{"n":49,"op":"invalidate"},{"lines":[{"styles":[0,1,3,0,5,5,0,6,3,0,1,4,0,1,3,0,7,6,0,2,3],"text":"\tinput.type = \"radio\";\n"},{"styles":[0,1,3,0,7,5,0,12,3,0,1,4,0,1,3,0,5,5,0,7,3,0,3,4,0,1,3,0,3,6,0,2,3],"text":"\tsupport.radioValue = input.value === \"t\";\n"},{"styles":[0,7,3],"text":"} )();\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,3,4,0,1,3,0,8,5,0,2,3],"text":"var boolHook,\n"},{"styles":[0,1,3,0,10,5,0,1,3,0,1,4,0,1,3,0,6,5,0,18,3],"text":"\tattrHandle = jQuery.expr.attrHandle;\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,6,5,0,4,3,0,6,5,0,4,3],"text":"jQuery.fn.extend( {\n"},{"styles":[0,1,3,0,4,9,0,2,3,0,8,4,0,2,3,0,4,5,0,2,3,0,5,5,0,5,3],"text":"\tattr: function( name, value ) {\n"},{"styles":[0,2,3,0,6,4,0,1,3,0,6,5,0,2,3,0,4,8,0,2,3,0,6,5,0,7,3,0,4,5,0,2,3,0,5,5,0,2,3,0,9,5,0,8,3,0,1,4,0,1,3,0,1,7,0,4,3],"text":"\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n"},{"styles":[0,4,3],"text":"\t},\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,1,3,0,10,9,0,2,3,0,8,4,0,2,3,0,4,5,0,5,3],"text":"\tremoveAttr: function( name ) {\n"},{"styles":[0,2,3,0,6,4,0,1,3,0,4,8,0,1,3,0,4,5,0,2,3,0,8,4,0,5,3],"text":"\t\treturn this.each( function() {\n"},{"styles":[0,3,3,0,6,5,0,1,3,0,10,5,0,2,3,0,4,8,0,2,3,0,4,5,0,4,3],"text":"\t\t\tjQuery.removeAttr( this, name );\n"},{"styles":[0,7,3],"text":"\t\t} );\n"},{"styles":[0,3,3],"text":"\t}\n"},{"styles":[0,5,3],"text":"} );\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,6,5,0,1,3,0,6,5,0,4,3],"text":"jQuery.extend( {\n"},{"styles":[0,1,3,0,4,9,0,2,3,0,8,4,0,2,3,0,4,5,0,2,3,0,4,5,0,2,3,0,5,5,0,5,3],"text":"\tattr: function( elem, name, value ) {\n"},{"styles":[0,2,3,0,3,4,0,1,3,0,3,5,0,2,3,0,5,5,0,2,3],"text":"\t\tvar ret, hooks,\n"},{"styles":[0,3,3,0,5,5,0,1,3,0,1,4,0,1,3,0,4,5,0,11,3],"text":"\t\t\tnType = elem.nodeType;\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,2,3,0,65,2],"text":"\t\t// Don't get/set attributes on text, comment and attribute nodes\n"},{"styles":[0,2,3,0,2,4,0,3,3,0,5,5,0,1,3,0,3,4,0,1,3,0,1,7,0,1,3,0,2,4,0,1,3,0,5,5,0,1,3,0,3,4,0,1,3,0,1,7,0,1,3,0,2,4,0,1,3,0,5,5,0,1,3,0,3,4,0,1,3,0,1,7,0,5,3],"text":"\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n"},{"styles":[0,3,3,0,6,4,0,2,3],"text":"\t\t\treturn;\n"},{"styles":[0,4,3],"text":"\t\t}\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,2,3,0,54,2],"text":"\t\t// Fallback to prop when attributes are not supported\n"},{"styles":[0,2,3,0,2,4,0,3,3,0,6,4,0,1,3,0,4,5,0,14,3,0,3,4,0,1,3,0,11,6,0,5,3],"text":"\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n"},{"styles":[0,3,3,0,6,4,0,1,3,0,6,5,0,1,3,0,4,5,0,2,3,0,4,5,0,2,3,0,4,5,0,2,3,0,5,5,0,4,3],"text":"\t\t\treturn jQuery.prop( elem, name, value );\n"},{"styles":[0,4,3],"text":"\t\t}\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,2,3,0,59,2],"text":"\t\t// Attribute hooks are determined by the lowercase version\n"},{"styles":[0,2,3,0,41,2],"text":"\t\t// Grab necessary hook if one is defined\n"},{"styles":[0,2,3,0,2,4,0,3,3,0,5,5,0,1,3,0,3,4,0,1,3,0,1,7,0,1,3,0,2,4,0,1,3,0,1,4,0,6,5,0,1,3,0,8,5,0,2,3,0,4,5,0,7,3],"text":"\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n"},{"styles":[0,3,3,0,5,5,0,1,3,0,1,4,0,1,3,0,6,5,0,12,3,0,4,5,0,1,3,0,11,5,0,5,3,0,2,4,0,1,3],"text":"\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n"},{"styles":[0,6,3,0,6,5,0,17,3,0,4,5,0,2,3,0,4,5,0,3,3,0,1,4,0,1,3,0,8,5,0,1,3,0,1,4,0,1,3,0,9,7,0,4,3],"text":"\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n"},{"styles":[0,4,3],"text":"\t\t}\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,2,3,0,2,4,0,3,3,0,5,5,0,1,3,0,3,4,0,1,3,0,9,7,0,5,3],"text":"\t\tif ( value !== undefined ) {\n"},{"styles":[0,3,3,0,2,4,0,3,3,0,5,5,0,1,3,0,3,4,0,1,3,0,4,7,0,5,3],"text":"\t\t\tif ( value === null ) {\n"},{"styles":[0,4,3,0,6,5,0,1,3,0,10,5,0,2,3,0,4,5,0,2,3,0,4,5,0,4,3],"text":"\t\t\t\tjQuery.removeAttr( elem, name );\n"},{"styles":[0,4,3,0,6,4,0,2,3],"text":"\t\t\t\treturn;\n"},{"styles":[0,5,3],"text":"\t\t\t}\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,3,3,0,2,4,0,3,3,0,5,5,0,1,3,0,2,4,0,1,3,0,5,6,0,1,3,0,2,4,0,1,3,0,5,5,0,1,3,0,2,4,0,1,3],"text":"\t\t\tif ( hooks && \"set\" in hooks &&\n"},{"styles":[0,6,3,0,3,5,0,1,3,0,1,4,0,1,3,0,5,5,0,1,3,0,3,5,0,2,3,0,4,5,0,2,3,0,5,5,0,2,3,0,4,5,0,5,3,0,3,4,0,1,3,0,9,7,0,5,3],"text":"\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n"},{"styles":[0,4,3,0,6,4,0,1,3,0,3,5,0,2,3],"text":"\t\t\t\treturn ret;\n"},{"styles":[0,5,3],"text":"\t\t\t}\n"},{"styles":[0,1,3],"text":"\n"},{"styles":[0,3,3,0,4,5,0,1,3,0,12,7,0,2,3,0,4,5,0,2,3,0,5,5,0,1,3,0,1,4,0,1,3,0,2,6,0,4,3],"text":"\t\t\telem.setAttribute( name, value + \"\" );\n"},{"styles":[0,3,3,0,6,4,0,1,3,0,5,5,0,2,3],"text":"\t\t\treturn value;\n"},{"styles":[0,4,3],"text":"\t\t}\n"}],"n":56,"op":"ins"},{"n":998,"op":"invalidate"},{"n":1723,"op":"invalidate"}],"pristine":true},"view_id":"view-id-3"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment