//>>built
require({cache:{"url:app/ui/dialogs/templates/AddMatchesDialog.html":'\x3cdiv class\x3d"dijitDialog" role\x3d"dialog" aria-labelledby\x3d"addMatchesDialog_title"\x3e\n  \x3cdiv data-dojo-attach-point\x3d"titleBar" class\x3d"dijitDialogTitleBar"\x3e\n    \x3cspan data-dojo-attach-point\x3d"titleNode" class\x3d"dijitDialogTitle" role\x3d"heading"\x3e\x3c/span\x3e\n\t\t\x3cspan data-dojo-attach-point\x3d"closeButtonNode" class\x3d"dijitDialogCloseIcon"\n          data-dojo-attach-event\x3d"ondijitclick: onCancel" title\x3d"Annuleren" role\x3d"button" tabIndex\x3d"-1"\x3e\n\t\t\t\x3cspan data-dojo-attach-point\x3d"closeText" class\x3d"closeText" title\x3d"Annuleren" tabIndex\x3d"-1"\x3e\n        \x3ci class\x3d"fa fa-times"\x3e\x3c/i\x3e\x3c/span\x3e\n\t\t\x3c/span\x3e\n  \x3c/div\x3e\n\n  \x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitDialogPaneContent"\x3e\n    \x3cdiv class\x3d"row"\x3e\n      \x3cdiv class\x3d"large-12 columns"\x3e\n        \x3cp style\x3d"margin-top: 0; padding-top: 0;"\x3eSelect an external scheme and enter a label to search for a match:\x3c/p\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"row"\x3e\n      \x3cdiv class\x3d"large-6 columns"\x3e\n        \x3cselect data-dojo-attach-point\x3d"externalSchemeSelect"\x3e\x3c/select\x3e\n      \x3c/div\x3e\n      \x3cdiv class\x3d"large-5 columns"\x3e\n        \x3cinput type\x3d"search" style\x3d"float: right" data-dojo-attach-point\x3d"searchLabelInput" placeholder\x3d"Enter a label .." /\x3e\n      \x3c/div\x3e\n      \x3cdiv class\x3d"large-1 columns"\x3e\n        \x3ca href\x3d"#" class\x3d"button tiny" style\x3d"float: right" data-dojo-attach-event\x3d"onClick: _searchMatches"\x3e\x3ci class\x3d"fa fa-search"\x3e\x3c/i\x3e\x3c/a\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"row"\x3e\n      \x3cdiv class\x3d"large-12 columns"\x3e\n        \x3cdiv data-dojo-attach-point\x3d"addMatchesGridNode" style\x3d"height: 330px; width: 100%"\x3e\x3c/div\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"row"\x3e\n      \x3cdiv class\x3d"large-6 columns"\x3e\n        \x3cdiv class\x3d"placeholder-container" style\x3d"margin-top: 15px;"\x3e\n          \x3clabel for\x3d"matchType-${id}" style\x3d"width: 60%;"\x3eSelect the type of match\x3c/label\x3e\n          \x3cselect id\x3d"matchType-${id}" data-dojo-attach-point\x3d"matchTypeSelectNode"\x3e\x3c/select\x3e\n        \x3c/div\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n    \x3cdiv class\x3d"row footerButtons"\x3e\n      \x3cdiv class\x3d"large-12 columns text-center"\x3e\n        \x3ca href\x3d"#" data-dojo-attach-event\x3d"onClick: _okClick" class\x3d"button tiny"\x3eAdd\x3c/a\x3e\n        \x3ca href\x3d"#" data-dojo-attach-event\x3d"onClick: _cancelClick" class\x3d"button tiny"\x3eCancel\x3c/a\x3e\n      \x3c/div\x3e\n    \x3c/div\x3e\n  \x3c/div\x3e\n\x3c/div\x3e'}});
define("app/ui/dialogs/AddMatchesDialog","dojo/_base/declare dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/Dialog dojo/_base/lang dojo/_base/array dstore/Memory dojo/topic dojo/dom-construct dgrid/OnDemandGrid dgrid/extensions/DijitRegistry dgrid/extensions/ColumnResizer dgrid/Selection ../../utils/DomUtils dojo/text!./templates/AddMatchesDialog.html".split(" "),function(e,h,k,l,f,u,g,v,m,n,p,q,r,d,t){return e([l,h,k],{templateString:t,parentNode:null,baseClass:"matches-dialog",title:"Add a match",
concept:null,conceptSchemeController:null,externalSchemeStore:null,matchTypesList:null,_matchesGrid:null,_matchesStore:null,postCreate:function(){this.inherited(arguments);this._matchesGrid=this._createGrid({collection:this._matchesStore},this.addMatchesGridNode);this.externalSchemeStore.fetch().then(f.hitch(this,function(a){d.addOptionsToSelect(this.externalSchemeSelect,{data:a,idProperty:"id",labelProperty:"label"})}));d.addOptionsToSelect(this.matchTypeSelectNode,{data:this.matchTypesList,idProperty:"value",
labelProperty:"label"})},startup:function(){this.inherited(arguments);this._matchesGrid.startup()},reset:function(){this.externalSchemeSelect.selectedIndex=0;this.matchTypeSelectNode.selectedIndex=0;this._matchesStore=new g({data:[]});this._matchesGrid.set("collection",this._matchesStore);this.searchLabelInput.value=""},hide:function(){this.reset();this.inherited(arguments)},_createGrid:function(a,b){var c=new (e([n,p,q,r]))({collection:a.collection,columns:{label:{label:""},id:{label:""},type:{label:""},
link:{label:"",renderCell:function(a){if(a&&a.uri)return m.create("a",{href:a.uri,target:"_blank",title:a.uri,innerHTML:'\x3ci class\x3d"fa fa-external-link"\x3e\x3c/i\x3e'})}}},selectionMode:"single",showHeader:!1,noDataMessage:"",loadingMessage:"Fetching data.."},b);c.on("dgrid-error",function(a){});return c},_okClick:function(a){a.preventDefault();a=d.getSelectedOption(this.matchTypeSelectNode);var b=null,c;for(c in this._matchesGrid.selection)this._matchesGrid.selection[c]&&(b=this._matchesStore.getSync(c));
b&&(this.emit("match.add",{matchType:a,match:b}),this.hide())},_cancelClick:function(a){a.preventDefault();this.hide()},_searchMatches:function(a){a?a.preventDefault():null;a=d.getSelectedOption(this.externalSchemeSelect);var b=this.searchLabelInput.value;a&&b&&""!==b&&this._loadStore(a,b)},_loadStore:function(a,b){this.conceptSchemeController.searchForConcepts(a,b).then(f.hitch(this,function(a){this._matchesStore=new g({data:a});this._matchesGrid.set("collection",this._matchesStore);this._matchesGrid.resize()}),
function(a){})},_validate:function(){}})});
//# sourceMappingURL=AddMatchesDialog.js.map