<commit_before>/**
 * @license
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

CLASS({
  name: 'FOAMlet',
  package: 'foam.navigator',

  properties: [
    {
      model_: 'StringProperty',
      name: 'iconURL',
      label: 'Icon',
      todo: multiline(function() {/*
        Add support for (1) rendering icons, and (2) icon import (upload, etc.)
      */})
    },
    {
      model_: 'StringProperty',
      name: 'name'
    },
    {
      model_: 'DateTimeProperty',
      name: 'lastModified',
      factory: function() {
        return Date.now();
      }
    },
    {
      model_: 'StringArrayProperty',
      name: 'labels',
      factory: function() { return [this.model_.label]; }
    }
  ],

  methods: [
    {
      name: 'init',
      code: function() {
        this.SUPER();
        this.subscribe(
            ['property'],
            function(model, o, notificationData) {
              if ( notificationData[0] !== 'property' ||
                  notificationData[1] === 'lastModified' ||
                  ! model || ! model.properties ) return;
              var propName = notificationData[1];
              var propMatch = model.properties.filter(function(propName, prop) {
                return prop.name == propName;
              }.bind(this, propName))[0];<commit_msg>FOAMlet: name-as-id<commit_after>/**
 * @license
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

CLASS({
  name: 'FOAMlet',
  package: 'foam.navigator',

  properties: [
    {
      name: 'name',
      model_: 'StringProperty',
    },
    {
      name: 'iconURL',
      model_: 'StringProperty',
      label: 'Icon',
      todo: multiline(function() {/*
        Add support for (1) rendering icons, and (2) icon import (upload, etc.)
      */})
    },
    {
      name: 'lastModified',
      model_: 'DateTimeProperty',
      factory: function() {
        return Date.now();
      }
    },
    {
      name: 'labels',
      model_: 'StringArrayProperty',
      factory: function() { return [this.model_.label]; }
    }
  ],

  methods: [
    {
      name: 'init',
      code: function() {
        this.SUPER();
        this.subscribe(
            ['property'],
            function(model, o, notificationData) {
              if ( notificationData[0] !== 'property' ||
                  notificationData[1] === 'lastModified' ||
                  ! model || ! model.properties ) return;
              var propName = notificationData[1];
              var propMatch = model.properties.filter(function(propName, prop) {
                return prop.name == propName;
              }.bind(this, propName))[0];
{'fraction_non_alphanumeric': 0.12262382864792504, 'fraction_numerical': 0.00749665327978581, 'mean_word_length': 2.2714535901926447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3838957', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1006, 'n_words': 328}