示例#1
0
  removeSelectPart(selectParts, part) {
    // if we remove the field remove the whole statement
    if (part.def.type === 'field') {
      if (this.selectModels.length > 1) {
        var modelsIndex = _.indexOf(this.selectModels, selectParts);
        this.selectModels.splice(modelsIndex, 1);
      }
    } else {
      var partIndex = _.indexOf(selectParts, part);
      selectParts.splice(partIndex, 1);
    }

    this.updatePersistedParts();
  }
示例#2
0
 _.forEach(commands, c => {
   switch (c.type) {
     case 'r':
       const a = Number(c.args[0]);
       if (Math.random() > 1 / a) {
         isCondMatched = false;
         return false;
       }
       break;
     case 'c':
       let count = 0;
       for (let y = 0; y < 3; y++) {
         for (let x = 0; x < 3; x++) {
           const rc = rule.before[y][x];
           const cl = getCell(sx + x, sy + y);
           if (rc === ' ' && cl != null && _.indexOf(c.args[1], cl) >= 0) {
             count++;
           }
         }
       }
       if (count !== Number(c.args[0])) {
         isCondMatched = false;
         return false;
       }
       break;
   }
 });
示例#3
0
 filterByTag(tag) {
   if (_.indexOf(this.query.tag, tag) === -1) {
     this.query.tag.push(tag);
     this.search();
     this.giveSearchFocus = this.giveSearchFocus + 1;
   }
 }
示例#4
0
export function inRow(solid: string, sectionName: string, rowName: string) {
  const { rows, data } = sections[sectionName];
  const rowIndex = _.indexOf(rows, rowName);
  const row = data[rowIndex];
  // TODO deal with '!' stuff in tables
  return hasDeep(row, toConwayNotation(solid));
}
  // 쿼리 전송
  public search(type: string, query: any, options): Promise<any> {
    if (!_.isUndefined(query.resultFormat)) {
      query.resultFormat.mode = _.indexOf(pivotChart, type.toString()) > -1 ? type : ChartType.BAR;
      query.resultFormat.options = _.extend({}, { addMinMax: true }, options);
    }

    return this.post(this.API_URL + 'datasources/query/search', query);
  }
示例#6
0
 _.each(options, function(value, key) {
   if (_.indexOf(graphite_options, key) === -1) {
     return;
   }
   if (value) {
     clean_options.push(key + '=' + encodeURIComponent(value));
   }
 });
示例#7
0
 _.each(original.vuosiluokkakokonaisuudet, function(vlk) {
     if (_.indexOf(removedVlkSet, "" + vlk._vuosiluokkaKokonaisuus) > -1) {
         promises.push(
             PerusopetusService.deleteOppiaineenVuosiluokkakokonaisuus(vlk, $scope.editableModel.id)
                 .$promise
         );
     }
 });
示例#8
0
 _.each($scope.vuosiluokkakokonaisuudet, function(vlk) {
     if (_.indexOf(current, "" + vlk.id) > -1) {
         $scope.activeVuosiluokat.push(vlk);
         var field = getVlkField(vlk);
         if (field) {
             field.visible = true;
         }
     }
 });
示例#9
0
  moveRow(direction) {
    var rowsList = this.dashboard.rows;
    var rowIndex = _.indexOf(rowsList, this.row);
    var newIndex = rowIndex + direction;

    if (newIndex >= 0 && newIndex <= (rowsList.length - 1)) {
      _.move(rowsList, rowIndex, newIndex);
    }
  }
示例#10
0
                    response: response => {
                        const uudelleenohjausStatuskoodit = [401, 412, 500];
                        const fail = _.indexOf(uudelleenohjausStatuskoodit, response.status) !== -1;

                        if (fail) {
                            $rootScope.$emit("event:uudelleenohjattava", response.status);
                        }
                        return response || $q.when(response);
                    },