Changeset - d8ccc0df69de
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 8 years ago 2017-06-10 23:38:20
drewp@bigasterisk.com
edit-choice use resource display, unlink button
Ignore-this: a0bd52abc48cb9861416ab39ca923331
3 files changed with 14 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/web/edit-choice.coffee
Show inline comments
 
@@ -48,12 +48,13 @@ Polymer
 

	
 
    observers: [
 
      'gotGraph(graph, uri)'
 
      ]
 

	
 
    ready: ->
 
      @uri = null
 
      setupDrop @$.box, @$.box, null, (uri) =>
 
        @uri=uri
 
        @updateLabel()
 

	
 
    gotGraph: ->
 
      @graph.runHandler(@updateLabel.bind(@), "edit-choice #{@uri}")
 
@@ -61,6 +62,9 @@ Polymer
 
    updateLabel: ->
 
      @label = try
 
          @graph.stringValue(@uri, RDFS + 'label')
 
        catch
 
          @uri
 

	
 
    unlink: ->
 
      @uri = null
 

	
light9/web/edit-choice.html
Show inline comments
 
<link rel="import" href="/lib/polymer/polymer.html">
 
<link rel="import" href="resource-display.html">
 

	
 
<!-- see light9/editchoice.py for gtk version -->
 
<dom-module id="edit-choice">
 
  <template>
 
    <style>
 
     #box {
 
         display: inline-block;
 
         background: #141448;
 
         min-width: 10em;
 
     }
 
     #box.dragging {
 
         background: rgba(126, 52, 245, 0.0784313725490196);
 
         box-shadow: 0 0 20px #ffff00;
 
     }
 
     a {
 
         color: #8e8eff;
 
         padding: 3px;
 
         display: inline-block;
 
         font-size: 145%;
 
     }
 
     
 
     
 
    </style>
 
    <div id="box">
 
      <!-- maybe use resource-display for this part -->
 
      <a href="{{uri}}" title="{{label}}"><!-- type icon goes here -->{{label}}</a>
 
      <!-- <button on-click="unlink">Unlink</button>  -->
 
      Effect:
 
      <resource-display graph="{{graph}}" uri="{{uri}}" rename></resource-display>
 
      <button on-click="unlink">Unlink</button>
 
    </div>
 
  </template>
 
  <script src="edit-choice.js"></script>
 
</dom-module>
light9/web/resource-display.html
Show inline comments
 
@@ -11,13 +11,16 @@
 
         zvertical-align: top;
 
         zborder: 2px rgba(84, 84, 84, 0.27) outset;
 
         zborder-radius: 9px;
 
         zpadding: 2px;
 
     }
 
    </style>
 
    <span class$="[[resClasses]]"><a href="{{uri}}">{{label}}</a></span>
 
    <span class$="[[resClasses]]"><a href="{{uri}}">
 
      <!-- type icon goes here -->
 
      {{label}}
 
    </a></span>
 
    <template is="dom-if" if="{{rename}}">
 
      <button on-click="onRename">Rename</button>
 

	
 
      <paper-dialog id="renameDialog" modal
 
                    on-iron-overlay-closed="onRenameClosed">
 
        <p>
0 comments (0 inline, 0 general)