Commit 962898e9 authored by techird's avatar techird

protocal seq

parent 29ab0dab
...@@ -7,7 +7,9 @@ Utils.extend( KityMinder, { ...@@ -7,7 +7,9 @@ Utils.extend( KityMinder, {
return KityMinder._protocals[ name ] || null; return KityMinder._protocals[ name ] || null;
}, },
getSupportedProtocals: function () { getSupportedProtocals: function () {
return Utils.keys( KityMinder._protocals ); return Utils.keys( KityMinder._protocals ).sort(function(a, b) {
return KityMinder._protocals[b].recognizePriority - KityMinder._protocals[a].recognizePriority;
});
}, },
getAllRegisteredProtocals: function () { getAllRegisteredProtocals: function () {
return KityMinder._protocals; return KityMinder._protocals;
......
...@@ -95,5 +95,17 @@ KityMinder.Geometry = ( function () { ...@@ -95,5 +95,17 @@ KityMinder.Geometry = ( function () {
return unknown; return unknown;
}; };
g.expandBox = function( box, sizeX, sizeY ) {
if(sizeY === undefined) {
sizeY = sizeX;
}
return wrapBox( {
left: box.left - sizeX,
top: box.top - sizeY,
right: box.right + sizeX,
bottom: box.bottom + sizeY
} );
};
return g; return g;
} )(); } )();
\ No newline at end of file
...@@ -16,6 +16,7 @@ KityMinder.registerProtocal( 'json', function () { ...@@ -16,6 +16,7 @@ KityMinder.registerProtocal( 'json', function () {
}, },
recognize: function ( local ) { recognize: function ( local ) {
return Utils.isString( local ) && local.charAt( 0 ) == '{' && local.charAt( local.length - 1 ) == '}'; return Utils.isString( local ) && local.charAt( 0 ) == '{' && local.charAt( local.length - 1 ) == '}';
} },
recognizePriority: 0
}; };
} ); } );
\ No newline at end of file
...@@ -96,6 +96,7 @@ KityMinder.registerProtocal( "plain", function () { ...@@ -96,6 +96,7 @@ KityMinder.registerProtocal( "plain", function () {
} }
return decode( local ); return decode( local );
}, },
recognize: recognize recognize: recognize,
recognizePriority: -1
}; };
} ); } );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment