Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Workflow macro: use 12 hexdigits for graph ids instead of 8.

On Linux x86_64, `id()` returns a large integer which is represented by more than 8 hex digits.

Also, use `"%0nx"` instead of `"%.nx`, the latter happens to work but is normally meant to be used for floating point values. (''The precision is not allowed for integer values'', [http://docs.python.org/library/string.html#formatstrings 7.1.3]).


git-svn-id: http://svn.edgewall.org/repos/trac/trunk@11033 af82e41b-90c4-0310-8c96-b1721e28e2e2
  • Loading branch information...
commit 81e4866645d05623b2001798caa0c64787ba94c9 1 parent b44d860
cboos authored
2  trac/htdocs/js/workflow_graph.js
@@ -208,7 +208,7 @@
208 208
209 209 $(document).ready(function() {
210 210 $('.trac-workflow-graph').each(function (index) {
211   - var data = window['graph_' + this.id.slice(-8)];
  211 + var data = window['graph_' + this.id.slice(-12)];
212 212 var width = data.width, height = data.height;
213 213 var nodes = [], actions = [], edges = [];
214 214 for (var i = 0; i < data.nodes.length; ++i)
2  trac/ticket/default_workflow.py
@@ -485,7 +485,7 @@ def expand_macro(self, formatter, name, text, args):
485 485 graph = {'nodes': states, 'actions': action_names, 'edges': edges,
486 486 'width': args.get('width', 800),
487 487 'height': args.get('height', 600)}
488   - graph_id = '%.8x' % id(graph)
  488 + graph_id = '%012x' % id(graph)
489 489 req = formatter.req
490 490 add_script(req, 'common/js/excanvas.js', ie_if='IE')
491 491 add_script(req, 'common/js/workflow_graph.js')

0 comments on commit 81e4866

Please sign in to comment.
Something went wrong with that request. Please try again.