1/** 2 * Copyright (c) 2006-2017, JGraph Ltd 3 * Copyright (c) 2006-2017, Gaudenz Alder 4 */ 5/** 6 * Constructs a new point for the optional x and y coordinates. If no 7 * coordinates are given, then the default values for <x> and <y> are used. 8 * @constructor 9 * @class Implements a basic 2D point. Known subclassers = {@link mxRectangle}. 10 * @param {number} x X-coordinate of the point. 11 * @param {number} y Y-coordinate of the point. 12 */ 13UrlLibrary = function(ui, data, title) 14{ 15 StorageFile.call(this, ui, data, title); 16 17 var fname = title; 18 var last = fname.lastIndexOf('/'); 19 20 if (last >= 0) 21 { 22 fname = fname.substring(last + 1); 23 } 24 25 this.fname = fname; 26}; 27 28//Extends mxEventSource 29mxUtils.extend(UrlLibrary, StorageFile); 30 31/** 32 * Translates this point by the given vector. 33 * 34 * @param {number} dx X-coordinate of the translation. 35 * @param {number} dy Y-coordinate of the translation. 36 */ 37UrlLibrary.prototype.getHash = function() 38{ 39 return 'U' + encodeURIComponent(this.title); 40}; 41 42/** 43 * Translates this point by the given vector. 44 * 45 * @param {number} dx X-coordinate of the translation. 46 * @param {number} dy Y-coordinate of the translation. 47 */ 48UrlLibrary.prototype.getTitle = function() 49{ 50 return this.fname; 51}; 52 53/** 54 * Translates this point by the given vector. 55 * 56 * @param {number} dx X-coordinate of the translation. 57 * @param {number} dy Y-coordinate of the translation. 58 */ 59UrlLibrary.prototype.isAutosave = function() 60{ 61 return false; 62}; 63 64/** 65 * Overridden to avoid updating data with current file. 66 */ 67UrlLibrary.prototype.isEditable = function(title, success, error) 68{ 69 return false; 70}; 71 72/** 73 * Overridden to avoid updating data with current file. 74 */ 75UrlLibrary.prototype.saveAs = function(title, success, error) 76{ 77 // Cannot be saved 78}; 79 80/** 81 * Returns the location as a new object. 82 * @type mx.Point 83 */ 84UrlLibrary.prototype.open = function() 85{ 86 // Do nothing - this should never be called 87}; 88