Firefox Code Inspector: как найти функцию в связанных js файлах - PullRequest
0 голосов
/ 02 марта 2020

Я пытаюсь отладить страницу, которая связана с. JSON соответствующий код поля выглядит следующим образом:

<input type="text" name="company" 
 typeahead="company.description for company in retrieveCompanies($viewValue)" ...>

Вышеуказанная функция вызывается при вводе в элемент управления для отображения элементов содержащий письмо, которое мы напечатали; используя Firefox Code Inspector, как мне найти источник функции retrieveCompanies($viewValue)? Если firefox выполняет эту команду, она должна знать, где она находится, поскольку она не находится на той же странице, она должна быть из связанного файла. js.

РЕДАКТИРОВАТЬ : после последнего комментария мне удалось найти функцию javascript, вот исходный код, но мне нужно выяснить, где она заполнена, похоже, этот код генерирует страницы chema html (потребитель данных?), но не показывает, откуда берутся данные:

define("text!accounts/widgets/domiciliazione-utenze/states/create/prepare/_views/addressbook-new.html", [], function() {
        return '<div class="cb-recipient-panel cb-recipient-new padding-top" cb-parentpointer="{{\'new-contact\'}}" cb-children=""\n     cb-pointer-show="true">\n    <div class="col-xs-12">\n        <h4>\n            <strong>{{\'cbLabels.directDebit.addDebit\' | translate}}</strong>\n        </h4>\n    </div>\n    <form id="addressbookForm_form" name="addressbookForm_form"\n          cb-validation-schema="domiciliazione-utenze/schema/addressbook-new"\n          cb-validation="verifyRequest" autocomplete="off">\n        <div class="col-xs-6 form-group">\n            <label class="control-label">{{\'cbLabels.directDebit.findCompany\' | translate}}</label>\n            <div class="listCompany">\n                <div class="typeahead">\n                    <input type="text" name="company" cb-validate\n                        class="form-control ng-pristine ng-valid" ng-model="companySelected"\n                        aria-autocomplete="list" aria-expanded="false"\n                        typeahead="company.description for company in retrieveCompanies($viewValue)"\n                        typeahead-loading="loadingLocations"\n                        typeahead-min-length="3"\n                        typeahead-wait-ms="300"/>\n                    <div cb-validate-errors="company"></div>\n                </div>\n            </div>\n\n        </div>\n\n        <div class="col-xs-6 form-group">\n            <label> {{\'cbLabels.directDebit.nickname\' | translate}}<sup tooltip-html-unsafe="{{\'cbLabels.directDebit.nicknameMessage\' | translate}}"><i class="icon-info"></i></sup></label>\n            <input type="text" name="nickname" class="form-control" ng-model="verifyRequest.nickname" maxlength="35"/>\n        </div>\n        \n        <div class="col-xs-12 " ng-show="showCompanyCodeError()"><p class="text-danger">\n            {{\'cbLabels.directDebit.companyCodeErrorMessage\'|translate}}</p></div>\n        <div class="col-xs-12 " ng-show="showNoCompanyError()"><p class="text-danger">\n            {{\'cbLabels.directDebit.companyError\'|translate}}</p></div>\n\n        <div class="col-xs-6 form-group">\n            <label> {{\'cbLabels.directDebit.uniqueReference\' | translate}}<sup\n                    tooltip-html-unsafe="è il codice identificativo della tua utenza,</br> ti viene fornito dall\'azienda creditrice"><i\n                    class="icon-info"></i></sup>\n            </label>\n            <div>\n                <input type="text" name="refMandate" class="form-control" ng-model="verifyRequest.refMandate"\n                       maxlength="35" cb-validate/>\n                <div cb-validate-errors="refMandate"></div>\n            </div>\n        </div>\n        <div class="col-xs-6">\n            <label> {{\'cbLabels.directDebit.heading\' | translate}} </label>\n            <div class="typeahead">\n                <select cb-select name="holder" ng-model="verifyRequest.holder" cb-datasource="holders"\n                        cb-validate cb-return-value="true" ng-required="submitted"></select>\n            </div>\n        </div>\n        <div class="col-xs-12">\n            <div class="row">\n                <div class="col-xs-12">\n                    <label> {{\'cbLabels.directDebit.operationType\' | translate}} </label>\n                </div>\n                <div class="col-xs-3">\n                    <label class="radio-inline">\n                        <input type="radio" cb-radio name="operation" ng-value="true"\n                               ng-model="verifyRequest.isRecurring"\n                               label="{{\'cbLabels.directDebit.recurrent\' | translate}}"/>\n                    </label>\n                </div>\n                <div class="col-xs-3">\n                    <label class="radio-inline">\n                        <input type="radio" cb-radio name="operation" ng-value="false"\n                               ng-model="verifyRequest.isRecurring"\n                               label="{{\'cbLabels.directDebit.single\' | translate}}"/>\n                    </label>\n                </div>\n            </div>\n        </div>\n\n        <div ui-view="add-customize" autoscroll="false" class="col-xs-12"></div>\n\n        <div class="col-xs-12 text-center padding-top padding-bottom">\n            <button cb-button class="btn-active btn-lg" cb-ui-sref="directDebit.retrieve">\n                {{\'cbLabels.directDebit.deleteUser\' | translate}}\n            </button>\n            <button cb-button class="btn-brand btn-lg" cb-validate-form="" cb-ui-sref="directDebit.create.verify"\n                    cb-param-name="createVerifyRequest"\n                    ng-model="verifyRequest">{{\'cbLabels.directDebit.addUser\' | translate}}\n            </button>\n        </div>\n    </form>\n</div>\n\n'
    }), define("accounts/widgets/domiciliazione-utenze/states/create/prepare/_controllers/DomiciliazioneUtenzeCreatePrepareController", [], function() {
        "use strict";

        function DomiciliazioneUtenzeCreatePrepareController($scope, prepareResponse, $stateParams, cbUpstreamStates, cbHalInterface) {
            function convertCompanies(companies) {
                return _.forEach(companies, function(company) {
                    company.description = company.value + " - " + company.key
                }), companies
            }
            var retrievedCompanies = [],
                retrievedCompaniesDone = !1;
            $scope.verifyRequest = {}, $scope.avatars = _.range(54), $scope.verifyRequest.isRecurring = !0, $scope.holders = prepareResponse.holders, $scope.verifyRequest.holder = $scope.holders[0].value, cbUpstreamStates.set($scope.holders, "holders", 2), $scope.selectAvatar = function(avatar) {
                    $scope.verifyRequest.avatar = avatar
                }, $scope.retrieveCompanies = function(filter) {
                    return retrievedCompaniesDone = !1, cbHalInterface.getRelatedResource("self", {
                        company: filter.trim()
                    }).then(function(response) {
                        return retrievedCompaniesDone = !0, retrievedCompanies = convertCompanies(response.companies)
                    })
                }, $scope.$watch("companySelected", function(companyDescription) {
                    var company = _.find(retrievedCompanies, {
                        description: companyDescription
                    });
                    company && ($scope.verifyRequest.company = {
                        key: company.key,
                        value: company.value
                    })
                }),
                function(createPrepareRequest) {
                    return createPrepareRequest && Object.keys(createPrepareRequest).length > 0
                }($stateParams.editParams) && ($scope.verifyRequest = $stateParams.editParams, $scope.companySelected = $stateParams.editParams.company.value + " - " + $stateParams.editParams.company.key), $scope.showCompanyCodeError = function() {
                    return $scope.verifyRequest && $scope.verifyRequest.company && _.isEmpty($scope.verifyRequest.company.key)
                }, $scope.showNoCompanyError = function() {
                    return $scope.companySelected && $scope.companySelected.length > 2 && retrievedCompaniesDone && _.isEmpty(retrievedCompanies)
                }
        }
        return DomiciliazioneUtenzeCreatePrepareController.$inject = ["$scope", "prepareResponse", "$stateParams", "cbUpstreamStates", "cbHalInterface"], DomiciliazioneUtenzeCreatePrepareController
    }), define("text!accounts/widgets/domiciliazione-utenze/states/create/prepare/_views/add-customize.html", [], function() {
        return '<label class="control-label">{{\'cbLabels.directDebit.selectAvatar\' | translate}}</label>\n<div cb-carousel=""\n     cb-refresh-on="[addressBook.avatars, panels.customize.visible]">\n    <ul class="circle-list margin-bottom margin-top">\n        <li ng-repeat="avatar in avatars"\n            ng-class="{active: verifyRequest.avatar == avatar}">\n            <a ng-click="selectAvatar(avatar)">\n                <div cb-avatar-icon="avatar" class="img"></div>\n            </a>\n        </li>\n    </ul>\n</div>\n'
    }), define("accounts/widgets/domiciliazione-utenze/states/create/prepare/config", ["text!./_views/addressbook-new.html", "./_controllers/DomiciliazioneUtenzeCreatePrepareController", "text!./_views/add-customize.html"], function(AddressbookNewTmpl, DomiciliazioneUtenzeCreatePrepareController, AddCustomizeTmpl) {
        "use strict";

        function CreatePrepareConfig($stateProvider) {
            $stateProvider.state("directDebit.create.prepare", {
                params: {
                    createPrepareRequest: {},
                    editParams: {}
                },
                parent: "directDebit.retrieve",
                resolve: {
                    prepareResponse: ["cbStateResolve", "$stateParams", function(cbStateResolve, $stateParams) {
                        return cbStateResolve("directDebit.create.prepare", "start", $stateParams)
                    }]
                },
                views: {
                    "addressbook-new@directDebit.retrieve": {
                        controller: DomiciliazioneUtenzeCreatePrepareController,
                        template: AddressbookNewTmpl
                    },
                    "add-customize@directDebit.create.prepare": {
                        template: AddCustomizeTmpl
                    }
                }
            })
        }
        return CreatePrepareConfig.$inject = ["$stateProvider"], CreatePrepareConfig
    });
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...