Commit 305375af authored by techird's avatar techird

Merge branch 'dev' into gh-pages

parents 2b49b177 962898e9
......@@ -7,7 +7,9 @@ Utils.extend( KityMinder, {
return KityMinder._protocals[ name ] || null;
},
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 () {
return KityMinder._protocals;
......
......@@ -95,5 +95,17 @@ KityMinder.Geometry = ( function () {
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;
} )();
\ No newline at end of file
......@@ -16,6 +16,7 @@ KityMinder.registerProtocal( 'json', function () {
},
recognize: function ( local ) {
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 () {
}
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