<commit_before>'use strict';
/************************ LICENCE ***************************
* 	This file is part of <SourceData SmartFigure frontend code to search and navigate the SourceData resource>
*     Copyright (C) <2016>  EMBO and Swiss Institute of Bioinformatics
*
*     This program is free software: you can redistribute it and/or modify
*     it under the terms of the GNU Affero General Public License as
*     published by the Free Software Foundation, either version 3 of the
*     License, or (at your option) any later version.
*
*     This program is distributed in the hope that it will be useful,
*     but WITHOUT ANY WARRANTY; without even the implied warranty of
*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*     GNU Affero General Public License for more details.
*
*     You should have received a copy of the GNU Affero General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>
*
*****************************************************************/angular.module('thirdparties', [])
/**
 * provide lodash as '_'
 */
  .service('_', function ($window) {
    return $window._;
  })
/**
 * provide d3 as 'd3'
 */
  .service('d3', function ($window) {
    return $window.d3;
  })
  .service('tour', function ($window){
    return $window.Tour;
  })
  .service('searchTour', function(){
    return {
      init: function(tour, $scope){
          //-BEGIN THE TOUR ON PAGE LOAD---------------//
          angular.element(document).ready(function(){
            // Define the Tour for Search Form
              var searchTour = new tour({
                name: "searchTour",
                steps: [
                  {
                    orphan: true,
                    title: "SourceData SmartFigure Search",
                    content: "<p>Welcome to the SmartFigure search engine from SourceData.</p><p>SourceData helps you to find figures showing data on many different types of cell, gene, molecule or structure. We refer to these as entities.</p><p>In this example, we'll look for data on the question 'Does insulin affect glucose?'.</p> <p>Press 'Next' to continue.</p>",
                    animation: true,
                    backdrop:true,
                    backdropPadding:5
                  },
                  {
                    element: ".sdform-adv-btn-interv",
                    title: "Perturbation",
                    placement: "top",
                    content: "This input box is for the independent variable: the entity that was manipulated in a study. We call these 'perturbations'. In this case, we're interested in insulin.",
                    animation: true,
                    backdrop:true,
                    backdropPadding:5,
                    onShown: function(tour){ $scope.searchParams.intervention="insulin"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-interv-input-group-btn",
                    title: "Choose the perturbation element type",
                    placement: "bottom",
                    content: "Here, you can specify the type of entity that interests you. To search all entity types, just choose 'Any Type', but in our case, we know we want a molecule.",
                    animation: true,
                    backdrop:true,
                    backdropPadding:{top:5, right:7, bottom:5, left:10},
                    onShown: function(tour){ $scope.searchParams.interventionType = "molecule"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-btn-assay",
                    title: "Measured entity",
                    placement: "top",
                    content: "This input box is for the dependent variable: the measured entity in the study. For this example, we enter 'glucose'.",
                    animation: true,
                    backdrop:true,
                    backdropPadding:5,
                    onShown: function(tour){ $scope.searchParams.assayed="glucose"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-btn-assay-input-group-btn",
                    title: "Choose the assayed element type",
                    placement: "bottom",
                    content: "Just like the perturbations, you can narrow down your search to only certain entity types. Here, we choose to look at molecules again.",
                    animation: true,
                    backdrop:true,
                    backdropPadding:{top:5, right:7, bottom:5, left:10},
                    onShown: function(tour){ $scope.searchParams.assayedType = "molecule"; $scope.$apply();}
                  },
                  {
                    element: ".sdform-adv-btn-go",
                    title: "Click here to search",
                    placement: "top",
                    content: "Now you can perform your search and answer the question 'Does glucose affect insulin?'. End the tour and click this button to see the results.",
                    animation: true,
                    backdrop:true,
                    backdropPadding: 5
                  }
                ]
              });
              searchTour.init();
              searchTour.start();
          });
      }
    };

  })
  .service('resultsTour', function(){
    return {
      init: function(tour, scope, $timeout, Search){
        $timeout(function(){
          //if there are search results and the previous tour is finished
          if(localStorage.getItem("searchTour_end")){
              var resultsTour = new tour({
                  name: "resultsTour",
                  steps: [
                      {<commit_msg>minor modifications to the first part of the tour<commit_after>'use strict';
/************************ LICENCE ***************************
* 	This file is part of <SourceData SmartFigure frontend code to search and navigate the SourceData resource>
*     Copyright (C) <2016>  EMBO and Swiss Institute of Bioinformatics
*
*     This program is free software: you can redistribute it and/or modify
*     it under the terms of the GNU Affero General Public License as
*     published by the Free Software Foundation, either version 3 of the
*     License, or (at your option) any later version.
*
*     This program is distributed in the hope that it will be useful,
*     but WITHOUT ANY WARRANTY; without even the implied warranty of
*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*     GNU Affero General Public License for more details.
*
*     You should have received a copy of the GNU Affero General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>
*
*****************************************************************/angular.module('thirdparties', [])
/**
 * provide lodash as '_'
 */
  .service('_', function ($window) {
    return $window._;
  })
/**
 * provide d3 as 'd3'
 */
  .service('d3', function ($window) {
    return $window.d3;
  })
  .service('tour', function ($window){
    return $window.Tour;
  })
  .service('searchTour', function(){
    return {
      init: function(tour, $scope){
          //-BEGIN THE TOUR ON PAGE LOAD---------------//
          angular.element(document).ready(function(){
            // Define the Tour for Search Form
              var searchTour = new tour({
                name: "searchTour",
                steps: [
                  {
                    orphan: true,
                    title: "SourceData SmartFigure Search",
                    content: "<p>Welcome to the SmartFigure search engine from SourceData.</p><p>With SourceData you can search the main elements of an experiment: cells, genes, molecules, organisms, etc. - also known as experimental <strong>'entities'</strong> - and find relationships between them.</p> <p>Press 'Next' to continue.</p>",
                    animation: true,
                    backdrop:true,
                    backdropPadding:5
                  },
                  {
                    element: ".sdform-adv-btn-interv",
                    title: "Perturbation",
                    placement: "top",
                    content: "<p>This input box is for the variable you manipulated or 'perturbed' in the experiment.</p><p>If you were asking the question: 'How does <strong>insulin</strong> affect glucose levels?', insulin would be the independent variable or 'perturbation'" ,
                    animation: true,
                    backdrop:true,
                    backdropPadding:5,
                    onShown: function(tour){ $scope.searchParams.intervention="insulin"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-interv-input-group-btn",
                    title: "Choose the perturbation element type",
                    placement: "bottom",
                    content: "<p>Here you can choose a specific class of entity in case you want to narrow down the search results.</p><p>In our example, we know glucose is a molecular compound, so we choose 'small molecule'</p>",
                    animation: true,
                    backdrop:true,
                    backdropPadding:{top:5, right:7, bottom:5, left:10},
                    onShown: function(tour){ $scope.searchParams.interventionType = "molecule"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-btn-assay",
                    title: "Measured entity",
                    placement: "top",
                    content: "<p>This input box is for the element you are interested in that was measured in an experiment, also known as the 'measured entity'.</p><p>Following our example on glucose and insulin, we want to know how the levels of <strong>glucose</strong> change when we manipulate insulin.</p>",
                    animation: true,
                    backdrop:true,
                    backdropPadding:5,
                    onShown: function(tour){ $scope.searchParams.assayed="glucose"; $scope.$apply(); }
                  },
                  {
                    element: ".sdform-adv-btn-assay-input-group-btn",
                    title: "Choose the assayed element type",
                    placement: "bottom",
                    content: "Just like the perturbations, you can narrow down your search to only certain entity types. Here, we choose to look at 'small molecules' again.",
                    animation: true,
                    backdrop:true,
                    backdropPadding:{top:5, right:7, bottom:5, left:10},
                    onShown: function(tour){ $scope.searchParams.assayedType = "molecule"; $scope.$apply();}
                  },
                  {
                    element: ".sdform-adv-btn-go",
                    title: "Click here to search",
                    placement: "top",
                    content: "Ready to try it? Now you can perform your search and answer the question 'Does <strong>glucose</strong> affect <strong>insulin</strong>?'. End the tour and click this button to see the results.",
                    animation: true,
                    backdrop:true,
                    backdropPadding: 5
                  }
                ]
              });
              searchTour.init();
              searchTour.start();
          });
      }
    };

  })
  .service('resultsTour', function(){
    return {
      init: function(tour, scope, $timeout, Search){
        $timeout(function(){
          //if there are search results and the previous tour is finished
          if(localStorage.getItem("searchTour_end")){
              var resultsTour = new tour({
                  name: "resultsTour",
                  steps: [
                      {
{'fraction_non_alphanumeric': 0.11760729976343359, 'fraction_numerical': 0.00388644812436634, 'mean_word_length': 1.7470410768159665, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, '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': '212157', 'n_tokens_mistral': 2962, 'n_tokens_neox': 2694, 'n_words': 1004}