graphdb-workbench 2.2.3 → 2.2.4-TR2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/{102.7141102a059ef5eba1ea.bundle.js → 102.d52dc777ce7b5de1a30a.bundle.js} +2 -2
  2. package/dist/{102.7141102a059ef5eba1ea.bundle.js.map → 102.d52dc777ce7b5de1a30a.bundle.js.map} +1 -1
  3. package/dist/{104.ecd04b9cba294e159ca5.bundle.js → 104.09c8b5802e53cd9dced9.bundle.js} +2 -2
  4. package/dist/{104.ecd04b9cba294e159ca5.bundle.js.map → 104.09c8b5802e53cd9dced9.bundle.js.map} +1 -1
  5. package/dist/{107.5972b71755d2f24f6f44.bundle.js → 107.481f84627ac231f49e56.bundle.js} +2 -2
  6. package/dist/{107.5972b71755d2f24f6f44.bundle.js.map → 107.481f84627ac231f49e56.bundle.js.map} +1 -1
  7. package/dist/108.d61b0e4a54e1d0e6550d.bundle.js +2 -0
  8. package/dist/{108.162ea156d1fc4ad2525f.bundle.js.map → 108.d61b0e4a54e1d0e6550d.bundle.js.map} +1 -1
  9. package/dist/{11.f7cb87be309f6bd00aa5.bundle.js → 11.89d3de4f2e80e373ecf2.bundle.js} +3 -3
  10. package/dist/{11.f7cb87be309f6bd00aa5.bundle.js.map → 11.89d3de4f2e80e373ecf2.bundle.js.map} +1 -1
  11. package/dist/{115.abb22e52d5886ed645c1.bundle.js → 115.36a12f5a0804f33cb569.bundle.js} +2 -2
  12. package/dist/{115.abb22e52d5886ed645c1.bundle.js.map → 115.36a12f5a0804f33cb569.bundle.js.map} +1 -1
  13. package/dist/{117.ed07ffe3ff3bead9b43b.bundle.js → 117.9c58e6155d7467c45284.bundle.js} +2 -2
  14. package/dist/{117.ed07ffe3ff3bead9b43b.bundle.js.map → 117.9c58e6155d7467c45284.bundle.js.map} +1 -1
  15. package/dist/{118.57c922b04fbcf0d65d1c.bundle.js → 118.7cdbf2a7be83e4cdc7e2.bundle.js} +2 -2
  16. package/dist/{118.57c922b04fbcf0d65d1c.bundle.js.map → 118.7cdbf2a7be83e4cdc7e2.bundle.js.map} +1 -1
  17. package/dist/{119.7b75484ef37c16039937.bundle.js → 119.f7c106efa2582220baa7.bundle.js} +2 -2
  18. package/dist/{119.7b75484ef37c16039937.bundle.js.map → 119.f7c106efa2582220baa7.bundle.js.map} +1 -1
  19. package/dist/{12.eb41e4af80fee51d893c.bundle.js → 12.b4ac6d1ff3d669d3e63f.bundle.js} +2 -2
  20. package/dist/{12.eb41e4af80fee51d893c.bundle.js.map → 12.b4ac6d1ff3d669d3e63f.bundle.js.map} +1 -1
  21. package/dist/{120.0f42d5a0967c1f4636ca.bundle.js → 120.d20d9e20e2d3c5476f8d.bundle.js} +2 -2
  22. package/dist/{120.0f42d5a0967c1f4636ca.bundle.js.map → 120.d20d9e20e2d3c5476f8d.bundle.js.map} +1 -1
  23. package/dist/{121.f85253eb7e057efdb05d.bundle.js → 121.dc96efcaf4dc5e63f58d.bundle.js} +2 -2
  24. package/dist/{121.f85253eb7e057efdb05d.bundle.js.map → 121.dc96efcaf4dc5e63f58d.bundle.js.map} +1 -1
  25. package/dist/{126.349ebcea493c77fecf7e.bundle.js → 126.4c2fb40676d2508bbc65.bundle.js} +2 -2
  26. package/dist/{126.349ebcea493c77fecf7e.bundle.js.map → 126.4c2fb40676d2508bbc65.bundle.js.map} +1 -1
  27. package/dist/{13.bc3607638ad1e2068125.bundle.js → 13.f6b8f9a2288e2485ee20.bundle.js} +2 -2
  28. package/dist/{13.bc3607638ad1e2068125.bundle.js.map → 13.f6b8f9a2288e2485ee20.bundle.js.map} +1 -1
  29. package/dist/148.45985ae23de642595544.bundle.js +1 -1
  30. package/dist/148.45985ae23de642595544.bundle.js.map +1 -1
  31. package/dist/16.2ca98f5bec0fae221cef.bundle.js +3 -0
  32. package/dist/{16.cd06772f9e031d37db03.bundle.js.map → 16.2ca98f5bec0fae221cef.bundle.js.map} +1 -1
  33. package/dist/{17.45b5c34f6c73bde1113d.bundle.js → 17.b19a2d3870590d21e8e9.bundle.js} +2 -2
  34. package/dist/{17.45b5c34f6c73bde1113d.bundle.js.map → 17.b19a2d3870590d21e8e9.bundle.js.map} +1 -1
  35. package/dist/{19.92f27dd146df127e8d6e.bundle.js → 19.34c180252e48207f01b4.bundle.js} +3 -3
  36. package/dist/{19.92f27dd146df127e8d6e.bundle.js.map → 19.34c180252e48207f01b4.bundle.js.map} +1 -1
  37. package/dist/20.9e9e388a98851c65f8f7.bundle.js +2 -0
  38. package/dist/{20.4eb25ede434dc329ecf1.bundle.js.map → 20.9e9e388a98851c65f8f7.bundle.js.map} +1 -1
  39. package/dist/21.8434e1ecb6fcfa06e1f1.bundle.js +2 -0
  40. package/dist/21.8434e1ecb6fcfa06e1f1.bundle.js.map +1 -0
  41. package/dist/{23.16fc17b0a8983ce3d809.bundle.js → 23.22e3720d741ee87c8108.bundle.js} +2 -2
  42. package/dist/{23.16fc17b0a8983ce3d809.bundle.js.map → 23.22e3720d741ee87c8108.bundle.js.map} +1 -1
  43. package/dist/{24.04d84edbd8f93d036633.bundle.js → 24.63acd0fc451fc797ff79.bundle.js} +2 -2
  44. package/dist/{24.04d84edbd8f93d036633.bundle.js.map → 24.63acd0fc451fc797ff79.bundle.js.map} +1 -1
  45. package/dist/{26.3a642e64c7803f3b32f1.bundle.js → 26.194b2d09daa679b7e09c.bundle.js} +2 -2
  46. package/dist/{26.3a642e64c7803f3b32f1.bundle.js.map → 26.194b2d09daa679b7e09c.bundle.js.map} +1 -1
  47. package/dist/27.35fe33bb9622c2e29c43.bundle.js +2 -0
  48. package/dist/{27.fef157d9275358c9f1a0.bundle.js.map → 27.35fe33bb9622c2e29c43.bundle.js.map} +1 -1
  49. package/dist/{29.a1b30610d7960a86b1cb.bundle.js → 29.e4eadb676659c5d6e44b.bundle.js} +3 -3
  50. package/dist/{29.a1b30610d7960a86b1cb.bundle.js.map → 29.e4eadb676659c5d6e44b.bundle.js.map} +1 -1
  51. package/dist/{30.3a05504ff287ca6df711.bundle.js → 30.0fb90b3cdf78fcde6251.bundle.js} +2 -2
  52. package/dist/{30.3a05504ff287ca6df711.bundle.js.map → 30.0fb90b3cdf78fcde6251.bundle.js.map} +1 -1
  53. package/dist/{31.13d5a8e9834cd5db589c.bundle.js → 31.8dd9fe71d36bd04a0433.bundle.js} +2 -2
  54. package/dist/{31.13d5a8e9834cd5db589c.bundle.js.map → 31.8dd9fe71d36bd04a0433.bundle.js.map} +1 -1
  55. package/dist/{32.59a7369287d15e8b9ab6.bundle.js → 32.8e1c25a47debdf5145d8.bundle.js} +2 -2
  56. package/dist/{32.59a7369287d15e8b9ab6.bundle.js.map → 32.8e1c25a47debdf5145d8.bundle.js.map} +1 -1
  57. package/dist/33.89b51420b48880728b96.bundle.js +2 -0
  58. package/dist/33.89b51420b48880728b96.bundle.js.map +1 -0
  59. package/dist/{35.fe688fc32270724c391d.bundle.js → 35.a9846fba95e98a294957.bundle.js} +2 -2
  60. package/dist/{35.fe688fc32270724c391d.bundle.js.map → 35.a9846fba95e98a294957.bundle.js.map} +1 -1
  61. package/dist/{36.7da22f08c8e850885cc5.bundle.js → 36.4dbd0f9007404b0adbe2.bundle.js} +2 -2
  62. package/dist/{36.7da22f08c8e850885cc5.bundle.js.map → 36.4dbd0f9007404b0adbe2.bundle.js.map} +1 -1
  63. package/dist/37.ac99eb00fe71266c5bff.bundle.js +2 -0
  64. package/dist/{37.8a9855206d5ae5eba9be.bundle.js.map → 37.ac99eb00fe71266c5bff.bundle.js.map} +1 -1
  65. package/dist/{39.0eebc4b972cff879c1c9.bundle.js → 39.8f8ae5c232bd2f023e7c.bundle.js} +2 -2
  66. package/dist/{39.0eebc4b972cff879c1c9.bundle.js.map → 39.8f8ae5c232bd2f023e7c.bundle.js.map} +1 -1
  67. package/dist/4.5391679fa01c55e842cc.bundle.js +2 -0
  68. package/dist/4.5391679fa01c55e842cc.bundle.js.map +1 -0
  69. package/dist/{40.10f42e3f6d8d87bd3221.bundle.js → 40.50f010a0a0ce99da5092.bundle.js} +2 -2
  70. package/dist/{40.10f42e3f6d8d87bd3221.bundle.js.map → 40.50f010a0a0ce99da5092.bundle.js.map} +1 -1
  71. package/dist/{41.368780c518c3f6cab4b7.bundle.js → 41.d09e0f01eac3492e3376.bundle.js} +2 -2
  72. package/dist/{41.368780c518c3f6cab4b7.bundle.js.map → 41.d09e0f01eac3492e3376.bundle.js.map} +1 -1
  73. package/dist/{42.1a48ae582180fa6374f9.bundle.js → 42.9561ff9cd77df0f86a91.bundle.js} +2 -2
  74. package/dist/{42.1a48ae582180fa6374f9.bundle.js.map → 42.9561ff9cd77df0f86a91.bundle.js.map} +1 -1
  75. package/dist/{43.64268be8880acd392fee.bundle.js → 43.0400aae23dac518b78ec.bundle.js} +2 -2
  76. package/dist/{43.64268be8880acd392fee.bundle.js.map → 43.0400aae23dac518b78ec.bundle.js.map} +1 -1
  77. package/dist/{53.58a23efc22865c67d57d.bundle.js → 53.54b20545d5504efa8958.bundle.js} +2 -2
  78. package/dist/{53.58a23efc22865c67d57d.bundle.js.map → 53.54b20545d5504efa8958.bundle.js.map} +1 -1
  79. package/dist/{54.1e2e99cd8cdf20b99a4f.bundle.js → 54.81f97307e31f5eabb5f0.bundle.js} +2 -2
  80. package/dist/{54.1e2e99cd8cdf20b99a4f.bundle.js.map → 54.81f97307e31f5eabb5f0.bundle.js.map} +1 -1
  81. package/dist/{55.693c1a0dd775181e1e29.bundle.js → 55.e8df33b84ca578a9a633.bundle.js} +2 -2
  82. package/dist/{55.693c1a0dd775181e1e29.bundle.js.map → 55.e8df33b84ca578a9a633.bundle.js.map} +1 -1
  83. package/dist/{56.62459de7af529d956b75.bundle.js → 56.d765faad673f618d41b0.bundle.js} +2 -2
  84. package/dist/{56.62459de7af529d956b75.bundle.js.map → 56.d765faad673f618d41b0.bundle.js.map} +1 -1
  85. package/dist/{60.2cb24e628b92cb3e0210.bundle.js → 60.f13766507ec5f29fde78.bundle.js} +2 -2
  86. package/dist/{60.2cb24e628b92cb3e0210.bundle.js.map → 60.f13766507ec5f29fde78.bundle.js.map} +1 -1
  87. package/dist/{65.6c12c48ac0d6f57a5079.bundle.js → 65.aa9736b7aad2582ca7ea.bundle.js} +2 -2
  88. package/dist/{65.6c12c48ac0d6f57a5079.bundle.js.map → 65.aa9736b7aad2582ca7ea.bundle.js.map} +1 -1
  89. package/dist/{67.5ae0610f77a1455ce92b.bundle.js → 67.e7bd652fadf93be1fbae.bundle.js} +2 -2
  90. package/dist/{67.5ae0610f77a1455ce92b.bundle.js.map → 67.e7bd652fadf93be1fbae.bundle.js.map} +1 -1
  91. package/dist/{69.90776e70cb361d1ac6d5.bundle.js → 69.6b915e6a7a9c36a78e2b.bundle.js} +2 -2
  92. package/dist/{69.90776e70cb361d1ac6d5.bundle.js.map → 69.6b915e6a7a9c36a78e2b.bundle.js.map} +1 -1
  93. package/dist/{71.3e927496e6e4175a3127.bundle.js → 71.624ca936339bf337e46a.bundle.js} +2 -2
  94. package/dist/{71.3e927496e6e4175a3127.bundle.js.map → 71.624ca936339bf337e46a.bundle.js.map} +1 -1
  95. package/dist/{72.bc99fbec188b4e49aa53.bundle.js → 72.3a5620a182219e9ea05d.bundle.js} +2 -2
  96. package/dist/{72.bc99fbec188b4e49aa53.bundle.js.map → 72.3a5620a182219e9ea05d.bundle.js.map} +1 -1
  97. package/dist/{73.40b5cbae08c7f3a58438.bundle.js → 73.f162e544378754078826.bundle.js} +2 -2
  98. package/dist/{73.40b5cbae08c7f3a58438.bundle.js.map → 73.f162e544378754078826.bundle.js.map} +1 -1
  99. package/dist/{74.cc42a1dcef7e9b830354.bundle.js → 74.7595755907badb1a99b8.bundle.js} +2 -2
  100. package/dist/{74.cc42a1dcef7e9b830354.bundle.js.map → 74.7595755907badb1a99b8.bundle.js.map} +1 -1
  101. package/dist/{75.31d1a4766c80c90b2afc.bundle.js → 75.4cc7ff534d56a05c578a.bundle.js} +2 -2
  102. package/dist/{75.31d1a4766c80c90b2afc.bundle.js.map → 75.4cc7ff534d56a05c578a.bundle.js.map} +1 -1
  103. package/dist/{76.89d209ce08efa7429e87.bundle.js → 76.cd0cfea4c96e88230dbe.bundle.js} +2 -2
  104. package/dist/{76.89d209ce08efa7429e87.bundle.js.map → 76.cd0cfea4c96e88230dbe.bundle.js.map} +1 -1
  105. package/dist/{77.64c49e9e99b0ae3fbbca.bundle.js → 77.df7767b1a0a3a0efa202.bundle.js} +2 -2
  106. package/dist/{77.64c49e9e99b0ae3fbbca.bundle.js.map → 77.df7767b1a0a3a0efa202.bundle.js.map} +1 -1
  107. package/dist/{79.0fbaedffc1f583a6064f.bundle.js → 79.4d64b377b0308809136f.bundle.js} +2 -2
  108. package/dist/{79.0fbaedffc1f583a6064f.bundle.js.map → 79.4d64b377b0308809136f.bundle.js.map} +1 -1
  109. package/dist/{80.6d489af9482e358c8dd8.bundle.js → 80.36e424031127d1743f20.bundle.js} +2 -2
  110. package/dist/{80.6d489af9482e358c8dd8.bundle.js.map → 80.36e424031127d1743f20.bundle.js.map} +1 -1
  111. package/dist/{94.94158487a9024ff3a623.bundle.js → 94.b1ccdd207229ae57569f.bundle.js} +2 -2
  112. package/dist/{94.94158487a9024ff3a623.bundle.js.map → 94.b1ccdd207229ae57569f.bundle.js.map} +1 -1
  113. package/dist/{97.48e14b67906b4d61a1b1.bundle.js → 97.951e03ffd2d5a10f868d.bundle.js} +2 -2
  114. package/dist/{97.48e14b67906b4d61a1b1.bundle.js.map → 97.951e03ffd2d5a10f868d.bundle.js.map} +1 -1
  115. package/dist/{98.cc7086155b76601af017.bundle.js → 98.745b4c457214d4189d7a.bundle.js} +2 -2
  116. package/dist/{98.cc7086155b76601af017.bundle.js.map → 98.745b4c457214d4189d7a.bundle.js.map} +1 -1
  117. package/dist/{bundle.d34ddcc40dd190254f1c.bundle.js → bundle.651116fe2383a66f32c9.bundle.js} +21 -21
  118. package/dist/{bundle.d34ddcc40dd190254f1c.bundle.js.map → bundle.651116fe2383a66f32c9.bundle.js.map} +1 -1
  119. package/dist/index.html +3 -3
  120. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  121. package/dist/pages/autocomplete.html +1 -1
  122. package/dist/pages/choose-repository-type.html +1 -1
  123. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  124. package/dist/pages/create-index.html +4 -4
  125. package/dist/pages/dependencies.html +1 -1
  126. package/dist/pages/domainRangeInfo.html +2 -2
  127. package/dist/pages/edit.html +1 -1
  128. package/dist/pages/explore.html +1 -1
  129. package/dist/pages/export.html +1 -1
  130. package/dist/pages/find.html +1 -1
  131. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  132. package/dist/pages/graphs-visualizations.html +7 -7
  133. package/dist/pages/guides.html +1 -1
  134. package/dist/pages/import.html +1 -1
  135. package/dist/pages/jdbc-create.html +5 -5
  136. package/dist/pages/monitor/queries.html +1 -1
  137. package/dist/pages/monitor/resources.html +2 -2
  138. package/dist/pages/namespaces.html +2 -2
  139. package/dist/pages/plugins.html +1 -1
  140. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  141. package/dist/pages/rdfrank.html +2 -2
  142. package/dist/pages/repositories.html +2 -2
  143. package/dist/pages/repository.html +2 -2
  144. package/dist/pages/similarity-indexes.html +1 -1
  145. package/dist/pages/sparql-template-create.html +5 -5
  146. package/dist/pages/sparql.html +3 -3
  147. package/dist/pages/webapi.html +2 -2
  148. package/dist/res/swagger/index.html +27 -27
  149. package/package.json +1 -1
  150. package/dist/108.162ea156d1fc4ad2525f.bundle.js +0 -2
  151. package/dist/16.cd06772f9e031d37db03.bundle.js +0 -3
  152. package/dist/20.4eb25ede434dc329ecf1.bundle.js +0 -2
  153. package/dist/21.5586732af2e5cec0d05a.bundle.js +0 -2
  154. package/dist/21.5586732af2e5cec0d05a.bundle.js.map +0 -1
  155. package/dist/27.fef157d9275358c9f1a0.bundle.js +0 -2
  156. package/dist/33.fde8076c81c87c25c367.bundle.js +0 -2
  157. package/dist/33.fde8076c81c87c25c367.bundle.js.map +0 -1
  158. package/dist/37.8a9855206d5ae5eba9be.bundle.js +0 -2
  159. package/dist/4.ca3eb6b5da0890c0abe0.bundle.js +0 -2
  160. package/dist/4.ca3eb6b5da0890c0abe0.bundle.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/similarity/controllers/create-index.controller.js","webpack:///./src/js/angular/utils/notifications.js"],"names":["CreateSimilarityIdxCtrl","$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","indexType","search","type","undefined","startsWith","viewType","newIndex","info","page","defaultTabConfig","id","name","query","inference","sameAs","initForViewType","indexNameFromLocation","editSearchQuery","options","searchQueries","searchQuery","analogicalQuery","currentQuery","notoolbarInference","notoolbarSameAs","window","editor","setQuery","allSamples","samples","stopList","analyzer","isLiteralIndex","getAndRemoveOption","getIndexes","success","data","literalIndexes","concat","filter","idx","status","map","inputIndex","desiredIdx","j","length","error","msg","getError","instant","filenamePattern","RegExp","validateIndex","invalidIndexName","saveQueries","test","getQueryType","appendOption","option","value","key","optArr","split","i","join","saveQueryToLocal","currentQueryTab","setLoader","isRunning","progressMessage","extraMessage","yasrInnerContainer","angular","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","body","verticalView","orientationViewMode","viewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","$on","cancel","yasr","container","resize","showHideEditor","selectTab","$","tab","runQuery","changePage","explain","executedQueryTab","warning","getQueryMode","explainRequested","currentTabConfig","resultsCount","resetCurrentTabConfig","getNamespaces","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","addKnownPrefixes","JSON","stringify","getValue","isDefined","setValue","getExistingTabId","existingTabId","tabsData","item","loadTab","queryType","offset","allResultsCount","pageSize","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","getSearchQueries","getSamples","selectQuery","infer","tabs","copy","$watch","helpHidden","get","HIDE_SIMILARITY_HELP","toggleHelp","set","viewQuery","getQuery","indexName","indexOptions","indexStopList","queryInference","querySameAs","indexAnalyzer","open","templateUrl","controller","resolve","isInvalidIndexName","isEmptyIndexName","trim","goToPage","showEditor","notoolbar","createIndex","index","err","url","xhr","abort","showPreview","outputType","queryExists","saveTab","findTabIndexByID","addNewTab","callback","tabName","savedQuery","changePagination","toggleSampleQueries","querySelected","tabId","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","message","changeViewMode","tabID","remove","focusQueryEditor","find","is","focus","getActiveRepository","on","$watchCollection","tabEvent","relatedTarget","target","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","saveSearchQuery","changedQuery","isSearchQuery","then","async","showToastMessageWithDelay","response","getCloseBtnMsg","operationType","operation","module","$inject","Promise","r","setTimeout","factory"],"mappings":"+FAAA,kBAYA,SAASA,EAAwBC,EAAQC,EAAQC,EAAWC,EAAUC,EAAuBC,EAAmBC,EAAWC,EAAaC,EAAeC,EAA8BC,EAAqBC,EAAQC,GAE9M,MAAMC,EAAYP,EAAUQ,SAASC,UACnBC,IAAdH,GAA2BA,EAAUI,WAAW,QAChDjB,EAAOkB,SAAW,OAElBlB,EAAOkB,SAAWL,EAKtBb,EAAOmB,SAAW,GAElBnB,EAAOoB,KAAOb,EACdP,EAAOqB,KAAO,EAEd,MAAMC,EAAmB,CACrBC,GAAI,IACJC,KAAM,GACNC,MAAO,GACPC,WAAW,EACXC,QAAQ,GAcZ,MAAMC,EAAkB,WAXF,IAAUC,EAwB5B,GAZA7B,EAAO8B,gBAAkBxB,EAAUQ,SAASgB,gBAC5C9B,EAAOqB,KAAOrB,EAAO8B,gBAAkB,EAAI,EAC3C9B,EAAOmB,SAASK,MAdYK,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,eAEd,YADArE,EAAO2D,MAAMhD,EAAWmD,QAAQ,+CAGpC,IAAId,EAAO,CACPzB,KAAMxB,EAAOmB,SAASK,KACtB4N,aAAcpP,EAAOmC,aAAaV,MAClC4N,cAA+B,IAAhBrP,EAAOqB,MAG1B,OAAOjB,EAAsB+O,gBAAgB5F,KAAKC,UAAUvG,IACvDqM,MAAKC,uBACI/O,EAAcgP,0BAA0C,IAAhBxP,EAAOqB,KAAa,sCAAwC,2CAC1Gf,EAAUsM,IAAI,iBACf,SAAU6C,GACTxP,EAAO2D,MAAME,SAAS2L,GAAW7O,EAAWmD,QAAQ,sCAIhE/D,EAAO0P,eAAiB,WACpB,IAAIC,EAAgB3P,EAAO8B,gBAAkBlB,EAAWmD,QAAQ,gCAAkCnD,EAAWmD,QAAQ,iCACrH,OAAOnD,EAAWmD,QAAQ,2BAA4B,CAAC6L,UAAWD,KA1vB1ErK,QACKuK,OAAO,kDAAmD,CACvD,wCACA,gDAEH5D,WAAW,0BAA2BlM,GAE3CA,EAAwB+P,QAAU,CAAC,SAAU,SAAU,YAAa,WAAY,wBAAyB,oBAAqB,YAAa,cAAe,gBAAiB,+BAAgC,sBAAuB,SAAU,e,iBCJ5O,SAAStP,EAAcP,EAAQW,GAC3B,MAAO,CACH4O,0BASJ,SAAmCxB,GAC/B,OAAO,IAAI+B,QAASC,IAChB/P,EAAO+C,QAAQpC,EAAWmD,QAAQiK,IAClCiC,WAAWD,EAAG,SApB1B1K,QACKuK,OAAO,wCAAyC,IAChDK,QAAQ,gBAAiB1P,GAE9BA,EAAcsP,QAAU,CAAC,SAAU","file":"54.1e2e99cd8cdf20b99a4f.bundle.js","sourcesContent":["import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.similarity.controllers.create', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('CreateSimilarityIdxCtrl', CreateSimilarityIdxCtrl);\n\nCreateSimilarityIdxCtrl.$inject = ['$scope', 'toastr', '$uibModal', '$timeout', 'SimilarityRestService', 'SparqlRestService', '$location', 'productInfo', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction CreateSimilarityIdxCtrl($scope, toastr, $uibModal, $timeout, SimilarityRestService, SparqlRestService, $location, productInfo, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys, $translate) {\n\n const indexType = $location.search().type;\n if (indexType === undefined || indexType.startsWith('text')) {\n $scope.viewType = 'text';\n } else {\n $scope.viewType = indexType;\n }\n\n const textDefaultOptions = '-termweight idf';\n const predDefaultOptions = '';\n $scope.newIndex = {};\n\n $scope.info = productInfo;\n $scope.page = 1;\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: '',\n inference: true,\n sameAs: true\n };\n\n let getNewIndexName = function (indexNameFromLocation) {\n if (indexNameFromLocation) {\n if ($scope.page !== 1) {\n return indexNameFromLocation;\n } else {\n return 'Copy_of_' + indexNameFromLocation;\n }\n }\n return '';\n };\n\n const initForViewType = function () {\n $scope.editSearchQuery = $location.search().editSearchQuery;\n $scope.page = $scope.editSearchQuery ? 2 : 1;\n $scope.newIndex.name = getNewIndexName($location.search().name);\n $scope.newIndex.options = ($location.search().options ? $location.search().options : ($scope.viewType === \"text\") ? textDefaultOptions : predDefaultOptions);\n\n if ($scope.searchQueries) {\n $scope.newIndex.searchQuery = $location.search().searchQuery ? $location.search().searchQuery : $scope.searchQueries[$scope.viewType];\n if ($scope.viewType === 'predication') {\n $scope.newIndex.analogicalQuery = $location.search().analogicalQuery ? $location.search().analogicalQuery : $scope.searchQueries['analogical'];\n }\n }\n\n if ($scope.editSearchQuery) {\n // Default will be opened search query tab for edition\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n $scope.notoolbarInference = true;\n $scope.notoolbarSameAs = true;\n if (window.editor) {\n $scope.setQuery($scope.newIndex.searchQuery);\n }\n } else {\n if ($scope.viewType === 'text' && $scope.allSamples) {\n $scope.samples = $scope.allSamples['text'];\n $scope.newIndex.stopList = ($location.search().stopList ? $location.search().stopList : undefined);\n $scope.newIndex.analyzer = ($location.search().analyzer ? $location.search().analyzer : 'org.apache.lucene.analysis.en.EnglishAnalyzer');\n const isLiteralIndex = getAndRemoveOption('-literal_index');\n if (isLiteralIndex !== undefined) {\n $scope.newIndex.isLiteralIndex = isLiteralIndex;\n }\n if (window.editor) {\n $scope.setQuery($scope.samples['literals']);\n }\n }\n if ($scope.viewType === 'predication' && $scope.allSamples) {\n SimilarityRestService.getIndexes()\n .success(function (data) {\n $scope.literalIndexes = ['no-index'].concat(data\n .filter(function (idx) {\n return idx.type === 'textLiteral' && (idx.status === 'BUILT' || idx.status === 'OUTDATED')\n })\n .map(function (idx) {\n return idx.name;\n }));\n\n if ($scope.newIndex.inputIndex === undefined) {\n const desiredIdx = getAndRemoveOption('-input_index');\n if (desiredIdx !== undefined) {\n for (let j = 0; j < $scope.literalIndexes.length; j++) {\n if (desiredIdx === $scope.literalIndexes[j]) {\n $scope.newIndex.inputIndex = $scope.literalIndexes[j];\n }\n }\n }\n }\n if ($scope.newIndex.inputIndex === undefined) {\n $scope.newIndex.inputIndex = $scope.literalIndexes[0];\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.indexes.error'));\n });\n\n $scope.samples = $scope.allSamples['predication'];\n if (window.editor) {\n $scope.setQuery($scope.samples['predication']);\n }\n }\n }\n };\n\n const filenamePattern = new RegExp('^[a-zA-Z0-9-_]+$');\n\n const validateIndex = function () {\n $scope.invalidIndexName = false;\n $scope.saveQueries();\n if (!$scope.newIndex.name) {\n $scope.invalidIndexName = $translate.instant('similarity.empty.index.name.error');\n return false;\n }\n if (!filenamePattern.test($scope.newIndex.name)) {\n $scope.invalidIndexName = $translate.instant('similarity.index.name.constraint');\n return false;\n }\n\n if (!$scope.newIndex.query) {\n toastr.error($translate.instant('similarity.empty.select.query.error'));\n return false;\n }\n\n if (!$scope.newIndex.searchQuery) {\n toastr.error($translate.instant('similarity.empty.search.query.error'));\n return false;\n }\n\n if ($scope.viewType === 'predication' && !$scope.newIndex.analogicalQuery) {\n toastr.error($translate.instant('similarity.empty.analogical.query.error'));\n return false;\n }\n\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.index.select.queries.constraint'));\n return;\n }\n\n return true;\n };\n\n const appendOption = function (option, value) {\n $scope.newIndex.options = $scope.newIndex.options + ($scope.newIndex.options === '' ? '' : ' ') + option + ' ' + value;\n };\n\n SimilarityRestService.getSearchQueries().success(function (data) {\n $scope.searchQueries = data;\n SimilarityRestService.getSamples().success(function (samples) {\n defaultTabConfig.query = $location.search().selectQuery ? $location.search().selectQuery : samples['text']['literals'];\n defaultTabConfig.inference = !($location.search().infer === 'false');\n defaultTabConfig.sameAs = !($location.search().sameAs === 'false');\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n $scope.currentQuery = angular.copy(defaultTabConfig);\n $scope.allSamples = samples;\n initForViewType();\n });\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.search.queries.error'));\n });\n\n $scope.$watch('viewType', function () {\n initForViewType();\n });\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_SIMILARITY_HELP) === 1;\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_SIMILARITY_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_SIMILARITY_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_SIMILARITY_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n $scope.viewQuery = function () {\n if (!validateIndex()) {\n return;\n }\n\n SimilarityRestService.getQuery({\n indexName: $scope.newIndex.name,\n indexOptions: $scope.newIndex.options,\n query: $scope.currentQuery.query,\n indexStopList: $scope.newIndex.stopList,\n queryInference: $scope.currentQuery.inference,\n querySameAs: $scope.currentQuery.sameAs,\n viewType: $scope.viewType,\n indexAnalyzer: $scope.newIndex.analyzer\n }).success(function (query) {\n if (query) {\n $uibModal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n }).error(function (error) {\n const msg = getError(error);\n toastr.error(msg);\n });;\n };\n\n $scope.$watch('newIndex.name', function () {\n $scope.isInvalidIndexName = false;\n $scope.isEmptyIndexName = false;\n });\n\n $scope.saveQueries = function () {\n // save the current query\n const query = window.editor.getValue().trim();\n if ($scope.page === 1) {\n $scope.newIndex.query = query;\n } else if ($scope.page === 2) {\n $scope.newIndex.searchQuery = query;\n } else if ($scope.page === 3) {\n $scope.newIndex.analogicalQuery = query;\n }\n };\n\n $scope.goToPage = function (page) {\n // ugly fix for GDB-3099\n if (page !== 1 && $scope.viewMode !== 'yasr') {\n $scope.showEditor();\n $timeout(function () {\n if (page === 2) {\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n }\n if (page === 3) {\n $scope.currentQuery.query = $scope.newIndex.analogicalQuery;\n }\n\n window.editor.setValue($scope.currentQuery.query || ' ');\n });\n }\n\n $scope.saveQueries();\n // get the saved query\n if (page === 1) {\n $scope.currentQuery.query = $scope.newIndex.query;\n } else if (page === 2) {\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n } else if (page === 3) {\n $scope.currentQuery.query = $scope.newIndex.analogicalQuery;\n }\n\n loadTab();\n $scope.notoolbar = page !== 1;\n\n $scope.page = page;\n };\n\n $scope.createIndex = function () {\n if (!validateIndex()) {\n return;\n }\n // Check existing indexes\n SimilarityRestService.getIndexes()\n .success(function (data) {\n data.forEach(function (index) {\n if (index.name === $scope.newIndex.name) {\n $scope.invalidIndexName = $translate.instant('similarity.existing.index.name.error');\n }\n });\n if (!$scope.invalidIndexName) {\n let indexType = $scope.viewType;\n\n if ($scope.literalIndexes !== undefined) {\n const inputIndex = $scope.newIndex.inputIndex;\n if (inputIndex !== $scope.literalIndexes[0]) {\n appendOption('-input_index', inputIndex);\n }\n }\n if ($scope.newIndex.isLiteralIndex === 'true') {\n appendOption('-literal_index', 'true');\n indexType = 'textLiteral';\n }\n\n SimilarityRestService.createIndex('POST',\n $scope.newIndex.name,\n $scope.newIndex.options,\n $scope.newIndex.query,\n $scope.newIndex.searchQuery,\n $scope.newIndex.analogicalQuery,\n $scope.newIndex.stopList,\n $scope.currentQuery.inference,\n $scope.currentQuery.sameAs,\n indexType,\n $scope.newIndex.analyzer)\n .error(function (err) {\n toastr.error(getError(err), $translate.instant('similarity.create.index.error'));\n });\n $location.url('similarity');\n }\n\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.indexes.error'));\n });\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n // TODO don't copy paste each time, this is the same as in the graph config\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n\n $scope.showEditor = function () {\n if (window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n $scope.getActiveRepository();\n\n function getAndRemoveOption(key) {\n const optArr = $scope.newIndex.options.split(' ');\n for (let i = 0; i < optArr.length; i++) {\n if (optArr[i] === key && i + 1 < optArr.length) {\n const value = optArr[i + 1];\n\n delete optArr[i];\n delete optArr[i + 1];\n $scope.newIndex.options = optArr.join(' ');\n\n return value;\n }\n }\n return undefined;\n }\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector('.CodeMirror-wrap')) {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n //window.editor.refresh();\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView);\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector('.CodeMirror-wrap').style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab();\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.indexes.select.queries.constraint'));\n return;\n }\n if (explain && window.editor.getQueryType() !== 'SELECT') {\n toastr.warning($translate.instant('similarity.explain.select.queries.constraint'));\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning($translate.instant('cannot.execute.update.error'));\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch();\n }\n\n setLoader(true, $translate.instant('evaluating.query.msg'));\n window.editor.query();\n }\n }\n\n // FIXME: this is copy-pasted in graphs-config.controller.js and query-editor.controller.js. Find a way to avoid duplications\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n //tab.query = window.editor.getValue();\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n const tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query === null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query || ' ');\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n };\n\n $scope.saveSearchQuery = function () {\n // Should validate that query is SELECT\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.index.select.queries.constraint'));\n return;\n }\n let data = {\n name: $scope.newIndex.name,\n changedQuery: $scope.currentQuery.query,\n isSearchQuery: $scope.page === 2\n };\n\n return SimilarityRestService.saveSearchQuery(JSON.stringify(data))\n .then(async function () {\n await Notifications.showToastMessageWithDelay($scope.page === 2 ? 'similarity.changed.search.query.msg' : 'similarity.changed.analogical.query.msg');\n $location.url('similarity');\n }, function (response) {\n toastr.error(getError(response), $translate.instant('similarity.change.query.error'));\n });\n };\n\n $scope.getCloseBtnMsg = function () {\n let operationType = $scope.editSearchQuery ? $translate.instant('similarity.query.edition.msg') : $translate.instant('similarity.index.creation.msg');\n return $translate.instant('similarity.close.btn.msg', {operation: operationType});\n }\n}\n","angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/similarity/controllers/create-index.controller.js","webpack:///./src/js/angular/utils/notifications.js"],"names":["CreateSimilarityIdxCtrl","$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","indexType","search","type","undefined","startsWith","viewType","newIndex","info","page","defaultTabConfig","id","name","query","inference","sameAs","initForViewType","indexNameFromLocation","editSearchQuery","options","searchQueries","searchQuery","analogicalQuery","currentQuery","notoolbarInference","notoolbarSameAs","window","editor","setQuery","allSamples","samples","stopList","analyzer","isLiteralIndex","getAndRemoveOption","getIndexes","success","data","literalIndexes","concat","filter","idx","status","map","inputIndex","desiredIdx","j","length","error","msg","getError","instant","filenamePattern","RegExp","validateIndex","invalidIndexName","saveQueries","test","getQueryType","appendOption","option","value","key","optArr","split","i","join","saveQueryToLocal","currentQueryTab","setLoader","isRunning","progressMessage","extraMessage","yasrInnerContainer","angular","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","body","verticalView","orientationViewMode","viewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","$on","cancel","yasr","container","resize","showHideEditor","selectTab","$","tab","runQuery","changePage","explain","executedQueryTab","warning","getQueryMode","explainRequested","currentTabConfig","resultsCount","resetCurrentTabConfig","getNamespaces","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","addKnownPrefixes","JSON","stringify","getValue","isDefined","setValue","getExistingTabId","existingTabId","tabsData","item","loadTab","queryType","offset","allResultsCount","pageSize","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","getSearchQueries","getSamples","selectQuery","infer","tabs","copy","$watch","helpHidden","get","HIDE_SIMILARITY_HELP","toggleHelp","set","viewQuery","getQuery","indexName","indexOptions","indexStopList","queryInference","querySameAs","indexAnalyzer","open","templateUrl","controller","resolve","isInvalidIndexName","isEmptyIndexName","trim","goToPage","showEditor","notoolbar","createIndex","index","err","url","xhr","abort","showPreview","outputType","queryExists","saveTab","findTabIndexByID","addNewTab","callback","tabName","savedQuery","changePagination","toggleSampleQueries","querySelected","tabId","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","message","changeViewMode","tabID","remove","focusQueryEditor","find","is","focus","getActiveRepository","on","$watchCollection","tabEvent","relatedTarget","target","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","saveSearchQuery","changedQuery","isSearchQuery","then","async","showToastMessageWithDelay","response","getCloseBtnMsg","operationType","operation","module","$inject","Promise","r","setTimeout","factory"],"mappings":"+FAAA,kBAYA,SAASA,EAAwBC,EAAQC,EAAQC,EAAWC,EAAUC,EAAuBC,EAAmBC,EAAWC,EAAaC,EAAeC,EAA8BC,EAAqBC,EAAQC,GAE9M,MAAMC,EAAYP,EAAUQ,SAASC,UACnBC,IAAdH,GAA2BA,EAAUI,WAAW,QAChDjB,EAAOkB,SAAW,OAElBlB,EAAOkB,SAAWL,EAKtBb,EAAOmB,SAAW,GAElBnB,EAAOoB,KAAOb,EACdP,EAAOqB,KAAO,EAEd,MAAMC,EAAmB,CACr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abb5f0.bundle.js","sourcesContent":["import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.similarity.controllers.create', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('CreateSimilarityIdxCtrl', CreateSimilarityIdxCtrl);\n\nCreateSimilarityIdxCtrl.$inject = ['$scope', 'toastr', '$uibModal', '$timeout', 'SimilarityRestService', 'SparqlRestService', '$location', 'productInfo', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction CreateSimilarityIdxCtrl($scope, toastr, $uibModal, $timeout, SimilarityRestService, SparqlRestService, $location, productInfo, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys, $translate) {\n\n const indexType = $location.search().type;\n if (indexType === undefined || indexType.startsWith('text')) {\n $scope.viewType = 'text';\n } else {\n $scope.viewType = indexType;\n }\n\n const textDefaultOptions = '-termweight idf';\n const predDefaultOptions = '';\n $scope.newIndex = {};\n\n $scope.info = productInfo;\n $scope.page = 1;\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: '',\n inference: true,\n sameAs: true\n };\n\n let getNewIndexName = function (indexNameFromLocation) {\n if (indexNameFromLocation) {\n if ($scope.page !== 1) {\n return indexNameFromLocation;\n } else {\n return 'Copy_of_' + indexNameFromLocation;\n }\n }\n return '';\n };\n\n const initForViewType = function () {\n $scope.editSearchQuery = $location.search().editSearchQuery;\n $scope.page = $scope.editSearchQuery ? 2 : 1;\n $scope.newIndex.name = getNewIndexName($location.search().name);\n $scope.newIndex.options = ($location.search().options ? $location.search().options : ($scope.viewType === \"text\") ? textDefaultOptions : predDefaultOptions);\n\n if ($scope.searchQueries) {\n $scope.newIndex.searchQuery = $location.search().searchQuery ? $location.search().searchQuery : $scope.searchQueries[$scope.viewType];\n if ($scope.viewType === 'predication') {\n $scope.newIndex.analogicalQuery = $location.search().analogicalQuery ? $location.search().analogicalQuery : $scope.searchQueries['analogical'];\n }\n }\n\n if ($scope.editSearchQuery) {\n // Default will be opened search query tab for edition\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n $scope.notoolbarInference = true;\n $scope.notoolbarSameAs = true;\n if (window.editor) {\n $scope.setQuery($scope.newIndex.searchQuery);\n }\n } else {\n if ($scope.viewType === 'text' && $scope.allSamples) {\n $scope.samples = $scope.allSamples['text'];\n $scope.newIndex.stopList = ($location.search().stopList ? $location.search().stopList : undefined);\n $scope.newIndex.analyzer = ($location.search().analyzer ? $location.search().analyzer : 'org.apache.lucene.analysis.en.EnglishAnalyzer');\n const isLiteralIndex = getAndRemoveOption('-literal_index');\n if (isLiteralIndex !== undefined) {\n $scope.newIndex.isLiteralIndex = isLiteralIndex;\n }\n if (window.editor) {\n $scope.setQuery($scope.samples['literals']);\n }\n }\n if ($scope.viewType === 'predication' && $scope.allSamples) {\n SimilarityRestService.getIndexes()\n .success(function (data) {\n $scope.literalIndexes = ['no-index'].concat(data\n .filter(function (idx) {\n return idx.type === 'textLiteral' && (idx.status === 'BUILT' || idx.status === 'OUTDATED')\n })\n .map(function (idx) {\n return idx.name;\n }));\n\n if ($scope.newIndex.inputIndex === undefined) {\n const desiredIdx = getAndRemoveOption('-input_index');\n if (desiredIdx !== undefined) {\n for (let j = 0; j < $scope.literalIndexes.length; j++) {\n if (desiredIdx === $scope.literalIndexes[j]) {\n $scope.newIndex.inputIndex = $scope.literalIndexes[j];\n }\n }\n }\n }\n if ($scope.newIndex.inputIndex === undefined) {\n $scope.newIndex.inputIndex = $scope.literalIndexes[0];\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.indexes.error'));\n });\n\n $scope.samples = $scope.allSamples['predication'];\n if (window.editor) {\n $scope.setQuery($scope.samples['predication']);\n }\n }\n }\n };\n\n const filenamePattern = new RegExp('^[a-zA-Z0-9-_]+$');\n\n const validateIndex = function () {\n $scope.invalidIndexName = false;\n $scope.saveQueries();\n if (!$scope.newIndex.name) {\n $scope.invalidIndexName = $translate.instant('similarity.empty.index.name.error');\n return false;\n }\n if (!filenamePattern.test($scope.newIndex.name)) {\n $scope.invalidIndexName = $translate.instant('similarity.index.name.constraint');\n return false;\n }\n\n if (!$scope.newIndex.query) {\n toastr.error($translate.instant('similarity.empty.select.query.error'));\n return false;\n }\n\n if (!$scope.newIndex.searchQuery) {\n toastr.error($translate.instant('similarity.empty.search.query.error'));\n return false;\n }\n\n if ($scope.viewType === 'predication' && !$scope.newIndex.analogicalQuery) {\n toastr.error($translate.instant('similarity.empty.analogical.query.error'));\n return false;\n }\n\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.index.select.queries.constraint'));\n return;\n }\n\n return true;\n };\n\n const appendOption = function (option, value) {\n $scope.newIndex.options = $scope.newIndex.options + ($scope.newIndex.options === '' ? '' : ' ') + option + ' ' + value;\n };\n\n SimilarityRestService.getSearchQueries().success(function (data) {\n $scope.searchQueries = data;\n SimilarityRestService.getSamples().success(function (samples) {\n defaultTabConfig.query = $location.search().selectQuery ? $location.search().selectQuery : samples['text']['literals'];\n defaultTabConfig.inference = !($location.search().infer === 'false');\n defaultTabConfig.sameAs = !($location.search().sameAs === 'false');\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n $scope.currentQuery = angular.copy(defaultTabConfig);\n $scope.allSamples = samples;\n initForViewType();\n });\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.search.queries.error'));\n });\n\n $scope.$watch('viewType', function () {\n initForViewType();\n });\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_SIMILARITY_HELP) === 1;\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_SIMILARITY_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_SIMILARITY_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_SIMILARITY_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n $scope.viewQuery = function () {\n if (!validateIndex()) {\n return;\n }\n\n SimilarityRestService.getQuery({\n indexName: $scope.newIndex.name,\n indexOptions: $scope.newIndex.options,\n query: $scope.currentQuery.query,\n indexStopList: $scope.newIndex.stopList,\n queryInference: $scope.currentQuery.inference,\n querySameAs: $scope.currentQuery.sameAs,\n viewType: $scope.viewType,\n indexAnalyzer: $scope.newIndex.analyzer\n }).success(function (query) {\n if (query) {\n $uibModal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n }).error(function (error) {\n const msg = getError(error);\n toastr.error(msg);\n });;\n };\n\n $scope.$watch('newIndex.name', function () {\n $scope.isInvalidIndexName = false;\n $scope.isEmptyIndexName = false;\n });\n\n $scope.saveQueries = function () {\n // save the current query\n const query = window.editor.getValue().trim();\n if ($scope.page === 1) {\n $scope.newIndex.query = query;\n } else if ($scope.page === 2) {\n $scope.newIndex.searchQuery = query;\n } else if ($scope.page === 3) {\n $scope.newIndex.analogicalQuery = query;\n }\n };\n\n $scope.goToPage = function (page) {\n // ugly fix for GDB-3099\n if (page !== 1 && $scope.viewMode !== 'yasr') {\n $scope.showEditor();\n $timeout(function () {\n if (page === 2) {\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n }\n if (page === 3) {\n $scope.currentQuery.query = $scope.newIndex.analogicalQuery;\n }\n\n window.editor.setValue($scope.currentQuery.query || ' ');\n });\n }\n\n $scope.saveQueries();\n // get the saved query\n if (page === 1) {\n $scope.currentQuery.query = $scope.newIndex.query;\n } else if (page === 2) {\n $scope.currentQuery.query = $scope.newIndex.searchQuery;\n } else if (page === 3) {\n $scope.currentQuery.query = $scope.newIndex.analogicalQuery;\n }\n\n loadTab();\n $scope.notoolbar = page !== 1;\n\n $scope.page = page;\n };\n\n $scope.createIndex = function () {\n if (!validateIndex()) {\n return;\n }\n // Check existing indexes\n SimilarityRestService.getIndexes()\n .success(function (data) {\n data.forEach(function (index) {\n if (index.name === $scope.newIndex.name) {\n $scope.invalidIndexName = $translate.instant('similarity.existing.index.name.error');\n }\n });\n if (!$scope.invalidIndexName) {\n let indexType = $scope.viewType;\n\n if ($scope.literalIndexes !== undefined) {\n const inputIndex = $scope.newIndex.inputIndex;\n if (inputIndex !== $scope.literalIndexes[0]) {\n appendOption('-input_index', inputIndex);\n }\n }\n if ($scope.newIndex.isLiteralIndex === 'true') {\n appendOption('-literal_index', 'true');\n indexType = 'textLiteral';\n }\n\n SimilarityRestService.createIndex('POST',\n $scope.newIndex.name,\n $scope.newIndex.options,\n $scope.newIndex.query,\n $scope.newIndex.searchQuery,\n $scope.newIndex.analogicalQuery,\n $scope.newIndex.stopList,\n $scope.currentQuery.inference,\n $scope.currentQuery.sameAs,\n indexType,\n $scope.newIndex.analyzer)\n .error(function (err) {\n toastr.error(getError(err), $translate.instant('similarity.create.index.error'));\n });\n $location.url('similarity');\n }\n\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('similarity.could.not.get.indexes.error'));\n });\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n // TODO don't copy paste each time, this is the same as in the graph config\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n\n $scope.showEditor = function () {\n if (window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n $scope.getActiveRepository();\n\n function getAndRemoveOption(key) {\n const optArr = $scope.newIndex.options.split(' ');\n for (let i = 0; i < optArr.length; i++) {\n if (optArr[i] === key && i + 1 < optArr.length) {\n const value = optArr[i + 1];\n\n delete optArr[i];\n delete optArr[i + 1];\n $scope.newIndex.options = optArr.join(' ');\n\n return value;\n }\n }\n return undefined;\n }\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector('.CodeMirror-wrap')) {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n //window.editor.refresh();\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView);\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector('.CodeMirror-wrap').style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab();\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.indexes.select.queries.constraint'));\n return;\n }\n if (explain && window.editor.getQueryType() !== 'SELECT') {\n toastr.warning($translate.instant('similarity.explain.select.queries.constraint'));\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning($translate.instant('cannot.execute.update.error'));\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch();\n }\n\n setLoader(true, $translate.instant('evaluating.query.msg'));\n window.editor.query();\n }\n }\n\n // FIXME: this is copy-pasted in graphs-config.controller.js and query-editor.controller.js. Find a way to avoid duplications\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n //tab.query = window.editor.getValue();\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n const tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query === null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query || ' ');\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n };\n\n $scope.saveSearchQuery = function () {\n // Should validate that query is SELECT\n if (window.editor.getQueryType() !== 'SELECT') {\n toastr.error($translate.instant('similarity.index.select.queries.constraint'));\n return;\n }\n let data = {\n name: $scope.newIndex.name,\n changedQuery: $scope.currentQuery.query,\n isSearchQuery: $scope.page === 2\n };\n\n return SimilarityRestService.saveSearchQuery(JSON.stringify(data))\n .then(async function () {\n await Notifications.showToastMessageWithDelay($scope.page === 2 ? 'similarity.changed.search.query.msg' : 'similarity.changed.analogical.query.msg');\n $location.url('similarity');\n }, function (response) {\n toastr.error(getError(response), $translate.instant('similarity.change.query.error'));\n });\n };\n\n $scope.getCloseBtnMsg = function () {\n let operationType = $scope.editSearchQuery ? $translate.instant('similarity.query.edition.msg') : $translate.instant('similarity.index.creation.msg');\n return $translate.instant('similarity.close.btn.msg', {operation: operationType});\n }\n}\n","angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[55,134],{106:function(e,t,r){"use strict";r.r(t);r(4),r(10),r(13),r(40),r(14);var n=r(0);function a(e,t,r,n,a,i,s){e.pluginName="sparql-template",e.setPluginIsActive=function(t){e.pluginIsActive=t},e.getSparqlTemplates=function(){i.isLicenseValid()&&t.getActiveRepository()&&!t.isActiveRepoOntopType()&&!t.isActiveRepoFedXType()?r.getSparqlTemplates(t.getActiveRepository()).success((function(t){e.sparqlTemplateIds=t})).error((function(e){const t=getError(e);n.error(t,s.instant("sparql.template.get.templates.error"))})):e.sparqlTemplateIds=[]},e.$watch((function(){return t.getActiveRepository()}),(function(){e.getSparqlTemplates()})),e.deleteTemplate=function(i){a.openSimpleModal({title:s.instant("common.warning"),message:s.instant("sparql.template.delete.template.warning",{templateID:i}),warning:!0}).result.then((function(){r.deleteSparqlTemplate(i,t.getActiveRepository()).success((function(){n.success(i,s.instant("sparql.template.delete.template.success")),e.getSparqlTemplates()})).error((function(e){n.error(getError(e),s.instant("sparql.template.delete.template.failure",{templateID:i}))}))}))}}function i(e,t,r,a,i,s,o,c,u,l,p,m){const d=t.hash()||"";e.templateID=(t.search().templateID||"")+(d?"#"+d:""),e.title=(e.templateID?m.instant("edit"):m.instant("common.create.btn"))+" SPARQL Template",e.getNamespaces=function(){v(!0,m.instant("common.refreshing.namespaces"),m.instant("common.extra.message")),c.getRepositoryNamespaces().success((function(t){const r={};t.results.bindings.forEach((function(e){r[e.prefix.value]=e.namespace.value})),e.namespaces=r})).error((function(t){e.repositoryError=getError(t)})).finally((function(){v(!1),I()}))},e.setLoader=v,e.addKnownPrefixes=D,e.noPadding={paddingRight:0,paddingLeft:0},e.currentTabConfig={},e.orientationViewMode=!0,e.currentQuery={};let f=!1;e.$watch((function(){return a.getActiveRepository()}),(function(e,r){e!==r&&t.path("/sparql-templates")}));let g=null;e.goBack=function(){g=s((function(){i.history.back()}),1e3)};const y=e.$on("$locationChangeStart",(function(t){!function(t){e.currentQuery.isPristine||(confirm(m.instant("jdbc.warning.unsaved.changes"))?(window.removeEventListener("beforeunload",w),y(),s.cancel(g)):t.preventDefault())}(t)}));function w(t){e.currentQuery.isPristine||(t.returnValue=!0)}window.addEventListener("beforeunload",w),e.$on("$destroy",(function(e){window.removeEventListener("beforeunload",w),y(),s.cancel(g)}));const T={templateID:"",query:"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX ex: <http://example.com#>\nDELETE {\n ?subject ex:myPredicate ?oldValue .\n} INSERT {\n ?subject ex:myPredicate ?newValue .\n} WHERE {\n ?id rdf:type ex:MyType .\n ?subject ex:isRelatedTo ?id .\n}\n",inference:!0,sameAs:!0,isNewTemplate:!0,isPristine:!0};var q;function v(t,r,n){const a=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=r,e.extraMessage=n,a.addClass("hide")):(e.progressMessage="",e.extraMessage="",a.removeClass("hide")),null===e.$$phase&&e.$apply()}function I(){e.tabsData=[e.currentQuery];const t=e.currentQuery;e.currentQuery.query?window.editor.setValue(e.currentQuery.query):window.editor.setValue(" "),s((function(){e.currentTabConfig={},e.currentTabConfig.queryType=t.queryType,e.currentTabConfig.resultsCount=t.resultsCount,e.currentTabConfig.offset=t.offset,e.currentTabConfig.allResultsCount=t.allResultsCount,e.currentTabConfig.page=t.page,e.currentTabConfig.pageSize=t.pageSize,e.currentTabConfig.timeFinished=t.timeFinished,e.currentTabConfig.timeTook=t.timeTook,e.currentTabConfig.sizeDelta=t.sizeDelta,e.$apply()}),0),e.canWriteActiveRepo()||(window.editor.options.readOnly=!0)}function b(){e.tabsData=e.tabs=[T],e.currentQuery=angular.copy(T),window.editor&&(e.setQuery(e.currentQuery.query),I()),e.$watch((function(){return e.currentQuery.query}),(function(t,r){t!==r&&e.setDirty()}))}function D(){u.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return r.error(t,m.instant("common.add.known.prefixes.error")),!0}))}function Q(){o.createSparqlTemplate(e.currentQuery,a.getActiveRepository()).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewTemplate=!1,r.success(e.currentQuery.templateID,m.instant("save.sparql.template.success.msg")),e.goBack()})).error((function(t){const n=getError(t);r.error(n,m.instant("save.sparql.template.failure.msg",{templateID:e.currentQuery.templateID}))}))}e.saveTab=function(){},e.setQuery=function(e){window.editor.setValue(e||" ")},e.templateID?(q=e.templateID,o.getSparqlTemplate(q,a.getActiveRepository()).success((function(e){T.query=e,T.templateID=q,T.isNewTemplate=!q,b()})).error((function(t){const n=getError(t);r.error(n,m.instant("sparql.template.get.template.error",{templateID:e.currentQuery.templateID})),e.repositoryError=n}))):b(),e.saveTemplate=function(){(function(){if(!window.editor||"update"!==window.editor.getQueryMode())return r.error(m.instant("sparql.template.query.constraint"),m.instant("jdbc.invalid.query")),!1;return!0})()&&(e.currentQuery.templateID?(e.isInvalidTemplateId=!l.isValidIri(e.currentQuery.templateID),e.isInvalidTemplateId||(e.currentQuery.isNewTemplate?o.getSparqlTemplates(a.getActiveRepository()).success((function(t){f=t.find(t=>t===e.currentQuery.templateID)})).error((function(e){const t=getError(e);r.error(t,m.instant("sparql.template.get.templates.error"))})).then(()=>{if(f){const t=Object(n.decodeHTML)(m.instant("sparql.template.existing.template.error",{templateID:e.currentQuery.templateID}));p.openSimpleModal({title:m.instant("common.confirm.save"),message:t,warning:!0}).result.then((function(){Q()}))}else Q()}):e.currentQuery.isPristine?e.goBack():o.updateSparqlTemplate(e.currentQuery,a.getActiveRepository()).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewTemplate=!1,r.success(e.currentQuery.templateID,m.instant("update.sparql.template.success.msg")),e.goBack()})).error((function(t){const n=getError(t);r.error(n,m.instant("save.sparql.template.failure.msg",{templateID:e.currentQuery.templateID}))})))):r.error(m.instant("sparql.template.iri.constraint")))},$("textarea").on("paste",(function(){s((function(){D()}),0)})),e.setDirty=function(){e.currentQuery.isPristine=!1}}angular.module("graphdb.framework.sparql-template.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr"],["graphdb.framework.utils.notifications"]).controller("SparqlTemplatesCtrl",a).controller("SparqlTemplateCreateCtrl",i),a.$inject=["$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate"],i.$inject=["$scope","$location","toastr","$repositories","$window","$timeout","SparqlTemplatesRestService","RDF4JRepositoriesRestService","SparqlRestService","UriUtils","ModalService","$translate"]},40:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(n=>{e.success(t.instant(r)),setTimeout(n,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]}}]);
2
- //# sourceMappingURL=55.693c1a0dd775181e1e29.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[55,134],{107:function(e,t,r){"use strict";r.r(t);r(4),r(10),r(13),r(40),r(14);var n=r(0);function a(e,t,r,n,a,i,s){e.pluginName="sparql-template",e.setPluginIsActive=function(t){e.pluginIsActive=t},e.getSparqlTemplates=function(){i.isLicenseValid()&&t.getActiveRepository()&&!t.isActiveRepoOntopType()&&!t.isActiveRepoFedXType()?r.getSparqlTemplates(t.getActiveRepository()).success((function(t){e.sparqlTemplateIds=t})).error((function(e){const t=getError(e);n.error(t,s.instant("sparql.template.get.templates.error"))})):e.sparqlTemplateIds=[]},e.$watch((function(){return t.getActiveRepository()}),(function(){e.getSparqlTemplates()})),e.deleteTemplate=function(i){a.openSimpleModal({title:s.instant("common.warning"),message:s.instant("sparql.template.delete.template.warning",{templateID:i}),warning:!0}).result.then((function(){r.deleteSparqlTemplate(i,t.getActiveRepository()).success((function(){n.success(i,s.instant("sparql.template.delete.template.success")),e.getSparqlTemplates()})).error((function(e){n.error(getError(e),s.instant("sparql.template.delete.template.failure",{templateID:i}))}))}))}}function i(e,t,r,a,i,s,o,c,u,l,p,m){const d=t.hash()||"";e.templateID=(t.search().templateID||"")+(d?"#"+d:""),e.title=(e.templateID?m.instant("edit"):m.instant("common.create.btn"))+" SPARQL Template",e.getNamespaces=function(){v(!0,m.instant("common.refreshing.namespaces"),m.instant("common.extra.message")),c.getRepositoryNamespaces().success((function(t){const r={};t.results.bindings.forEach((function(e){r[e.prefix.value]=e.namespace.value})),e.namespaces=r})).error((function(t){e.repositoryError=getError(t)})).finally((function(){v(!1),I()}))},e.setLoader=v,e.addKnownPrefixes=D,e.noPadding={paddingRight:0,paddingLeft:0},e.currentTabConfig={},e.orientationViewMode=!0,e.currentQuery={};let f=!1;e.$watch((function(){return a.getActiveRepository()}),(function(e,r){e!==r&&t.path("/sparql-templates")}));let g=null;e.goBack=function(){g=s((function(){i.history.back()}),1e3)};const y=e.$on("$locationChangeStart",(function(t){!function(t){e.currentQuery.isPristine||(confirm(m.instant("jdbc.warning.unsaved.changes"))?(window.removeEventListener("beforeunload",w),y(),s.cancel(g)):t.preventDefault())}(t)}));function w(t){e.currentQuery.isPristine||(t.returnValue=!0)}window.addEventListener("beforeunload",w),e.$on("$destroy",(function(e){window.removeEventListener("beforeunload",w),y(),s.cancel(g)}));const T={templateID:"",query:"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX ex: <http://example.com#>\nDELETE {\n ?subject ex:myPredicate ?oldValue .\n} INSERT {\n ?subject ex:myPredicate ?newValue .\n} WHERE {\n ?id rdf:type ex:MyType .\n ?subject ex:isRelatedTo ?id .\n}\n",inference:!0,sameAs:!0,isNewTemplate:!0,isPristine:!0};var q;function v(t,r,n){const a=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=r,e.extraMessage=n,a.addClass("hide")):(e.progressMessage="",e.extraMessage="",a.removeClass("hide")),null===e.$$phase&&e.$apply()}function I(){e.tabsData=[e.currentQuery];const t=e.currentQuery;e.currentQuery.query?window.editor.setValue(e.currentQuery.query):window.editor.setValue(" "),s((function(){e.currentTabConfig={},e.currentTabConfig.queryType=t.queryType,e.currentTabConfig.resultsCount=t.resultsCount,e.currentTabConfig.offset=t.offset,e.currentTabConfig.allResultsCount=t.allResultsCount,e.currentTabConfig.page=t.page,e.currentTabConfig.pageSize=t.pageSize,e.currentTabConfig.timeFinished=t.timeFinished,e.currentTabConfig.timeTook=t.timeTook,e.currentTabConfig.sizeDelta=t.sizeDelta,e.$apply()}),0),e.canWriteActiveRepo()||(window.editor.options.readOnly=!0)}function b(){e.tabsData=e.tabs=[T],e.currentQuery=angular.copy(T),window.editor&&(e.setQuery(e.currentQuery.query),I()),e.$watch((function(){return e.currentQuery.query}),(function(t,r){t!==r&&e.setDirty()}))}function D(){u.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return r.error(t,m.instant("common.add.known.prefixes.error")),!0}))}function Q(){o.createSparqlTemplate(e.currentQuery,a.getActiveRepository()).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewTemplate=!1,r.success(e.currentQuery.templateID,m.instant("save.sparql.template.success.msg")),e.goBack()})).error((function(t){const n=getError(t);r.error(n,m.instant("save.sparql.template.failure.msg",{templateID:e.currentQuery.templateID}))}))}e.saveTab=function(){},e.setQuery=function(e){window.editor.setValue(e||" ")},e.templateID?(q=e.templateID,o.getSparqlTemplate(q,a.getActiveRepository()).success((function(e){T.query=e,T.templateID=q,T.isNewTemplate=!q,b()})).error((function(t){const n=getError(t);r.error(n,m.instant("sparql.template.get.template.error",{templateID:e.currentQuery.templateID})),e.repositoryError=n}))):b(),e.saveTemplate=function(){(function(){if(!window.editor||"update"!==window.editor.getQueryMode())return r.error(m.instant("sparql.template.query.constraint"),m.instant("jdbc.invalid.query")),!1;return!0})()&&(e.currentQuery.templateID?(e.isInvalidTemplateId=!l.isValidIri(e.currentQuery.templateID),e.isInvalidTemplateId||(e.currentQuery.isNewTemplate?o.getSparqlTemplates(a.getActiveRepository()).success((function(t){f=t.find(t=>t===e.currentQuery.templateID)})).error((function(e){const t=getError(e);r.error(t,m.instant("sparql.template.get.templates.error"))})).then(()=>{if(f){const t=Object(n.decodeHTML)(m.instant("sparql.template.existing.template.error",{templateID:e.currentQuery.templateID}));p.openSimpleModal({title:m.instant("common.confirm.save"),message:t,warning:!0}).result.then((function(){Q()}))}else Q()}):e.currentQuery.isPristine?e.goBack():o.updateSparqlTemplate(e.currentQuery,a.getActiveRepository()).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewTemplate=!1,r.success(e.currentQuery.templateID,m.instant("update.sparql.template.success.msg")),e.goBack()})).error((function(t){const n=getError(t);r.error(n,m.instant("save.sparql.template.failure.msg",{templateID:e.currentQuery.templateID}))})))):r.error(m.instant("sparql.template.iri.constraint")))},$("textarea").on("paste",(function(){s((function(){D()}),0)})),e.setDirty=function(){e.currentQuery.isPristine=!1}}angular.module("graphdb.framework.sparql-template.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr"],["graphdb.framework.utils.notifications"]).controller("SparqlTemplatesCtrl",a).controller("SparqlTemplateCreateCtrl",i),a.$inject=["$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate"],i.$inject=["$scope","$location","toastr","$repositories","$window","$timeout","SparqlTemplatesRestService","RDF4JRepositoriesRestService","SparqlRestService","UriUtils","ModalService","$translate"]},40:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(n=>{e.success(t.instant(r)),setTimeout(n,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]}}]);
2
+ //# sourceMappingURL=55.e8df33b84ca578a9a633.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/sparql-template/controllers.js","webpack:///./src/js/angular/utils/notifications.js"],"names":["SparqlTemplatesCtrl","$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate","pluginName","setPluginIsActive","isPluginActive","pluginIsActive","getSparqlTemplates","isLicenseValid","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","success","data","sparqlTemplateIds","error","msg","getError","instant","$watch","deleteTemplate","templateID","openSimpleModal","title","message","warning","result","then","deleteSparqlTemplate","e","SparqlTemplateCreateCtrl","$location","$window","$timeout","RDF4JRepositoriesRestService","SparqlRestService","UriUtils","hash","search","getNamespaces","setLoader","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","prefix","value","namespace","namespaces","repositoryError","finally","loadTab","addKnownPrefixes","noPadding","paddingRight","paddingLeft","currentTabConfig","orientationViewMode","currentQuery","templateExist","newValue","oldValue","path","timer","goBack","history","back","locationChangeListener","$on","event","isPristine","confirm","window","removeEventListener","showBeforeunloadMessage","cancel","preventDefault","confirmExit","returnValue","addEventListener","defaultTabConfig","query","inference","sameAs","isNewTemplate","isRunning","progressMessage","extraMessage","yasrInnerContainer","angular","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","tabsData","tab","editor","setValue","queryType","resultsCount","offset","allResultsCount","page","pageSize","timeFinished","timeTook","sizeDelta","canWriteActiveRepo","options","readOnly","setQueryFromTabConfig","tabs","copy","setQuery","setDirty","JSON","stringify","getValue","isDefined","saveNewTemplate","createSparqlTemplate","saveTab","getSparqlTemplate","templateContent","saveTemplate","getQueryMode","validateQuery","isInvalidTemplateId","isValidIri","find","templateId","modalMsg","updateSparqlTemplate","$","on","module","controller","$inject","Notifications","showToastMessageWithDelay","Promise","r","setTimeout","factory"],"mappings":"+FAAA,+CAsBA,SAASA,EAAoBC,EAAQC,EAAeC,EAA4BC,EAAQC,EAAcC,EAAiBC,GAEnHN,EAAOO,WAAa,kBAEpBP,EAAOQ,kBAAoB,SAAUC,GACjCT,EAAOU,eAAiBD,GAG5BT,EAAOW,mBAAqB,WAGpBN,EAAgBO,kBAChBX,EAAcY,wBACNZ,EAAca,0BACVb,EAAcc,uBAC1Bb,EAA2BS,mBAAmBV,EAAcY,uBAAuBG,SAAQ,SAAUC,GACjGjB,EAAOkB,kBAAoBD,KAC5BE,OAAM,SAAUF,GACf,MAAMG,EAAMC,SAASJ,GACrBd,EAAOgB,MAAMC,EAAKd,EAAWgB,QAAQ,2CAGzCtB,EAAOkB,kBAAoB,IAInClB,EAAOuB,QAAO,WACV,OAAOtB,EAAcY,yBACtB,WACCb,EAAOW,wBAGXX,EAAOwB,eAAiB,SAAUC,GAC9BrB,EAAasB,gBAAgB,CACzBC,MAAOrB,EAAWgB,QAAQ,kBAC1BM,QAAStB,EAAWgB,QAAQ,0CAA2C,CAACG,WAAYA,IACpFI,SAAS,IACVC,OACEC,MAAK,WACF7B,EAA2B8B,qBAAqBP,EAA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"55.693c1a0dd775181e1e29.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/monitoring.rest.service';\nimport 'angular/utils/notifications';\nimport 'angular/utils/uri-utils';\nimport {decodeHTML} from \"../../../app\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.monitoring.service',\n 'toastr'\n];\n\nangular.module('graphdb.framework.sparql-template.controllers', modules, [\n 'graphdb.framework.utils.notifications'\n])\n .controller('SparqlTemplatesCtrl', SparqlTemplatesCtrl)\n .controller('SparqlTemplateCreateCtrl', SparqlTemplateCreateCtrl);\n\nSparqlTemplatesCtrl.$inject = ['$scope', '$repositories', 'SparqlTemplatesRestService', 'toastr', 'ModalService', '$licenseService', '$translate'];\n\nfunction SparqlTemplatesCtrl($scope, $repositories, SparqlTemplatesRestService, toastr, ModalService, $licenseService, $translate) {\n\n $scope.pluginName = 'sparql-template';\n\n $scope.setPluginIsActive = function (isPluginActive) {\n $scope.pluginIsActive = isPluginActive;\n }\n\n $scope.getSparqlTemplates = function () {\n // Only do this if there is an active repo that isn't an Ontop repo.\n // Ontop repos doesn't support update operations.\n if ($licenseService.isLicenseValid() &&\n $repositories.getActiveRepository()\n && !$repositories.isActiveRepoOntopType()\n && !$repositories.isActiveRepoFedXType()) {\n SparqlTemplatesRestService.getSparqlTemplates($repositories.getActiveRepository()).success(function (data) {\n $scope.sparqlTemplateIds = data;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.templates.error'));\n });\n } else {\n $scope.sparqlTemplateIds = [];\n }\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function () {\n $scope.getSparqlTemplates();\n });\n\n $scope.deleteTemplate = function (templateID) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.warning'),\n message: $translate.instant('sparql.template.delete.template.warning', {templateID: templateID}),\n warning: true\n }).result\n .then(function () {\n SparqlTemplatesRestService.deleteSparqlTemplate(templateID, $repositories.getActiveRepository())\n .success(function () {\n toastr.success(templateID, $translate.instant('sparql.template.delete.template.success'));\n $scope.getSparqlTemplates();\n }).error(function (e) {\n toastr.error(getError(e), $translate.instant('sparql.template.delete.template.failure', {templateID: templateID}));\n });\n });\n };\n}\n\nSparqlTemplateCreateCtrl.$inject = ['$scope', '$location', 'toastr', '$repositories', '$window', '$timeout', 'SparqlTemplatesRestService', 'RDF4JRepositoriesRestService', 'SparqlRestService', 'UriUtils', 'ModalService', '$translate'];\n\nfunction SparqlTemplateCreateCtrl($scope, $location, toastr, $repositories, $window, $timeout, SparqlTemplatesRestService, RDF4JRepositoriesRestService, SparqlRestService, UriUtils, ModalService, $translate) {\n\n const hash = $location.hash() || '';\n $scope.templateID = ($location.search().templateID || '') + (hash ? (`#${hash}`) : '');\n $scope.title = ($scope.templateID ? $translate.instant('edit') : $translate.instant('common.create.btn')) + ' SPARQL Template';\n $scope.getNamespaces = getNamespaces;\n $scope.setLoader = setLoader;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.noPadding = {paddingRight: 0, paddingLeft: 0};\n $scope.currentTabConfig = {};\n // This property is obligatory in order to show YASQUE and YASR properly\n $scope.orientationViewMode = true;\n $scope.currentQuery = {};\n let templateExist = false;\n\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n $location.path('/sparql-templates');\n }\n });\n\n let timer = null;\n $scope.goBack = function () {\n timer = $timeout(function () {\n $window.history.back();\n }, 1000);\n };\n\n const locationChangeListener = $scope.$on('$locationChangeStart', function (event) {\n confirmExit(event);\n });\n\n window.addEventListener('beforeunload', showBeforeunloadMessage);\n\n function showBeforeunloadMessage(event) {\n if (!$scope.currentQuery.isPristine) {\n event.returnValue = true;\n }\n }\n\n function confirmExit(event) {\n if (!$scope.currentQuery.isPristine) {\n if (!confirm($translate.instant('jdbc.warning.unsaved.changes'))) {\n event.preventDefault();\n } else {\n window.removeEventListener('beforeunload', showBeforeunloadMessage);\n locationChangeListener();\n $timeout.cancel(timer);\n }\n }\n }\n\n $scope.$on('$destroy', function (event) {\n window.removeEventListener('beforeunload', showBeforeunloadMessage);\n locationChangeListener();\n $timeout.cancel(timer);\n });\n\n const defaultTabConfig = {\n templateID: '',\n query: 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\n' +\n 'PREFIX ex: <http://example.com#>\\n' +\n 'DELETE {\\n' +\n ' ?subject ex:myPredicate ?oldValue .\\n' +\n '} INSERT {\\n' +\n ' ?subject ex:myPredicate ?newValue .\\n' +\n '} WHERE {\\n' +\n ' ?id rdf:type ex:MyType .\\n' +\n ' ?subject ex:isRelatedTo ?id .\\n' +\n '}\\n',\n inference: true,\n sameAs: true,\n isNewTemplate: true,\n isPristine: true\n };\n\n $scope.saveTab = function () {\n // Should have this empty function in this view\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n if ($scope.templateID) {\n getSparqlTemplate($scope.templateID);\n } else {\n setQueryFromTabConfig();\n }\n\n // FIXME: this is copy-pasted in graphs-config.controller.js and query-editor.controller.js. Find a way to avoid duplications\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n loadTab();\n });\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n const tab = $scope.currentQuery;\n\n if (!$scope.currentQuery.query) {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n if (!$scope.canWriteActiveRepo()) {\n window.editor.options.readOnly = true;\n }\n }\n\n function getSparqlTemplate(templateID) {\n SparqlTemplatesRestService.getSparqlTemplate(templateID, $repositories.getActiveRepository() ).success(function (templateContent) {\n defaultTabConfig.query = templateContent;\n defaultTabConfig.templateID = templateID;\n\n defaultTabConfig.isNewTemplate = !templateID;\n\n setQueryFromTabConfig();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.template.error', {templateID: $scope.currentQuery.templateID}));\n $scope.repositoryError = msg;\n });\n }\n\n function setQueryFromTabConfig() {\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n $scope.currentQuery = angular.copy(defaultTabConfig);\n\n if (window.editor) {\n $scope.setQuery($scope.currentQuery.query);\n loadTab();\n }\n\n $scope.$watch(function () {\n return $scope.currentQuery.query;\n }, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n $scope.setDirty();\n }\n });\n }\n\n $scope.saveTemplate = function () {\n if (!validateQuery()) {\n return;\n }\n\n if (!$scope.currentQuery.templateID) {\n toastr.error($translate.instant('sparql.template.iri.constraint'));\n return;\n } else {\n validateTemplateID();\n if ($scope.isInvalidTemplateId) {\n return;\n }\n }\n\n if ($scope.currentQuery.isNewTemplate) {\n checkIfTemplateExists()\n .then(() => {\n if (templateExist) {\n const modalMsg = decodeHTML($translate.instant('sparql.template.existing.template.error', {templateID: $scope.currentQuery.templateID}));\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.save'),\n message: modalMsg,\n warning: true\n }).result\n .then(function () {\n saveNewTemplate();\n });\n } else {\n saveNewTemplate();\n }\n });\n } else {\n if (!$scope.currentQuery.isPristine) {\n SparqlTemplatesRestService.updateSparqlTemplate($scope.currentQuery, $repositories.getActiveRepository()).success(function () {\n $scope.currentQuery.isPristine = true;\n $scope.currentQuery.isNewTemplate = false;\n toastr.success($scope.currentQuery.templateID, $translate.instant('update.sparql.template.success.msg'));\n $scope.goBack();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('save.sparql.template.failure.msg', {templateID: $scope.currentQuery.templateID}));\n });\n } else {\n // No changes to template query, go back to\n $scope.goBack();\n }\n }\n };\n\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n $scope.setDirty = function () {\n $scope.currentQuery.isPristine = false;\n };\n\n function hasValidQuery() {\n return window.editor && window.editor.getQueryMode() === 'update';\n }\n\n function validateQuery() {\n if (!hasValidQuery()) {\n toastr.error($translate.instant('sparql.template.query.constraint'), $translate.instant('jdbc.invalid.query'));\n return false;\n }\n\n return true;\n }\n\n function validateTemplateID() {\n $scope.isInvalidTemplateId = !UriUtils.isValidIri($scope.currentQuery.templateID);\n }\n\n function saveNewTemplate() {\n SparqlTemplatesRestService.createSparqlTemplate($scope.currentQuery, $repositories.getActiveRepository()).success(function () {\n $scope.currentQuery.isPristine = true;\n $scope.currentQuery.isNewTemplate = false;\n toastr.success($scope.currentQuery.templateID, $translate.instant('save.sparql.template.success.msg'));\n $scope.goBack();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('save.sparql.template.failure.msg', {templateID: $scope.currentQuery.templateID}));\n });\n }\n\n function checkIfTemplateExists() {\n return SparqlTemplatesRestService\n .getSparqlTemplates($repositories.getActiveRepository())\n .success(function (data) {\n templateExist = data.find((templateId) => templateId === $scope.currentQuery.templateID);\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.templates.error'));\n });\n }\n}\n","angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/sparql-template/controllers.js","webpack:///./src/js/angular/utils/notifications.js"],"names":["SparqlTemplatesCtrl","$scope","$repositories","SparqlTemplatesRestService","toastr","ModalService","$licenseService","$translate","pluginName","setPluginIsActive","isPluginActive","pluginIsActive","getSparqlTemplates","isLicenseValid","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","success","data","sparqlTemplateIds","error","msg","getError","instant","$watch","deleteTemplate","templateID","openSimpleModal","title","message","warning","result","then","deleteSparqlTemplate","e","SparqlTemplateCreateCtrl","$location","$window","$timeout","RDF4JRepositoriesRestService","SparqlRestService","UriUtils","hash","search","getNamespaces","setLoader","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","prefix","value","namespace","namespaces","repositoryError","finally","loadTab","addKnownPrefixes","noPadding","paddingRight","paddingLeft","currentTabConfig","orientationViewMode","currentQuery","templateExist","newValue","oldValue","path","timer","goBack","history","back","locationChangeListener","$on","event","isPristine","confirm","window","removeEventListener","showBeforeunloadMessage","cancel","preventDefault","confirmExit","returnValue","addEventListener","defaultTabConfig","query","inference","sameAs","isNewTemplate","isRunning","progressMessage","extraMessage","yasrInnerContainer","angular","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","tabsData","tab","editor","setValue","queryType","resultsCount","offset","allResultsCount","page","pageSize","timeFinished","timeTook","sizeDelta","canWriteActiveRepo","options","readOnly","setQueryFromTabConfig","tabs","copy","setQuery","setDirty","JSON","stringify","getValue","isDefined","saveNewTemplate","createSparqlTemplate","saveTab","getSparqlTemplate","templateContent","saveTemplate","getQueryMode","validateQuery","isInvalidTemplateId","isValidIri","find","templateId","modalMsg","updateSparqlTemplate","$","on","module","controller","$inject","Notifications","showToastMessageWithDelay","Promise","r","setTimeout","factory"],"mappings":"+FAAA,+CAsBA,SAASA,EAAoBC,EAAQC,EAAeC,EAA4BC,EAAQC,EAAcC,EAAiBC,GAEnHN,EAAOO,WAAa,kBAEpBP,EAAOQ,kBAAoB,SAAUC,GACjCT,EAAOU,eAAiBD,GAG5BT,EAAOW,mBAAqB,WAGpBN,EAAgBO,kBAChBX,EAAcY,wBACNZ,EAAca,0BACVb,EAAcc,uBAC1Bb,EAA2BS,mBAAmBV,EAAcY,uBAAuBG,SAAQ,SAAUC,GACjGjB,EAAOk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AAiB,6BAA8B,SAAU,eAAgB,kBAAmB,cAoDrIpH,EAAyBoH,QAAU,CAAC,SAAU,YAAa,SAAU,gBAAiB,UAAW,WAAY,6BAA8B,+BAAgC,oBAAqB,WAAY,eAAgB,e,iBClE5N,SAASC,EAAcpJ,EAAQG,GAC3B,MAAO,CACHkJ,0BASJ,SAAmC5H,GAC/B,OAAO,IAAI6H,QAASC,IAChBvJ,EAAOa,QAAQV,EAAWgB,QAAQM,IAClC+H,WAAWD,EAAG,SApB1B5D,QACKsD,OAAO,wCAAyC,IAChDQ,QAAQ,gBAAiBL,GAE9BA,EAAcD,QAAU,CAAC,SAAU","file":"55.e8df33b84ca578a9a633.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/monitoring.rest.service';\nimport 'angular/utils/notifications';\nimport 'angular/utils/uri-utils';\nimport {decodeHTML} from \"../../../app\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.monitoring.service',\n 'toastr'\n];\n\nangular.module('graphdb.framework.sparql-template.controllers', modules, [\n 'graphdb.framework.utils.notifications'\n])\n .controller('SparqlTemplatesCtrl', SparqlTemplatesCtrl)\n .controller('SparqlTemplateCreateCtrl', SparqlTemplateCreateCtrl);\n\nSparqlTemplatesCtrl.$inject = ['$scope', '$repositories', 'SparqlTemplatesRestService', 'toastr', 'ModalService', '$licenseService', '$translate'];\n\nfunction SparqlTemplatesCtrl($scope, $repositories, SparqlTemplatesRestService, toastr, ModalService, $licenseService, $translate) {\n\n $scope.pluginName = 'sparql-template';\n\n $scope.setPluginIsActive = function (isPluginActive) {\n $scope.pluginIsActive = isPluginActive;\n }\n\n $scope.getSparqlTemplates = function () {\n // Only do this if there is an active repo that isn't an Ontop repo.\n // Ontop repos doesn't support update operations.\n if ($licenseService.isLicenseValid() &&\n $repositories.getActiveRepository()\n && !$repositories.isActiveRepoOntopType()\n && !$repositories.isActiveRepoFedXType()) {\n SparqlTemplatesRestService.getSparqlTemplates($repositories.getActiveRepository()).success(function (data) {\n $scope.sparqlTemplateIds = data;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.templates.error'));\n });\n } else {\n $scope.sparqlTemplateIds = [];\n }\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function () {\n $scope.getSparqlTemplates();\n });\n\n $scope.deleteTemplate = function (templateID) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.warning'),\n message: $translate.instant('sparql.template.delete.template.warning', {templateID: templateID}),\n warning: true\n }).result\n .then(function () {\n SparqlTemplatesRestService.deleteSparqlTemplate(templateID, $repositories.getActiveRepository())\n .success(function () {\n toastr.success(templateID, $translate.instant('sparql.template.delete.template.success'));\n $scope.getSparqlTemplates();\n }).error(function (e) {\n toastr.error(getError(e), $translate.instant('sparql.template.delete.template.failure', {templateID: templateID}));\n });\n });\n };\n}\n\nSparqlTemplateCreateCtrl.$inject = ['$scope', '$location', 'toastr', '$repositories', '$window', '$timeout', 'SparqlTemplatesRestService', 'RDF4JRepositoriesRestService', 'SparqlRestService', 'UriUtils', 'ModalService', '$translate'];\n\nfunction SparqlTemplateCreateCtrl($scope, $location, toastr, $repositories, $window, $timeout, SparqlTemplatesRestService, RDF4JRepositoriesRestService, SparqlRestService, UriUtils, ModalService, $translate) {\n\n const hash = $location.hash() || '';\n $scope.templateID = ($location.search().templateID || '') + (hash ? (`#${hash}`) : '');\n $scope.title = ($scope.templateID ? $translate.instant('edit') : $translate.instant('common.create.btn')) + ' SPARQL Template';\n $scope.getNamespaces = getNamespaces;\n $scope.setLoader = setLoader;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.noPadding = {paddingRight: 0, paddingLeft: 0};\n $scope.currentTabConfig = {};\n // This property is obligatory in order to show YASQUE and YASR properly\n $scope.orientationViewMode = true;\n $scope.currentQuery = {};\n let templateExist = false;\n\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n $location.path('/sparql-templates');\n }\n });\n\n let timer = null;\n $scope.goBack = function () {\n timer = $timeout(function () {\n $window.history.back();\n }, 1000);\n };\n\n const locationChangeListener = $scope.$on('$locationChangeStart', function (event) {\n confirmExit(event);\n });\n\n window.addEventListener('beforeunload', showBeforeunloadMessage);\n\n function showBeforeunloadMessage(event) {\n if (!$scope.currentQuery.isPristine) {\n event.returnValue = true;\n }\n }\n\n function confirmExit(event) {\n if (!$scope.currentQuery.isPristine) {\n if (!confirm($translate.instant('jdbc.warning.unsaved.changes'))) {\n event.preventDefault();\n } else {\n window.removeEventListener('beforeunload', showBeforeunloadMessage);\n locationChangeListener();\n $timeout.cancel(timer);\n }\n }\n }\n\n $scope.$on('$destroy', function (event) {\n window.removeEventListener('beforeunload', showBeforeunloadMessage);\n locationChangeListener();\n $timeout.cancel(timer);\n });\n\n const defaultTabConfig = {\n templateID: '',\n query: 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\n' +\n 'PREFIX ex: <http://example.com#>\\n' +\n 'DELETE {\\n' +\n ' ?subject ex:myPredicate ?oldValue .\\n' +\n '} INSERT {\\n' +\n ' ?subject ex:myPredicate ?newValue .\\n' +\n '} WHERE {\\n' +\n ' ?id rdf:type ex:MyType .\\n' +\n ' ?subject ex:isRelatedTo ?id .\\n' +\n '}\\n',\n inference: true,\n sameAs: true,\n isNewTemplate: true,\n isPristine: true\n };\n\n $scope.saveTab = function () {\n // Should have this empty function in this view\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n if ($scope.templateID) {\n getSparqlTemplate($scope.templateID);\n } else {\n setQueryFromTabConfig();\n }\n\n // FIXME: this is copy-pasted in graphs-config.controller.js and query-editor.controller.js. Find a way to avoid duplications\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n loadTab();\n });\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n const tab = $scope.currentQuery;\n\n if (!$scope.currentQuery.query) {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n if (!$scope.canWriteActiveRepo()) {\n window.editor.options.readOnly = true;\n }\n }\n\n function getSparqlTemplate(templateID) {\n SparqlTemplatesRestService.getSparqlTemplate(templateID, $repositories.getActiveRepository() ).success(function (templateContent) {\n defaultTabConfig.query = templateContent;\n defaultTabConfig.templateID = templateID;\n\n defaultTabConfig.isNewTemplate = !templateID;\n\n setQueryFromTabConfig();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.template.error', {templateID: $scope.currentQuery.templateID}));\n $scope.repositoryError = msg;\n });\n }\n\n function setQueryFromTabConfig() {\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n $scope.currentQuery = angular.copy(defaultTabConfig);\n\n if (window.editor) {\n $scope.setQuery($scope.currentQuery.query);\n loadTab();\n }\n\n $scope.$watch(function () {\n return $scope.currentQuery.query;\n }, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n $scope.setDirty();\n }\n });\n }\n\n $scope.saveTemplate = function () {\n if (!validateQuery()) {\n return;\n }\n\n if (!$scope.currentQuery.templateID) {\n toastr.error($translate.instant('sparql.template.iri.constraint'));\n return;\n } else {\n validateTemplateID();\n if ($scope.isInvalidTemplateId) {\n return;\n }\n }\n\n if ($scope.currentQuery.isNewTemplate) {\n checkIfTemplateExists()\n .then(() => {\n if (templateExist) {\n const modalMsg = decodeHTML($translate.instant('sparql.template.existing.template.error', {templateID: $scope.currentQuery.templateID}));\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.save'),\n message: modalMsg,\n warning: true\n }).result\n .then(function () {\n saveNewTemplate();\n });\n } else {\n saveNewTemplate();\n }\n });\n } else {\n if (!$scope.currentQuery.isPristine) {\n SparqlTemplatesRestService.updateSparqlTemplate($scope.currentQuery, $repositories.getActiveRepository()).success(function () {\n $scope.currentQuery.isPristine = true;\n $scope.currentQuery.isNewTemplate = false;\n toastr.success($scope.currentQuery.templateID, $translate.instant('update.sparql.template.success.msg'));\n $scope.goBack();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('save.sparql.template.failure.msg', {templateID: $scope.currentQuery.templateID}));\n });\n } else {\n // No changes to template query, go back to\n $scope.goBack();\n }\n }\n };\n\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n $scope.setDirty = function () {\n $scope.currentQuery.isPristine = false;\n };\n\n function hasValidQuery() {\n return window.editor && window.editor.getQueryMode() === 'update';\n }\n\n function validateQuery() {\n if (!hasValidQuery()) {\n toastr.error($translate.instant('sparql.template.query.constraint'), $translate.instant('jdbc.invalid.query'));\n return false;\n }\n\n return true;\n }\n\n function validateTemplateID() {\n $scope.isInvalidTemplateId = !UriUtils.isValidIri($scope.currentQuery.templateID);\n }\n\n function saveNewTemplate() {\n SparqlTemplatesRestService.createSparqlTemplate($scope.currentQuery, $repositories.getActiveRepository()).success(function () {\n $scope.currentQuery.isPristine = true;\n $scope.currentQuery.isNewTemplate = false;\n toastr.success($scope.currentQuery.templateID, $translate.instant('save.sparql.template.success.msg'));\n $scope.goBack();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('save.sparql.template.failure.msg', {templateID: $scope.currentQuery.templateID}));\n });\n }\n\n function checkIfTemplateExists() {\n return SparqlTemplatesRestService\n .getSparqlTemplates($repositories.getActiveRepository())\n .success(function (data) {\n templateExist = data.find((templateId) => templateId === $scope.currentQuery.templateID);\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('sparql.template.get.templates.error'));\n });\n }\n}\n","angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[56],{67:function(e,t,o){"use strict";o.r(t);o(18);function n(e,t,o,n,r,c,i,u,a,s){let l;function d(){l&&t.cancel(l)}e.pluginName="autocomplete",e.setPluginIsActive=function(t){e.pluginIsActive=t};const f=function(){u.checkAutocompleteStatus().success((function(t){e.autocompleteEnabled=t,a.setAutocompleteStatus(t)})).error((function(e){o.error(getError(e))}))},p=function(){u.refreshIndexIRIs().success((function(t){e.shouldIndexIRIs=t})).error((function(e){o.error(getError(e))}))},g=function(){u.refreshIndexStatus().success((function(t){e.indexStatus=t})).error((function(e){o.error(getError(e))}))},m=function(){u.refreshLabelConfig().success((function(t){e.labelConfig=t})).error((function(e){o.error(getError(e))}))};e.checkForPlugin=function(){e.pluginFound=!1,e.setLoader(!0),u.checkForPlugin().success((function(t){e.pluginFound=!0===t,e.pluginFound?(f(),p(),g(),m()):(e.autocompleteEnabled=!1,e.loading=!1)})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))};const b=function(){l=t((function(){e.$broadcast("checkIsActive"),e.autocompleteEnabled&&g()}),5e3)};e.$on("$destroy",(function(){d()}));e.setLoader=function(t,o){i.cancel(e.loaderTimeout),t?e.loaderTimeout=i((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.getLoaderMessage=function(){return e.loaderMessage||s.instant("common.loading")},e.toggleAutocomplete=function(){const t=!e.autocompleteEnabled;e.setLoader(!0,t?s.instant("autocomplete.enabling"):s.instant("autocomplete.disabling")),u.toggleAutocomplete(t).success((function(){f(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.toggleIndexIRIs=function(){e.setLoader(!0,s.instant("autocomplete.index.iri")),u.toggleIndexIRIs(!e.shouldIndexIRIs).success((function(){p(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.buildIndex=function(){e.setLoader(!0,s.instant("autocomplete.index.build")),u.buildIndex().success((function(){e.indexStatus="BUILDING"})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.interruptIndexing=function(){e.setLoader(!0,s.instant("index.interrupt")),u.interruptIndexing().success((function(){g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.getDegradedReason=function(){return n.getDegradedReason()},e.addLabel=function(){e.editLabel({labelIri:"",languages:""},!0)},e.editLabel=function(t,n){c.open({templateUrl:"js/angular/autocomplete/templates/modal/add-label.html",controller:"AddLabelCtrl",resolve:{data:function(){return{label:t,isNew:n}}}}).result.then((function(t){!function(t){e.setLoader(!0,s.instant("autocomplete.update")),u.addLabelConfig(t).success((function(){m(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)}))},e.removeLabel=function(t){!function(t){e.setLoader(!0,s.instant("autocomplete.update")),u.removeLabelConfig(t).success((function(){m(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)},e.$on("repositoryIsSet",(function(){d(),r.isLicenseValid()&&n.getActiveRepository()&&!n.isActiveRepoOntopType()&&!n.isActiveRepoFedXType()&&(e.checkForPlugin(),b())})),r.isLicenseValid()&&n.getActiveRepository()&&!n.isActiveRepoOntopType()&&!n.isActiveRepoFedXType()&&(e.checkForPlugin(),b())}function r(e,t,o,n){e.label=angular.copy(n.label),e.isNew=n.isNew,e.ok=function(){e.form.$valid&&t.close(e.label)},e.cancel=function(){t.dismiss("cancel")},e.setTemplate=function(t){e.label.labelIri=t,o((function(){$("#wb-autocomplete-languages").focus()}),0)}}angular.module("graphdb.framework.autocomplete.controllers",["toastr","graphdb.framework.rest.autocomplete.service"]).controller("AutocompleteCtrl",n).controller("AddLabelCtrl",r),n.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","AutocompleteRestService","$autocompleteStatus","$translate"],r.$inject=["$scope","$uibModalInstance","$timeout","data"]}}]);
2
- //# sourceMappingURL=56.62459de7af529d956b75.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[56],{68:function(e,t,o){"use strict";o.r(t);o(18);function n(e,t,o,n,r,c,i,u,a,s){let l;function d(){l&&t.cancel(l)}e.pluginName="autocomplete",e.setPluginIsActive=function(t){e.pluginIsActive=t};const f=function(){u.checkAutocompleteStatus().success((function(t){e.autocompleteEnabled=t,a.setAutocompleteStatus(t)})).error((function(e){o.error(getError(e))}))},p=function(){u.refreshIndexIRIs().success((function(t){e.shouldIndexIRIs=t})).error((function(e){o.error(getError(e))}))},g=function(){u.refreshIndexStatus().success((function(t){e.indexStatus=t})).error((function(e){o.error(getError(e))}))},m=function(){u.refreshLabelConfig().success((function(t){e.labelConfig=t})).error((function(e){o.error(getError(e))}))};e.checkForPlugin=function(){e.pluginFound=!1,e.setLoader(!0),u.checkForPlugin().success((function(t){e.pluginFound=!0===t,e.pluginFound?(f(),p(),g(),m()):(e.autocompleteEnabled=!1,e.loading=!1)})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))};const b=function(){l=t((function(){e.$broadcast("checkIsActive"),e.autocompleteEnabled&&g()}),5e3)};e.$on("$destroy",(function(){d()}));e.setLoader=function(t,o){i.cancel(e.loaderTimeout),t?e.loaderTimeout=i((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.getLoaderMessage=function(){return e.loaderMessage||s.instant("common.loading")},e.toggleAutocomplete=function(){const t=!e.autocompleteEnabled;e.setLoader(!0,t?s.instant("autocomplete.enabling"):s.instant("autocomplete.disabling")),u.toggleAutocomplete(t).success((function(){f(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.toggleIndexIRIs=function(){e.setLoader(!0,s.instant("autocomplete.index.iri")),u.toggleIndexIRIs(!e.shouldIndexIRIs).success((function(){p(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.buildIndex=function(){e.setLoader(!0,s.instant("autocomplete.index.build")),u.buildIndex().success((function(){e.indexStatus="BUILDING"})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.interruptIndexing=function(){e.setLoader(!0,s.instant("index.interrupt")),u.interruptIndexing().success((function(){g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.getDegradedReason=function(){return n.getDegradedReason()},e.addLabel=function(){e.editLabel({labelIri:"",languages:""},!0)},e.editLabel=function(t,n){c.open({templateUrl:"js/angular/autocomplete/templates/modal/add-label.html",controller:"AddLabelCtrl",resolve:{data:function(){return{label:t,isNew:n}}}}).result.then((function(t){!function(t){e.setLoader(!0,s.instant("autocomplete.update")),u.addLabelConfig(t).success((function(){m(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)}))},e.removeLabel=function(t){!function(t){e.setLoader(!0,s.instant("autocomplete.update")),u.removeLabelConfig(t).success((function(){m(),g()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)},e.$on("repositoryIsSet",(function(){d(),r.isLicenseValid()&&n.getActiveRepository()&&!n.isActiveRepoOntopType()&&!n.isActiveRepoFedXType()&&(e.checkForPlugin(),b())})),r.isLicenseValid()&&n.getActiveRepository()&&!n.isActiveRepoOntopType()&&!n.isActiveRepoFedXType()&&(e.checkForPlugin(),b())}function r(e,t,o,n){e.label=angular.copy(n.label),e.isNew=n.isNew,e.ok=function(){e.form.$valid&&t.close(e.label)},e.cancel=function(){t.dismiss("cancel")},e.setTemplate=function(t){e.label.labelIri=t,o((function(){$("#wb-autocomplete-languages").focus()}),0)}}angular.module("graphdb.framework.autocomplete.controllers",["toastr","graphdb.framework.rest.autocomplete.service"]).controller("AutocompleteCtrl",n).controller("AddLabelCtrl",r),n.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","AutocompleteRestService","$autocompleteStatus","$translate"],r.$inject=["$scope","$uibModalInstance","$timeout","data"]}}]);
2
+ //# sourceMappingURL=56.d765faad673f618d41b0.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/autocomplete/controllers.js"],"names":["AutocompleteCtrl","$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","AutocompleteRestService","$autocompleteStatus","$translate","timer","cancelTimer","cancel","pluginName","setPluginIsActive","isPluginActive","pluginIsActive","refreshEnabledStatus","checkAutocompleteStatus","success","data","autocompleteEnabled","setAutocompleteStatus","error","getError","refreshIndexIRIs","shouldIndexIRIs","refreshIndexStatus","indexStatus","refreshLabelConfig","labelConfig","checkForPlugin","pluginFound","setLoader","loading","finally","pullStatus","$broadcast","$on","loader","message","loaderTimeout","loaderMessage","getLoaderMessage","instant","toggleAutocomplete","newValue","toggleIndexIRIs","buildIndex","interruptIndexing","getDegradedReason","addLabel","editLabel","labelIri","languages","label","isNew","open","templateUrl","controller","resolve","result","then","addLabelConfig","removeLabel","removeLabelConfig","isLicenseValid","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","AddLabelCtrl","$uibModalInstance","angular","copy","ok","form","$valid","close","dismiss","setTemplate","iri","$","focus","module","$inject"],"mappings":"0FAAA,aAcA,SAASA,EAAiBC,EAAQC,EAAWC,EAAQC,EAAeC,EAAiBC,EAAWC,EAAUC,EAAyBC,EAAqBC,GAEpJ,IAAIC,EAEJ,SAASC,IACDD,GACAT,EAAUW,OAAOF,GAIzBV,EAAOa,WAAa,eAEpBb,EAAOc,kBAAoB,SAAUC,GACjCf,EAAOgB,eAAiBD,GAG5B,MAAME,EAAuB,WACzBV,EAAwBW,0BACnBC,SAAQ,SAAUC,GACfpB,EAAOqB,oBAAsBD,EAC7BZ,EAAoBc,sBAAsBF,MAC3CG,OAAM,SAAUH,GACnBlB,EAAOqB,MAAMC,SAASJ,QAIxBK,E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plete.rest.service';\n\nconst modules = [\n 'toastr',\n 'graphdb.framework.rest.autocomplete.service'\n];\n\nangular\n .module('graphdb.framework.autocomplete.controllers', modules)\n .controller('AutocompleteCtrl', AutocompleteCtrl)\n .controller('AddLabelCtrl', AddLabelCtrl);\n\nAutocompleteCtrl.$inject = ['$scope', '$interval', 'toastr', '$repositories', '$licenseService', '$uibModal', '$timeout', 'AutocompleteRestService', '$autocompleteStatus', '$translate'];\n\nfunction AutocompleteCtrl($scope, $interval, toastr, $repositories, $licenseService, $uibModal, $timeout, AutocompleteRestService, $autocompleteStatus, $translate) {\n\n let timer;\n\n function cancelTimer() {\n if (timer) {\n $interval.cancel(timer);\n }\n }\n\n $scope.pluginName = 'autocomplete';\n\n $scope.setPluginIsActive = function (isPluginActive) {\n $scope.pluginIsActive = isPluginActive;\n };\n\n const refreshEnabledStatus = function () {\n AutocompleteRestService.checkAutocompleteStatus()\n .success(function (data) {\n $scope.autocompleteEnabled = data;\n $autocompleteStatus.setAutocompleteStatus(data);\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexIRIs = function () {\n AutocompleteRestService.refreshIndexIRIs()\n .success(function (data) {\n $scope.shouldIndexIRIs = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexStatus = function () {\n AutocompleteRestService.refreshIndexStatus()\n .success(function (data) {\n $scope.indexStatus = data;\n })\n .error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshLabelConfig = function () {\n AutocompleteRestService.refreshLabelConfig()\n .success(function (data) {\n $scope.labelConfig = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const addLabelConfig = function (label) {\n $scope.setLoader(true, $translate.instant('autocomplete.update'));\n\n\n AutocompleteRestService.addLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const removeLabelConfig = function (label) {\n $scope.setLoader(true, $translate.instant('autocomplete.update'));\n\n AutocompleteRestService.removeLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.checkForPlugin = function () {\n $scope.pluginFound = false;\n\n $scope.setLoader(true);\n\n AutocompleteRestService.checkForPlugin()\n .success(function (data) {\n $scope.pluginFound = data === true;\n if ($scope.pluginFound) {\n refreshEnabledStatus();\n refreshIndexIRIs();\n refreshIndexStatus();\n refreshLabelConfig();\n } else {\n $scope.autocompleteEnabled = false;\n $scope.loading = false;\n }\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const pullStatus = function () {\n timer = $interval(function () {\n $scope.$broadcast('checkIsActive');\n if ($scope.autocompleteEnabled) {\n refreshIndexStatus();\n }\n }, 5000);\n };\n\n $scope.$on(\"$destroy\", function () {\n cancelTimer();\n });\n\n const init = function() {\n if (!$licenseService.isLicenseValid() ||\n !$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || $translate.instant('common.loading');\n };\n\n $scope.toggleAutocomplete = function () {\n const newValue = !$scope.autocompleteEnabled;\n $scope.setLoader(true, newValue ? $translate.instant('autocomplete.enabling') : $translate.instant('autocomplete.disabling'));\n\n AutocompleteRestService.toggleAutocomplete(newValue)\n .success(function () {\n refreshEnabledStatus();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.toggleIndexIRIs = function () {\n $scope.setLoader(true, ($translate.instant('autocomplete.index.iri')));\n\n AutocompleteRestService.toggleIndexIRIs(!$scope.shouldIndexIRIs)\n .success(function () {\n refreshIndexIRIs();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.buildIndex = function () {\n $scope.setLoader(true, $translate.instant('autocomplete.index.build'));\n\n AutocompleteRestService.buildIndex()\n .success(function () {\n $scope.indexStatus = 'BUILDING';\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.interruptIndexing = function () {\n $scope.setLoader(true, $translate.instant('index.interrupt'));\n\n AutocompleteRestService.interruptIndexing()\n .success(function () {\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.getDegradedReason = function () {\n return $repositories.getDegradedReason();\n };\n\n $scope.addLabel = function () {\n $scope.editLabel({labelIri: '', languages: ''}, true);\n };\n\n $scope.editLabel = function (label, isNew) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/autocomplete/templates/modal/add-label.html',\n controller: 'AddLabelCtrl',\n resolve: {\n data: function () {\n return {\n label: label,\n isNew: isNew\n };\n }\n }\n });\n\n modalInstance.result.then(function (label) {\n addLabelConfig(label);\n });\n };\n\n $scope.removeLabel = function (label) {\n removeLabelConfig(label);\n };\n\n $scope.$on('repositoryIsSet', function () {\n cancelTimer();\n if (!$licenseService.isLicenseValid() ||\n !$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n });\n\n init();\n}\n\nAddLabelCtrl.$inject = ['$scope', '$uibModalInstance', '$timeout', 'data'];\n\nfunction AddLabelCtrl($scope, $uibModalInstance, $timeout, data) {\n $scope.label = angular.copy(data.label);\n $scope.isNew = data.isNew;\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n $uibModalInstance.close($scope.label);\n }\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n\n $scope.setTemplate = function (iri) {\n $scope.label.labelIri = iri;\n $timeout(function () {\n $('#wb-autocomplete-languages').focus();\n }, 0);\n };\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/autocomplete/controllers.js"],"names":["AutocompleteCtrl","$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","AutocompleteRestService","$autocompleteStatus","$translate","timer","cancelTimer","cancel","pluginName","setPluginIsActive","isPluginActive","pluginIsActive","refreshEnabledStatus","checkAutocompleteStatus","success","data","autocompleteEnabled","setAutocompleteStatus","error","getError","refreshIndexIRIs","shouldIndexIRIs","refreshIndexStatus","indexStatus","refreshLabelConfig","labelConfig","checkForPlugin","pluginFound","setLoader","loading","finally","pullStatus","$broadcast","$on","loader","message","loaderTimeout","loaderMessage","getLoaderMessage","instant","toggleAutocomplete","newValue","toggleIndexIRIs","buildIndex","interruptIndexing","getDegradedReason","addLabel","editLabel","labelIri","languages","label","isNew","open","templateUrl","controller","resolve","result","then","addLabelConfig","removeLabel","removeLabelConfig","isLicenseValid","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","AddLabelCtrl","$uibModalInstance","angular","copy","ok","form","$valid","close","dismiss","setTemplate","iri","$","focus","module","$inject"],"mappings":"0FAAA,aAcA,SAASA,EAAiBC,EAAQC,EAAWC,EAAQC,EAAeC,EAAiBC,EAAWC,EAAUC,EAAyBC,EAAqBC,GAEpJ,IAAIC,EAEJ,SAASC,IACDD,GACAT,EAAUW,OAAOF,GAIzBV,EAAOa,WAAa,eAEpBb,EAAOc,kBAAoB,SAAUC,GACjCf,EAAOgB,eAAiBD,GAG5B,MAAME,EAAuB,WACzBV,EAAwBW,0BACnBC,SAAQ,SAAUC,GACfpB,EAAOqB,oBAAsBD,EAC7BZ,EAAoBc,s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SAAU,oBAAqB,WAAY","file":"56.d765faad673f618d41b0.bundle.js","sourcesContent":["import 'angular/rest/autocomplete.rest.service';\n\nconst modules = [\n 'toastr',\n 'graphdb.framework.rest.autocomplete.service'\n];\n\nangular\n .module('graphdb.framework.autocomplete.controllers', modules)\n .controller('AutocompleteCtrl', AutocompleteCtrl)\n .controller('AddLabelCtrl', AddLabelCtrl);\n\nAutocompleteCtrl.$inject = ['$scope', '$interval', 'toastr', '$repositories', '$licenseService', '$uibModal', '$timeout', 'AutocompleteRestService', '$autocompleteStatus', '$translate'];\n\nfunction AutocompleteCtrl($scope, $interval, toastr, $repositories, $licenseService, $uibModal, $timeout, AutocompleteRestService, $autocompleteStatus, $translate) {\n\n let timer;\n\n function cancelTimer() {\n if (timer) {\n $interval.cancel(timer);\n }\n }\n\n $scope.pluginName = 'autocomplete';\n\n $scope.setPluginIsActive = function (isPluginActive) {\n $scope.pluginIsActive = isPluginActive;\n };\n\n const refreshEnabledStatus = function () {\n AutocompleteRestService.checkAutocompleteStatus()\n .success(function (data) {\n $scope.autocompleteEnabled = data;\n $autocompleteStatus.setAutocompleteStatus(data);\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexIRIs = function () {\n AutocompleteRestService.refreshIndexIRIs()\n .success(function (data) {\n $scope.shouldIndexIRIs = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexStatus = function () {\n AutocompleteRestService.refreshIndexStatus()\n .success(function (data) {\n $scope.indexStatus = data;\n })\n .error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshLabelConfig = function () {\n AutocompleteRestService.refreshLabelConfig()\n .success(function (data) {\n $scope.labelConfig = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const addLabelConfig = function (label) {\n $scope.setLoader(true, $translate.instant('autocomplete.update'));\n\n\n AutocompleteRestService.addLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const removeLabelConfig = function (label) {\n $scope.setLoader(true, $translate.instant('autocomplete.update'));\n\n AutocompleteRestService.removeLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.checkForPlugin = function () {\n $scope.pluginFound = false;\n\n $scope.setLoader(true);\n\n AutocompleteRestService.checkForPlugin()\n .success(function (data) {\n $scope.pluginFound = data === true;\n if ($scope.pluginFound) {\n refreshEnabledStatus();\n refreshIndexIRIs();\n refreshIndexStatus();\n refreshLabelConfig();\n } else {\n $scope.autocompleteEnabled = false;\n $scope.loading = false;\n }\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const pullStatus = function () {\n timer = $interval(function () {\n $scope.$broadcast('checkIsActive');\n if ($scope.autocompleteEnabled) {\n refreshIndexStatus();\n }\n }, 5000);\n };\n\n $scope.$on(\"$destroy\", function () {\n cancelTimer();\n });\n\n const init = function() {\n if (!$licenseService.isLicenseValid() ||\n !$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || $translate.instant('common.loading');\n };\n\n $scope.toggleAutocomplete = function () {\n const newValue = !$scope.autocompleteEnabled;\n $scope.setLoader(true, newValue ? $translate.instant('autocomplete.enabling') : $translate.instant('autocomplete.disabling'));\n\n AutocompleteRestService.toggleAutocomplete(newValue)\n .success(function () {\n refreshEnabledStatus();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.toggleIndexIRIs = function () {\n $scope.setLoader(true, ($translate.instant('autocomplete.index.iri')));\n\n AutocompleteRestService.toggleIndexIRIs(!$scope.shouldIndexIRIs)\n .success(function () {\n refreshIndexIRIs();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.buildIndex = function () {\n $scope.setLoader(true, $translate.instant('autocomplete.index.build'));\n\n AutocompleteRestService.buildIndex()\n .success(function () {\n $scope.indexStatus = 'BUILDING';\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.interruptIndexing = function () {\n $scope.setLoader(true, $translate.instant('index.interrupt'));\n\n AutocompleteRestService.interruptIndexing()\n .success(function () {\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.getDegradedReason = function () {\n return $repositories.getDegradedReason();\n };\n\n $scope.addLabel = function () {\n $scope.editLabel({labelIri: '', languages: ''}, true);\n };\n\n $scope.editLabel = function (label, isNew) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/autocomplete/templates/modal/add-label.html',\n controller: 'AddLabelCtrl',\n resolve: {\n data: function () {\n return {\n label: label,\n isNew: isNew\n };\n }\n }\n });\n\n modalInstance.result.then(function (label) {\n addLabelConfig(label);\n });\n };\n\n $scope.removeLabel = function (label) {\n removeLabelConfig(label);\n };\n\n $scope.$on('repositoryIsSet', function () {\n cancelTimer();\n if (!$licenseService.isLicenseValid() ||\n !$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n });\n\n init();\n}\n\nAddLabelCtrl.$inject = ['$scope', '$uibModalInstance', '$timeout', 'data'];\n\nfunction AddLabelCtrl($scope, $uibModalInstance, $timeout, data) {\n $scope.label = angular.copy(data.label);\n $scope.isNew = data.isNew;\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n $uibModalInstance.close($scope.label);\n }\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n\n $scope.setTemplate = function (iri) {\n $scope.label.labelIri = iri;\n $timeout(function () {\n $('#wb-autocomplete-languages').focus();\n }, 0);\n };\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[60],{69:function(e,t){function i(e){return{restrict:"A",scope:{min:"=",max:"="},link:function(t,i,n){const o={debounce:_.debounce,delay:100,loadDelay:10,compressor:1,min:n.fitTextMin||"inherit",max:n.fitTextMax||"inherit",calcSize:10,lines:1},a=i.parent(),c=i[0],l=c.style,f=window.getComputedStyle(i[0],null),r=i.children().length||o.lines,s="inherit"===o.min?f["font-size"]:o.min,d="inherit"===o.max?f["font-size"]:o.max,p=f["line-height"],u=f.display;let h;function m(){const e=o.calcSize*r/c.offsetWidth/r;return Math.max(Math.min(function(e){const t=parseFloat(getComputedStyle(a[0]).paddingLeft),i=parseFloat(getComputedStyle(a[0]).paddingRight);return(a[0].offsetWidth-(t+i))*e*o.compressor}(e),parseFloat(d)),parseFloat(s))}function w(){h&&e.cancel(h),h=e((function(){c.offsetHeight*c.offsetWidth!=0&&(l.fontSize=o.calcSize+"px",l.lineHeight="1",l.display="inline-block",l.fontSize=m()+"px",l.lineHeight=p,l.display=u)}),o.loadDelay)}t.$watch((function(){return[a[0].offsetWidth,i[0].offsetWidth].join("_")}),(function(){w()})),$(window).on("resize",o.debounce((function(){t.$apply(w)}),o.delay)),t.$on("$destroy",(function(){h&&e.cancel(h),$(window).off("resize")}))}}}angular.module("graphdb.framework.core.directives.fittext",[]).directive("fitText",i),i.$inject=["$timeout"]}}]);
2
- //# sourceMappingURL=60.2cb24e628b92cb3e0210.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[60],{70:function(e,t){function i(e){return{restrict:"A",scope:{min:"=",max:"="},link:function(t,i,n){const o={debounce:_.debounce,delay:100,loadDelay:10,compressor:1,min:n.fitTextMin||"inherit",max:n.fitTextMax||"inherit",calcSize:10,lines:1},a=i.parent(),c=i[0],l=c.style,f=window.getComputedStyle(i[0],null),r=i.children().length||o.lines,s="inherit"===o.min?f["font-size"]:o.min,d="inherit"===o.max?f["font-size"]:o.max,p=f["line-height"],u=f.display;let h;function m(){const e=o.calcSize*r/c.offsetWidth/r;return Math.max(Math.min(function(e){const t=parseFloat(getComputedStyle(a[0]).paddingLeft),i=parseFloat(getComputedStyle(a[0]).paddingRight);return(a[0].offsetWidth-(t+i))*e*o.compressor}(e),parseFloat(d)),parseFloat(s))}function w(){h&&e.cancel(h),h=e((function(){c.offsetHeight*c.offsetWidth!=0&&(l.fontSize=o.calcSize+"px",l.lineHeight="1",l.display="inline-block",l.fontSize=m()+"px",l.lineHeight=p,l.display=u)}),o.loadDelay)}t.$watch((function(){return[a[0].offsetWidth,i[0].offsetWidth].join("_")}),(function(){w()})),$(window).on("resize",o.debounce((function(){t.$apply(w)}),o.delay)),t.$on("$destroy",(function(){h&&e.cancel(h),$(window).off("resize")}))}}}angular.module("graphdb.framework.core.directives.fittext",[]).directive("fitText",i),i.$inject=["$timeout"]}}]);
2
+ //# sourceMappingURL=60.f13766507ec5f29fde78.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/core/directives/fit-text.directive.js"],"names":["fitTextDirective","$timeout","restrict","scope","min","max","link","element","attrs","config","_","debounce","fitTextMin","fitTextMax","parent","domElem","domElemStyle","style","computed","window","getComputedStyle","newlines","children","length","lines","minFontSize","maxFontSize","lineHeight","display","resizePromise","calculate","ratio","calcSize","offsetWidth","Math","paddingLeft","parseFloat","paddingRight","compressor","getMaxFontSize","resizer","cancel","offsetHeight","fontSize","loadDelay","$watch","join","$","on","$apply","delay","$on","off","angular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KAUpBnB,EAAOmC,WAGdzC,EAAM0C,QAAO,WACT,MAAO,CACH/B,EAAO,GAAGmB,YACV1B,EAAQ,GAAG0B,aACba,KAAK,QACR,WACCN,OAGJO,EAAE5B,QAAQ6B,GAAG,SAAUvC,EAAOE,UAAS,WACnCR,EAAM8C,OAAOT,KACd/B,EAAOyC,QAEV/C,EAAMgD,IAAI,YAAY,WACdtB,GACA5B,EAASwC,OAAOZ,GAEpBkB,EAAE5B,QAAQiC,IAAI,eA5F9BC,QACKC,OAAO,4CAA6C,IACpDC,UAAU,UAAWvD,GAE1BA,EAAiBwD,QAAU,CAAC","file":"60.2cb24e628b92cb3e0210.bundle.js","sourcesContent":["// This is a rework of the ng-FitText.js which can be found here https://github.com/patrickmarabeas/ng-FitText.js\nangular\n .module('graphdb.framework.core.directives.fittext', [])\n .directive('fitText', fitTextDirective);\n\nfitTextDirective.$inject = ['$timeout'];\n\nfunction fitTextDirective($timeout) {\n return {\n restrict: 'A',\n scope: {\n min: '=',\n max: '='\n },\n link: function (scope, element, attrs) {\n\n const config = {\n 'debounce': _.debounce,\n 'delay': 100,\n 'loadDelay': 10,\n 'compressor': 1,\n 'min': attrs.fitTextMin || 'inherit',\n 'max': attrs.fitTextMax || 'inherit',\n 'calcSize': 10,\n 'lines': 1\n };\n\n const parent = element.parent();\n const domElem = element[0];\n const domElemStyle = domElem.style;\n const computed = window.getComputedStyle(element[0], null);\n const newlines = element.children().length || config.lines;\n const minFontSize = config.min === 'inherit' ? computed['font-size'] : config.min;\n const maxFontSize = config.max === 'inherit' ? computed['font-size'] : config.max;\n const lineHeight = computed['line-height'];\n const display = computed['display'];\n let resizePromise;\n\n function calculate() {\n const ratio = (config.calcSize * newlines) / domElem.offsetWidth / newlines;\n return Math.max(Math.min(getMaxFontSize(ratio), parseFloat(maxFontSize)), parseFloat(minFontSize));\n }\n\n function getMaxFontSize(ratio) {\n const paddingLeft = parseFloat(getComputedStyle(parent[0]).paddingLeft);\n const paddingRight = parseFloat(getComputedStyle(parent[0]).paddingRight);\n\n return (parent[0].offsetWidth - (paddingLeft + paddingRight)) * ratio * config.compressor;\n }\n\n function resize() {\n if (domElem.offsetHeight * domElem.offsetWidth === 0) {\n return;\n }\n\n // Preset standard values for making the size calculation\n domElemStyle.fontSize = config.calcSize + 'px';\n domElemStyle.lineHeight = '1';\n domElemStyle.display = 'inline-block';\n\n // Set usage values\n domElemStyle.fontSize = calculate() + 'px';\n domElemStyle.lineHeight = lineHeight;\n domElemStyle.display = display;\n }\n\n function resizer() {\n if (resizePromise) {\n $timeout.cancel(resizePromise);\n }\n\n resizePromise = $timeout(function () {\n resize();\n }, config.loadDelay);\n }\n\n scope.$watch(function () {\n return [\n parent[0].offsetWidth,\n element[0].offsetWidth\n ].join('_');\n }, function () {\n resizer();\n });\n\n $(window).on('resize', config.debounce(function () {\n scope.$apply(resizer)\n }, config.delay));\n\n scope.$on('$destroy', function () {\n if (resizePromise) {\n $timeout.cancel(resizePromise);\n }\n $(window).off('resize');\n });\n }\n };\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/core/directives/fit-text.directive.js"],"names":["fitTextDirective","$timeout","restrict","scope","min","max","link","element","attrs","config","_","debounce","fitTextMin","fitTextMax","parent","domElem","domElemStyle","style","computed","window","getComputedStyle","newlines","children","length","lines","minFontSize","maxFontSize","lineHeight","display","resizePromise","calculate","ratio","calcSize","offsetWidth","Math","paddingLeft","parseFloat","paddingRight","compressor","getMaxFontSize","resizer","cancel","offsetHeight","fontSize","loadDelay","$watch","join","$","on","$apply","delay","$on","off","angular","module","directive","$inject"],"mappings":"2EAOA,SAASA,EAAiBC,GACtB,MAAO,CACHC,SAAU,IACVC,MAAO,CACHC,IAAK,IACLC,IAAK,KAETC,KAAM,SAAUH,EAAOI,EAASC,GAE5B,MAAMC,EAAS,CACX,SAAYC,EAAEC,SACd,MAAS,IACT,UAAa,GACb,WAAc,EACd,IAAOH,EAAMI,YAAc,UAC3B,IAAOJ,EAAMK,Y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wC,OAAOZ,GAEpBkB,EAAE5B,QAAQiC,IAAI,eA5F9BC,QACKC,OAAO,4CAA6C,IACpDC,UAAU,UAAWvD,GAE1BA,EAAiBwD,QAAU,CAAC","file":"60.f13766507ec5f29fde78.bundle.js","sourcesContent":["// This is a rework of the ng-FitText.js which can be found here https://github.com/patrickmarabeas/ng-FitText.js\nangular\n .module('graphdb.framework.core.directives.fittext', [])\n .directive('fitText', fitTextDirective);\n\nfitTextDirective.$inject = ['$timeout'];\n\nfunction fitTextDirective($timeout) {\n return {\n restrict: 'A',\n scope: {\n min: '=',\n max: '='\n },\n link: function (scope, element, attrs) {\n\n const config = {\n 'debounce': _.debounce,\n 'delay': 100,\n 'loadDelay': 10,\n 'compressor': 1,\n 'min': attrs.fitTextMin || 'inherit',\n 'max': attrs.fitTextMax || 'inherit',\n 'calcSize': 10,\n 'lines': 1\n };\n\n const parent = element.parent();\n const domElem = element[0];\n const domElemStyle = domElem.style;\n const computed = window.getComputedStyle(element[0], null);\n const newlines = element.children().length || config.lines;\n const minFontSize = config.min === 'inherit' ? computed['font-size'] : config.min;\n const maxFontSize = config.max === 'inherit' ? computed['font-size'] : config.max;\n const lineHeight = computed['line-height'];\n const display = computed['display'];\n let resizePromise;\n\n function calculate() {\n const ratio = (config.calcSize * newlines) / domElem.offsetWidth / newlines;\n return Math.max(Math.min(getMaxFontSize(ratio), parseFloat(maxFontSize)), parseFloat(minFontSize));\n }\n\n function getMaxFontSize(ratio) {\n const paddingLeft = parseFloat(getComputedStyle(parent[0]).paddingLeft);\n const paddingRight = parseFloat(getComputedStyle(parent[0]).paddingRight);\n\n return (parent[0].offsetWidth - (paddingLeft + paddingRight)) * ratio * config.compressor;\n }\n\n function resize() {\n if (domElem.offsetHeight * domElem.offsetWidth === 0) {\n return;\n }\n\n // Preset standard values for making the size calculation\n domElemStyle.fontSize = config.calcSize + 'px';\n domElemStyle.lineHeight = '1';\n domElemStyle.display = 'inline-block';\n\n // Set usage values\n domElemStyle.fontSize = calculate() + 'px';\n domElemStyle.lineHeight = lineHeight;\n domElemStyle.display = display;\n }\n\n function resizer() {\n if (resizePromise) {\n $timeout.cancel(resizePromise);\n }\n\n resizePromise = $timeout(function () {\n resize();\n }, config.loadDelay);\n }\n\n scope.$watch(function () {\n return [\n parent[0].offsetWidth,\n element[0].offsetWidth\n ].join('_');\n }, function () {\n resizer();\n });\n\n $(window).on('resize', config.debounce(function () {\n scope.$apply(resizer)\n }, config.delay));\n\n scope.$on('$destroy', function () {\n if (resizePromise) {\n $timeout.cancel(resizePromise);\n }\n $(window).off('resize');\n });\n }\n };\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[65],{71:function(r,i,e){"use strict";e.r(i);e(14);angular.module("graphdb.framework.explore.directives",["graphdb.framework.utils.uriutils"]).directive("uri",["UriUtils",function(r){return{require:"ngModel",link:function(i,e,t,n){n.$parsers.unshift((function(i){if(!angular.isUndefined(i)&&i.length>0){const e=r.validateRdfUri(i);return n.$setValidity("searchStr",e),e?i:void 0}return n.$setValidity("searchStr",!0),i})),n.$formatters.unshift((function(i){return angular.isUndefined(i)||n.$setValidity("searchStr",r.validateRdfUri),i}))}}}])}}]);
2
- //# sourceMappingURL=65.6c12c48ac0d6f57a5079.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[65],{72:function(r,i,e){"use strict";e.r(i);e(14);angular.module("graphdb.framework.explore.directives",["graphdb.framework.utils.uriutils"]).directive("uri",["UriUtils",function(r){return{require:"ngModel",link:function(i,e,t,n){n.$parsers.unshift((function(i){if(!angular.isUndefined(i)&&i.length>0){const e=r.validateRdfUri(i);return n.$setValidity("searchStr",e),e?i:void 0}return n.$setValidity("searchStr",!0),i})),n.$formatters.unshift((function(i){return angular.isUndefined(i)||n.$setValidity("searchStr",r.validateRdfUri),i}))}}}])}}]);
2
+ //# sourceMappingURL=65.aa9736b7aad2582ca7ea.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/explore/directives.js"],"names":["angular","module","directive","UriUtils","require","link","scope","elem","attr","ngModel","$parsers","unshift","value","isUndefined","length","isValidUri","validateRdfUri","$setValidity","undefined","$formatters"],"mappings":"0FAAA,aAE0BA,QAAQC,OAAO,uCAAwC,CAC7E,qCAGcC,UAAU,MAAO,CAAC,WAAY,SAAUC,GACtD,MAAO,CACHC,QAAS,UACTC,KAAM,SAAUC,EAAOC,EAAMC,EAAMC,GAG/BA,EAAQC,SAASC,SAAQ,SAAUC,GAC/B,IAAKZ,QAAQa,YAAYD,IAAUA,EAAME,OAAS,EAAG,CACjD,MAAMC,EAAaZ,EAASa,eAAeJ,GAE3C,OADAH,EAAQQ,aAAa,YAAaF,GAC3BA,EAAaH,OAAQM,EAG5B,OADAT,EAAQQ,aAAa,aAAa,GAC3BL,KAKfH,EAAQU,YAAYR,SAAQ,SAAUC,GAIlC,OAHKZ,QAAQa,YAAYD,IACrBH,EAAQQ,aAAa,YAAad,EAASa,gBAExCJ","file":"65.6c12c48ac0d6f57a5079.bundle.js","sourcesContent":["import 'angular/utils/uri-utils';\n\nconst exploreDirectives = angular.module('graphdb.framework.explore.directives', [\n 'graphdb.framework.utils.uriutils'\n]);\n\nexploreDirectives.directive('uri', ['UriUtils', function (UriUtils) {\n return {\n require: 'ngModel',\n link: function (scope, elem, attr, ngModel) {\n\n //For DOM -> model validation\n ngModel.$parsers.unshift(function (value) {\n if (!angular.isUndefined(value) && value.length > 0) {\n const isValidUri = UriUtils.validateRdfUri(value);\n ngModel.$setValidity('searchStr', isValidUri);\n return isValidUri ? value : undefined;\n } else {\n ngModel.$setValidity('searchStr', true);\n return value;\n }\n });\n\n //For model -> DOM validation\n ngModel.$formatters.unshift(function (value) {\n if (!angular.isUndefined(value)) {\n ngModel.$setValidity('searchStr', UriUtils.validateRdfUri);\n }\n return value;\n });\n }\n };\n}]);\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/explore/directives.js"],"names":["angular","module","directive","UriUtils","require","link","scope","elem","attr","ngModel","$parsers","unshift","value","isUndefined","length","isValidUri","validateRdfUri","$setValidity","undefined","$formatters"],"mappings":"0FAAA,aAE0BA,QAAQC,OAAO,uCAAwC,CAC7E,qCAGcC,UAAU,MAAO,CAAC,WAAY,SAAUC,GACtD,MAAO,CACHC,QAAS,UACTC,KAAM,SAAUC,EAAOC,EAAMC,EAAMC,GAG/BA,EAAQC,SAASC,SAAQ,SAAUC,GAC/B,IAAKZ,QAAQa,YAAYD,IAAUA,EAAME,OAAS,EAAG,CACjD,MAAMC,EAAaZ,EAASa,eAAeJ,GAE3C,OADAH,EAAQQ,aAAa,YAAaF,GAC3BA,EAAaH,OAAQM,EAG5B,OADAT,EAAQQ,aAAa,aAAa,GAC3BL,KAKfH,EAAQU,YAAYR,SAAQ,SAAUC,GAIlC,OAHKZ,QAAQa,YAAYD,IACrBH,EAAQQ,aAAa,YAAad,EAASa,gBAExCJ","file":"65.aa9736b7aad2582ca7ea.bundle.js","sourcesContent":["import 'angular/utils/uri-utils';\n\nconst exploreDirectives = angular.module('graphdb.framework.explore.directives', [\n 'graphdb.framework.utils.uriutils'\n]);\n\nexploreDirectives.directive('uri', ['UriUtils', function (UriUtils) {\n return {\n require: 'ngModel',\n link: function (scope, elem, attr, ngModel) {\n\n //For DOM -> model validation\n ngModel.$parsers.unshift(function (value) {\n if (!angular.isUndefined(value) && value.length > 0) {\n const isValidUri = UriUtils.validateRdfUri(value);\n ngModel.$setValidity('searchStr', isValidUri);\n return isValidUri ? value : undefined;\n } else {\n ngModel.$setValidity('searchStr', true);\n return value;\n }\n });\n\n //For model -> DOM validation\n ngModel.$formatters.unshift(function (value) {\n if (!angular.isUndefined(value)) {\n ngModel.$setValidity('searchStr', UriUtils.validateRdfUri);\n }\n return value;\n });\n }\n };\n}]);\n"],"sourceRoot":""}