<commit_before>/*
 Copyright 2013 by PeopleWare n.v.

 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.
 */

define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dojo/text!./onePropertyCrdList.html",
  "ppwcode-util-oddsAndEnds/_PropagationMixin", "dojox/mobile/ListItem", "dojox/mobile/Icon", "dojo/dom-style", "dojo/dom-class", "dojo/Stateful", "dojo/dom-construct",
  "dijit/form/Button", "dojo/i18n!./nls/labels",

  "dojox/mobile/Container", "dojox/mobile/EdgeToEdgeList",
  "xstyle/css!dojox/mobile/themes/iphone/iphone.css",
  "xstyle/css!./onePropertyCrdList.css"],
  function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, _PropagationMixin, ListItem, Icon, domStyle, domClass, Stateful, domConstruct, Button, labels) {

    return declare([Stateful, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _PropagationMixin], {
      // summary:
      //   Widget that is specially made to represent a list with only 1 property per element.
      //   Elements can be added or removed.

      templateString: template,
      labels: labels,

      // _ulNode: UL HTML element in template
      _ulNode: null,

      _ulNodeWrapper: null,

      _txtAdd: null,

      _addTextWrapperNode: null,

      height: null,

      // value: Array
      value: [],
      // disabled: Boolean
      disabled: null,

      "-propagate-": {
        value: [
          {path: "_propagateValue", exec: true}
        ]
      },

      _propagateValue: function (/*Array*/ valueArray) {
        var self = this;
        if (self._ulNode) {
          domConstruct.empty(self._ulNode.domNode);
          if (valueArray && valueArray.length > 0) {
            valueArray.forEach(function (element) {
              var li = new ListItem({label: self.format(element)});
              if (!self.get("disabled")) {
                var deleteIcon = new Button({showLabel: false, iconClass: "dijitIconDelete", class: "deleteIcon"});
                li.own(deleteIcon.on("click", function() {
                  if (!self.get("disabled")) {
                    if (window.confirm(labels.confirmDelete1 + self.format(element) + labels.confirmDelete2)) {
                      var arr = self.get("value");
                      var newArr = [];
                      arr.forEach(function (arrElement) {
                        if (element !== arrElement) {<commit_msg>class is a reserved JS keyword.<commit_after>/*
 Copyright 2013 by PeopleWare n.v.

 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.
 */

define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dojo/text!./onePropertyCrdList.html",
  "ppwcode-util-oddsAndEnds/_PropagationMixin", "dojox/mobile/ListItem", "dojox/mobile/Icon", "dojo/dom-style", "dojo/dom-class", "dojo/Stateful", "dojo/dom-construct",
  "dijit/form/Button", "dojo/i18n!./nls/labels",

  "dojox/mobile/Container", "dojox/mobile/EdgeToEdgeList",
  "xstyle/css!dojox/mobile/themes/iphone/iphone.css",
  "xstyle/css!./onePropertyCrdList.css"],
  function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, _PropagationMixin, ListItem, Icon, domStyle, domClass, Stateful, domConstruct, Button, labels) {

    return declare([Stateful, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _PropagationMixin], {
      // summary:
      //   Widget that is specially made to represent a list with only 1 property per element.
      //   Elements can be added or removed.

      templateString: template,
      labels: labels,

      // _ulNode: UL HTML element in template
      _ulNode: null,

      _ulNodeWrapper: null,

      _txtAdd: null,

      _addTextWrapperNode: null,

      height: null,

      // value: Array
      value: [],
      // disabled: Boolean
      disabled: null,

      "-propagate-": {
        value: [
          {path: "_propagateValue", exec: true}
        ]
      },

      _propagateValue: function (/*Array*/ valueArray) {
        var self = this;
        if (self._ulNode) {
          domConstruct.empty(self._ulNode.domNode);
          if (valueArray && valueArray.length > 0) {
            valueArray.forEach(function (element) {
              var li = new ListItem({label: self.format(element)});
              if (!self.get("disabled")) {
                var deleteIcon = new Button({showLabel: false, iconClass: "dijitIconDelete"});
                domClass.add(deleteIcon.domNode, "deleteIcon");
                li.own(deleteIcon.on("click", function() {
                  if (!self.get("disabled")) {
                    if (window.confirm(labels.confirmDelete1 + self.format(element) + labels.confirmDelete2)) {
                      var arr = self.get("value");
                      var newArr = [];
                      arr.forEach(function (arrElement) {
                        if (element !== arrElement) {
{'fraction_non_alphanumeric': 0.11575726670066293, 'fraction_numerical': 0.004759476457589665, 'mean_word_length': 2.750159337157425, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '7396898', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1680, 'n_words': 461}