<commit_before>import angular from "angular";
import won from "../won-es6.js";
//import Immutable from "immutable";
import {
  attach,
  delay,
  //getIn
} from "../utils.js";
import { DomCache } from "../cstm-ng-utils.js";

const serviceDependencies = ["$scope", "$element"];
function genComponentConf() {
  let template = `
      <!-- INPUT FIELD -->
      <div class="ttlp__input">
        <svg class="ttlp__input__icon clickable" 
          style="--local-primary:var(--won-primary-color);"
          ng-if="self.showResetButton"
          ng-click="self.resetTTL()">
          <use xlink:href="#ico36_close" href="#ico36_close"></use>
        </svg>
        <textarea
          won-textarea-autogrow
          class="ttlp__input__inner won-txt won-txt--code"
          ng-keyup="::self.updateTTLBuffered()"
          ng-blur="::self.updateTTL()"
          placeholder="Enter TTL..."></textarea>
      </div>
      
      <!-- HELP TEXT -->
      <div class="ttlp__helptext">
        Expects valid turtle.
        <code><{{::self.won.WON.contentNodeBlankUri.is}}></code> and
        <code><{{::self.won.WON.contentNodeBlankUri.seeks}}></code> and
        will be replaced by the URI generated for this part (i.e. is/description 
        or seeks/searches) of the need. Use the URI, so your TTL can be found 
        when parsing the need. See <code>won.defaultTurtlePrefixes</code>
        for prefixes that will be added automatically. E.g.
        <code><{{::self.won.WON.contentNodeBlankUri.is}}> dc:description "hello world!".</code>
        For more information see the
        <a href="https://github.com/researchstudio-sat/webofneeds/blob/master/documentation/need-structure.md">
          documentation on the need-structure
        </a>.
      </div>

      <!-- ERROR TEXT -->
      <div class="ttlp__parse-error" ng-show="self.ttlParseError">
        {{self.ttlParseError}}
      </div>
    `;

  class Controller {
    constructor() {
      attach(this, serviceDependencies, arguments);
      this.domCache = new DomCache(this.$element);
      this.won = won;

      window.ttlp4dbg = this;

      //this.textfield().value = this.initialTtl || "";
      this.ttlParseError = undefined;
      this.showResetButton = false;

      delay(0).then(() => this.showInitialTTL());
    }

    showInitialTTL() {
      if (this.initialTtl && this.initialTtl.trim().length > 0) {
        this.textfield().value = this.initialTtl || "";
        this.showResetButton = true;
      }

      this.$scope.$apply();
    }
<commit_msg>Removed unused dependency.<commit_after>import angular from "angular";
import won from "../won-es6.js";
//import Immutable from "immutable";
import {
  attach,
  delay,
  //getIn
} from "../utils.js";
import { DomCache } from "../cstm-ng-utils.js";

const serviceDependencies = ["$scope", "$element"];
function genComponentConf() {
  let template = `
      <!-- INPUT FIELD -->
      <div class="ttlp__input">
        <svg class="ttlp__input__icon clickable" 
          style="--local-primary:var(--won-primary-color);"
          ng-if="self.showResetButton"
          ng-click="self.resetTTL()">
          <use xlink:href="#ico36_close" href="#ico36_close"></use>
        </svg>
        <textarea
          won-textarea-autogrow
          class="ttlp__input__inner won-txt won-txt--code"
          ng-keyup="::self.updateTTLBuffered()"
          ng-blur="::self.updateTTL()"
          placeholder="Enter TTL..."></textarea>
      </div>
      
      <!-- HELP TEXT -->
      <div class="ttlp__helptext">
        Expects valid turtle.
        <code><{{::self.won.WON.contentNodeBlankUri.is}}></code> and
        <code><{{::self.won.WON.contentNodeBlankUri.seeks}}></code> and
        will be replaced by the URI generated for this part (i.e. is/description 
        or seeks/searches) of the need. Use the URI, so your TTL can be found 
        when parsing the need. See <code>won.defaultTurtlePrefixes</code>
        for prefixes that will be added automatically. E.g.
        <code><{{::self.won.WON.contentNodeBlankUri.is}}> dc:description "hello world!".</code>
        For more information see the
        <a href="https://github.com/researchstudio-sat/webofneeds/blob/master/documentation/need-structure.md">
          documentation on the need-structure
        </a>.
      </div>

      <!-- ERROR TEXT -->
      <div class="ttlp__parse-error" ng-show="self.ttlParseError">
        {{self.ttlParseError}}
      </div>
    `;

  class Controller {
    constructor() {
      attach(this, serviceDependencies, arguments);
      this.domCache = new DomCache(this.$element);
      this.won = won;

      window.ttlp4dbg = this;

      this.ttlParseError = undefined;
      this.showResetButton = false;

      delay(0).then(() => this.showInitialTTL());
    }

    showInitialTTL() {
      if (this.initialTtl && this.initialTtl.trim().length > 0) {
        this.textfield().value = this.initialTtl || "";
        this.showResetButton = true;
      }

      this.$scope.$apply();
    }

{'fraction_non_alphanumeric': 0.15448934899462471, 'fraction_numerical': 0.0031853474019510252, 'mean_word_length': 2.4600550964187327, 'pattern_counts': {'":': 4, '<': 59, '<?xml version=': 0, '>': 63, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6274039', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1534, 'n_words': 320}