From 71c71c1d39c694ff9ea86c7f0cf7a6ab33e75605 Mon Sep 17 00:00:00 2001 From: Boris Staal Date: Sun, 27 Jan 2013 04:01:08 +0700 Subject: [PATCH] Ability to highlight block names --- .../app/assets/javascripts/application.js.coffee | 11 +++++++---- .../app/views/nodes/argument.jst.mustache | 2 +- lib/foundry-xray/app/views/nodes/block.jst.mustache | 2 +- .../app/views/nodes/instruction_typed.jst.mustache | 2 +- .../app/views/nodes/operand_argument.jst.mustache | 2 +- .../app/views/nodes/operand_basic_block.jst.mustache | 2 +- .../app/views/nodes/operand_instruction.jst.mustache | 2 +- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/foundry-xray/app/assets/javascripts/application.js.coffee b/lib/foundry-xray/app/assets/javascripts/application.js.coffee index 156a428..aadcfad 100644 --- a/lib/foundry-xray/app/assets/javascripts/application.js.coffee +++ b/lib/foundry-xray/app/assets/javascripts/application.js.coffee @@ -134,13 +134,16 @@ class Application elements = $('.naming') drawer = @drawer - elements.click -> - active = $(@).hasClass('active') - needle = @innerHTML + elements.filter('.link').click -> + element = $(@) + active = element.hasClass('active') + needle = element.attr("data-naming") || @innerHTML elements.removeClass('active') unless active - elements.filter(-> @innerHTML == needle).addClass('active') + elements.filter(-> + ($(@).attr("data-naming") || @innerHTML) == needle + ).addClass('active') drawer.repaint() diff --git a/lib/foundry-xray/app/views/nodes/argument.jst.mustache b/lib/foundry-xray/app/views/nodes/argument.jst.mustache index f388759..b225da3 100644 --- a/lib/foundry-xray/app/views/nodes/argument.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/argument.jst.mustache @@ -1 +1 @@ -{{{type}}} %{{name}} \ No newline at end of file +{{{type}}} %{{name}} \ No newline at end of file diff --git a/lib/foundry-xray/app/views/nodes/block.jst.mustache b/lib/foundry-xray/app/views/nodes/block.jst.mustache index b411b23..71740a3 100644 --- a/lib/foundry-xray/app/views/nodes/block.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/block.jst.mustache @@ -1,4 +1,4 @@ -{{name}}:
+{{name}}:
{{{instructions}}}
\ No newline at end of file diff --git a/lib/foundry-xray/app/views/nodes/instruction_typed.jst.mustache b/lib/foundry-xray/app/views/nodes/instruction_typed.jst.mustache index af79f88..2624e3d 100644 --- a/lib/foundry-xray/app/views/nodes/instruction_typed.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/instruction_typed.jst.mustache @@ -1,3 +1,3 @@
- {{{type}}} %{{name}} = {{opcode}} {{parameters}} {{{operands}}} + {{{type}}} %{{name}} = {{opcode}} {{parameters}} {{{operands}}}
\ No newline at end of file diff --git a/lib/foundry-xray/app/views/nodes/operand_argument.jst.mustache b/lib/foundry-xray/app/views/nodes/operand_argument.jst.mustache index 6c32cf0..9a5426f 100644 --- a/lib/foundry-xray/app/views/nodes/operand_argument.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/operand_argument.jst.mustache @@ -1 +1 @@ -%{{name}} \ No newline at end of file +%{{name}} \ No newline at end of file diff --git a/lib/foundry-xray/app/views/nodes/operand_basic_block.jst.mustache b/lib/foundry-xray/app/views/nodes/operand_basic_block.jst.mustache index f4e1c69..c006a0e 100644 --- a/lib/foundry-xray/app/views/nodes/operand_basic_block.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/operand_basic_block.jst.mustache @@ -1 +1 @@ -label %{{name}} \ No newline at end of file +label %{{name}} \ No newline at end of file diff --git a/lib/foundry-xray/app/views/nodes/operand_instruction.jst.mustache b/lib/foundry-xray/app/views/nodes/operand_instruction.jst.mustache index 6c32cf0..9a5426f 100644 --- a/lib/foundry-xray/app/views/nodes/operand_instruction.jst.mustache +++ b/lib/foundry-xray/app/views/nodes/operand_instruction.jst.mustache @@ -1 +1 @@ -%{{name}} \ No newline at end of file +%{{name}} \ No newline at end of file