Please show me your code and the contents of your gcs.js file
it does not allow me to copy long text
can i remove the icon totally
or make it refer to the one provided by you
I have just worked with a coworker on a separate machine. Using this HTML (just a slight rearrangement or yours) and a gcs.js file with the exact contents of the Github gist I sent you will work.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GoCloudStorageManager test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.8.29/go-debug.js"></script>
<script src="gcs.js"></script>
<script>
function init() {
var $ = go.GraphObject.make;
myDiagram = $(go.Diagram, "myDiagramDiv", {
initialContentAlignment: go.Spot.Center, // center the content
"undoManager.isEnabled": true // enable undo & redo
});
myDiagram.nodeTemplate =
$(go.Node, "Auto", // the Shape will go around the TextBlock
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Shape, "RoundedRectangle", { strokeWidth: 0 },
// Shape.fill is bound to Node.data.color
new go.Binding("fill", "color")),
$(go.TextBlock,
{ margin: 8 }, // some room around the text
new go.Binding("text", "key"))
);
// create the model data that will be represented by Nodes and Links
myDiagram.model = new go.GraphLinksModel(
[
{ key: "Alpha", color: "lightblue" },
{ key: "Beta", color: "orange" },
{ key: "Gamma", color: "lightgreen" },
{ key: "Delta", color: "pink" }
],
[
{ from: "Alpha", to: "Beta" },
{ from: "Alpha", to: "Gamma" },
{ from: "Beta", to: "Beta" },
{ from: "Gamma", to: "Delta" },
{ from: "Delta", to: "Alpha" }
]);
defaultModel = myDiagram.model.toJson();
// update the title on page to reflect newly loaded diagram title TODO
/*
* Promise handler for core functions
* @param {String} action Accepted values: Load, Delete, New, Save
*/
var handlePromise = function (action) {
switch (action) {
case 'Load': gls.loadWithUI().then(function (fileData) {
handleFileData(action, fileData);
}); break;
case 'SaveAs': gls.saveWithUI().then(function (fileData){
handleFileData(action, fileData);
}); break;
}
}
gls = new gcs.GoLocalStorage(myDiagram,defaultModel,"../iconsFolder/");
}
</script>
</head>
<body onload="init()">
<button id="openButton" onclick="handlePromise('Load')">Load </button>
<button id="saveButton" onclick="handlePromise('SaveAs')">Save As</button>
<h3 id="currentFile">Untitled </h3>
<div>
<h4>Diagram 1</h4>
<div id="myDiagramDiv" style="height: 300px; width: 300px; background-color: lightgray;"></div>
</div>
</body>