Skip to content

Instantly share code, notes, and snippets.

View davidjgraph's full-sized avatar
🏠
Typing...

David Benson davidjgraph

🏠
Typing...
View GitHub Profile
@davidjgraph
davidjgraph / menustyle.js
Created September 12, 2013 20:09
mxGraph menu example
<!--
$Id: menustyle.html,v 1.5 2013/06/07 14:30:51 gaudenz Exp $
Copyright (c) 2006-2010, JGraph Ltd
Menustyle example for mxGraph. This example demonstrates using
CSS to style the mxPopupMenu.
-->
<html>
<head>
<title>Menustyle example for mxGraph</title>
@davidjgraph
davidjgraph / index.html
Created August 20, 2013 14:37
GraphEditor index.html
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>
<html>
<head>
<title>Graph Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
<script type="text/javascript">
// Public global variables
var MAX_REQUEST_SIZE = 10485760;
@davidjgraph
davidjgraph / Actions.js
Created August 6, 2013 09:06
Actions.js
/**
* $Id: Actions.js,v 1.12 2013/07/15 13:54:44 gaudenz Exp $
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs the actions object for the given UI.
*/
function Actions(editorUi)
{
this.editorUi = editorUi;
@davidjgraph
davidjgraph / EditorUi.js
Created August 6, 2013 09:03
EditorUi.js
/**
* $Id: EditorUi.js,v 1.32 2013/07/19 06:13:37 gaudenz Exp $
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new graph editor
*/
EditorUi = function(editor, container) {
this.editor = editor || new Editor();
this.container = container || document.body;
@davidjgraph
davidjgraph / mxgraphPatchBoundingBox.js
Created July 23, 2013 21:30
Patch for edge bounds calculation in mxGraph.getBoundingBoxFromGeometry
mxGraph.prototype.getBoundingBoxFromGeometry = function(cells, includeEdges)
{
includeEdges = (includeEdges != null) ? includeEdges : false;
var result = null;
if (cells != null)
{
for (var i = 0; i < cells.length; i++)
{
if (includeEdges || this.model.isVertex(cells[i]))
@davidjgraph
davidjgraph / daigramly.js
Created July 10, 2013 20:36
Code containing setup for TinyMCE editor
/*
* $Id: Diagramly.js,v 1.80 2013/05/31 13:17:27 david Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
// For compatibility with open servlet on GAE
function setCurrentXml(data, filename)
{
if (window.parent != null && window.parent.openFile != null)
{
window.parent.openFile.setData(data, filename);
@davidjgraph
davidjgraph / sidebar.js
Created July 10, 2013 19:45
draw.io sidebar.js
(function()
{
/**
* Overrides gear image URL.
*/
Sidebar.prototype.gearImage = GRAPH_IMAGE_PATH + '/clipart/Gear_128x128.png';
/**
* Specifies the names of items for the signs category.
*/
@davidjgraph
davidjgraph / Diagramly.js
Created June 24, 2013 09:26
Diagramly.js - TinyMCE initialization
/*
* $Id: Diagramly.js,v 1.80 2013/05/31 13:17:27 david Exp $
* Copyright (c) 2006-2010, JGraph Ltd
*/
// For compatibility with open servlet on GAE
function setCurrentXml(data, filename)
{
if (window.parent != null && window.parent.openFile != null)
{
window.parent.openFile.setData(data, filename);
@davidjgraph
davidjgraph / super
Created June 13, 2013 09:56
HTML superscript example
<mxGraphModel dx="800" dy="800" grid="1" guides="1" tooltips="1" connect="1" fold="1" page="1" pageScale="1" pageWidth="826" pageHeight="1169" style="default-style2">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="&lt;p style=&quot;margin: 0px; margin-top: 4px; text-align: center;&quot;&gt;&lt;strong&gt;Class&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p style=&quot;margin: 0px; margin-left: 4px;&quot;&gt;+ field:&lt;sup&gt;Type&lt;/sup&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p style=&quot;margin: 0px; margin-left: 4px;&quot;&gt;+ method(): Type&lt;/p&gt;" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1" vertex="1" parent="1">
<mxGeometry x="10" y="10" width="440" height="360" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
@davidjgraph
davidjgraph / draw_io_manifest
Created June 11, 2013 08:23
draw.io Google Apps Marketplace listing manifest
<ListingManifest>
<SubListings>
<SubListing>
<DisplayName>Complete</DisplayName>
<EditionId>default_edition</EditionId>
<PaymentModel>FREE</PaymentModel>
<SeatCount>1000000</SeatCount>
</SubListing>
</SubListings>
</ListingManifest>