Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/owners/OwnersPathEditor.js
| Show All 22 Lines | JX.DOM.listen( | ||||
| JX.bind(this, this._onaddpath)); | JX.bind(this, this._onaddpath)); | ||||
| this._count = 0; | this._count = 0; | ||||
| this._repositories = config.repositories; | this._repositories = config.repositories; | ||||
| this._inputTemplate = config.input_template; | this._inputTemplate = config.input_template; | ||||
| this._completeURI = config.completeURI; | this._completeURI = config.completeURI; | ||||
| this._validateURI = config.validateURI; | this._validateURI = config.validateURI; | ||||
| this._repositoryDefaultPaths = config.repositoryDefaultPaths; | |||||
| this._initializePaths(config.pathRefs); | this._initializePaths(config.pathRefs); | ||||
| }, | }, | ||||
| members : { | members : { | ||||
| /* | /* | ||||
| * MultirowRowManager for controlling add/remove behavior | * MultirowRowManager for controlling add/remove behavior | ||||
| */ | */ | ||||
| _rowManager : null, | _rowManager : null, | ||||
| Show All 22 Lines | members : { | ||||
| _inputTemplate : null, | _inputTemplate : null, | ||||
| /* | /* | ||||
| * Most packages will be in one repository, so remember whenever | * Most packages will be in one repository, so remember whenever | ||||
| * the user chooses a repository, and use that repository as the | * the user chooses a repository, and use that repository as the | ||||
| * default for future rows. | * default for future rows. | ||||
| */ | */ | ||||
| _lastRepositoryChoice : null, | _lastRepositoryChoice : null, | ||||
| _repositoryDefaultPaths : null, | |||||
| /* | /* | ||||
| * Initialize with 0 or more rows. | * Initialize with 0 or more rows. | ||||
| * Adds one initial row if none are given. | * Adds one initial row if none are given. | ||||
| */ | */ | ||||
| _initializePaths : function(path_refs) { | _initializePaths : function(path_refs) { | ||||
| for (var k in path_refs) { | for (var k in path_refs) { | ||||
| this.addPath(path_refs[k]); | this.addPath(path_refs[k]); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | addPath : function(path_ref) { | ||||
| path_ref.excluded, | path_ref.excluded, | ||||
| {name : 'exclude[' + this._count + ']'}); | {name : 'exclude[' + this._count + ']'}); | ||||
| var exclude_cell = JX.$N('td', {}, exclude); | var exclude_cell = JX.$N('td', {}, exclude); | ||||
| var row = this._rowManager.addRow( | var row = this._rowManager.addRow( | ||||
| [exclude_cell, repo_cell, typeahead_cell, error_display_cell]); | [exclude_cell, repo_cell, typeahead_cell, error_display_cell]); | ||||
| new JX.PathTypeahead({ | new JX.PathTypeahead({ | ||||
| repositoryDefaultPaths : this._repositoryDefaultPaths, | |||||
| repo_select : repo_select, | repo_select : repo_select, | ||||
| path_input : path_input, | path_input : path_input, | ||||
| hardpoint : hardpoint, | hardpoint : hardpoint, | ||||
| error_display : error_display, | error_display : error_display, | ||||
| completeURI : this._completeURI, | completeURI : this._completeURI, | ||||
| validateURI : this._validateURI}).start(); | validateURI : this._validateURI | ||||
| }).start(); | |||||
| this._count++; | this._count++; | ||||
| return row; | return row; | ||||
| }, | }, | ||||
| _onaddpath : function(e) { | _onaddpath : function(e) { | ||||
| e.kill(); | e.kill(); | ||||
| this.addPath(); | this.addPath(); | ||||
| Show All 19 Lines | |||||