diff --git a/.gitignore b/.gitignore index 901ff385c..16bbd009b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ log/ #test/ src/virtualhosts/log src/virtualhosts/output +node_modules +src/virtualhosts/www/javascript/bundle.js diff --git a/package.json b/package.json new file mode 100644 index 000000000..5fa315f20 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "snac", + "version": "1.0.0", + "description": "SNAC Cooperative Frontend JavaScripts", + "main": "main.js", + "repository": "blank", + "author": "Derik Ramirez ", + "license": "Private", + "private": true, + "dependencies": { + "babel-core": "^6.26.3", + "babel-loader": "7", + "webpack": "^4.43.0" + }, + "scripts": { + "build-dev": "webpack", + "build-prod": "webpack -p --env production" + }, + "devDependencies": { + "webpack-cli": "^3.3.11" + } +} diff --git a/src/virtualhosts/www/javascript/bundle.js.map b/src/virtualhosts/www/javascript/bundle.js.map new file mode 100644 index 000000000..e762ac23a --- /dev/null +++ b/src/virtualhosts/www/javascript/bundle.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/virtualhosts/www/javascript/src/resource_admin.js","webpack:///./src/virtualhosts/www/javascript/src/select_loaders.js","webpack:///./src/virtualhosts/www/javascript/src/main.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","saveResource","event","preventDefault","$form","$","target","find","val","confirm","slideDown","html","each","this","trim","setDeletedResourceLanguageOperations","post","snacUrl","serialize","done","data","createdResource","resource","slideUp","setTimeout","window","location","id","fail","$deletedLanguages","has","$ignoredLanguages","setOperations","cancelResource","href","newResourceLanguage","$newLanguage","clone","newLanguageID","languageCount","attr","addClass","replace","console","log","toggle","before","enableLanguageSelect","deleteOrUndoLanguage","$btn","currentTarget","toggleClass","closest","$elements","operation","markEditedResourceFields","$resourceForm","on","e","length","enableVocabularySelect","selectItem","type","select2","ajax","url","dataType","delay","params","q","term","page","processResults","results","cache","width","minimumInputLength","allowClear","theme","placeholder","$language","magicNewResourceLanguage","defaultLanguage","Option","defaults","language","defaultScript","script","append","trigger","selectHoldingRepository","innerHTML","split","pop","selectedRepo","slideToggle","vocab_select_replace","idMatch","minLength","undefined","endsWith","query","geoPlaceSearchResults","geovocab_select_replace","selectResults","Array","forEach","result","push","text","administrationCode","countryCode","lastSourceSearchResults","scm_source_select_replace","res","displayName","evt","sourceID","idArray","j","shortName","source","str","removeClass","uri","citation","select_replace_simple","loadVocabSelectOptions","options","document","ready","exists","reviewer_select_replace"],"mappings":"4DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,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AY,UAAW,GAGrDmF,EAAqB3F,EAAEQ,MAAO,YAAa,WAAY,GAGvDmF,EAAqB3F,EAAEQ,MAAO,cAAe,aAAc,GAG3DmF,EAAqB3F,EAAEQ,MAAO,aAAc,cAAe,OAK/DR,EAAE,kBAAkB8H,WA/GQtE,EAgHDxD,EAAE,kBA/GjCA,EAAEvB,IAAImC,QAAU,gCAAgCE,MAAK,SAASC,GAC1D,IAAI4G,EAAU5G,EAAKqD,QACnBZ,EAAWE,QAAQ,CACf3C,KAAM4G,EACNnD,YAAY,EACZC,MAAO,YACPC,YAAa,2BA4GjB1E,EAAE,sBAAsB8H,UAvGhC,SAAiCtE,GACR,MAAdA,GACKA,EAAWE,QAAQ,CACfgB,YAAa,4BACbf,KAAM,CACFC,IAAK,WAEG,OADQhD,QAAQ,8BAGxBiD,SAAU,OACVC,MAAO,IACP/C,KAAM,SAAUgD,GACZ,MAAO,CACHC,EAAGD,EAAOE,KACVC,KAAMH,EAAOG,OAGrBC,eAAgB,SAAUpD,EAAMmD,GAC5B,MAAO,CAAEE,QAASrD,EAAKqD,UAE3BC,OAAO,GAEXC,MAAO,OACPC,mBAAoB,EACpBC,YAAY,EACZC,MAAO,cA+EnBsD,CAAwB/H,EAAE,2B,6BCzUlC,yBAGAoB,OAAOsG,uBAAyBA,yBAChCtG,OAAOuE,qBAAuBA,uBAC9BvE,OAAOsB,qBAAuBA,uBAC9BtB,OAAO8B,yBAA2BA,2BAClC9B,OAAOU,oBAAsBA,sBAC7BV,OAAOQ,eAAiBA,iBACxBR,OAAOxB,aAAeA,eACtBwB,OAAOiE,wBAA0BA,0BACjCjE,OAAOwD,yBAA2BA","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/**\n * Resource Admin Actions\n *\n * Contains code that handles Resource creation and editing\n *\n * @author Joseph Glass\n * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause\n * @copyright 2015 the Rector and Visitors of the University of Virginia, and\n * the Regents of the University of California\n */\n\nexport function saveResource(event) {\n event.preventDefault();\n var $form = $(event.target);\n\n if ($form.find(\"#resource-url\").val() == \"\") {\n if (!confirm('Are you sure you want to save without an HREF?')) {\n return;\n }\n }\n $('#notification-message').slideDown().html(\"

Saving Resource... Please wait.

\");\n\n // Remove leading and trailing whitespace\n $form.find(\"input, textarea\").each(function() {\n $(this).val($.trim($(this).val()));\n });\n\n setDeletedResourceLanguageOperations($form);\n\n $.post(snacUrl + \"/save_resource\", $form.serialize())\n .done(function(data) {\n createdResource = data;\n if (typeof(data.resource) === 'undefined') {\n $('#error-message').slideDown();\n return false;\n }\n $('#notification-message').slideUp();\n $('#success-message').slideDown();\n setTimeout(function() {\n window.location = (snacUrl + \"/vocab_administrator/resources/\" + data.resource.id);\n }, 1000);\n })\n .fail(function() {\n $('#error-message').slideDown();\n });\n return false;\n}\n\n\nexport function setDeletedResourceLanguageOperations($form) {\n // Set deleted new languages to null, set deleted existing languages to delete\n var $deletedLanguages = $form.find(\"#resource-languages .component-deleted\").has('input[id]');\n var $ignoredLanguages = $form.find(\"#resource-languages .component-deleted.new-language\");\n setOperations($deletedLanguages, \"delete\");\n setOperations($ignoredLanguages, \"\");\n}\n\nexport function cancelResource() {\n if (!confirm('Are you sure you want to cancel?')) {\n return;\n }\n\n $('#notification-message').html(\"

Cancelling...

\");\n $('#notification-message').slideDown();\n setTimeout(function() {\n window.location.href = snacUrl + \"/vocab_administrator\";\n }, 1000);\n return false;\n}\n\n/**\n * New Resource Language\n * Copies the resource template DIV on the page and attaches it correctly to the DOM.\n * Tracks language index using $('#language-template').data('languageCount')\n *\n */\nexport function newResourceLanguage(event) {\n event.preventDefault();\n var $newLanguage = $('#resource-language-template').find(\".language\").clone();\n var data = $('#resource-language-template').data();\n var newLanguageID = 'language_' + data.languageCount;\n $newLanguage.attr('id', newLanguageID);\n $newLanguage.find('.operation').val('insert');\n $newLanguage.addClass('new-language');\n\n //update input names with new data.languageCount\n $newLanguage.find('input, select').attr('name', function(i, name) {\n return name.replace('YY', data.languageCount);\n });\n\n console.log('Adding new resource language with id: ', newLanguageID);\n $newLanguage.toggle();\n // selects last to avoid conflict on multiple clones\n $('.add-resource-language:last').before($newLanguage);\n enableLanguageSelect($newLanguage);\n\n data.languageCount++;\n return $newLanguage;\n}\n\n/**\n * Delete or Undo Language\n *\n * Toggles component-deleted class, and btn classes for delete and undo.\n * Does not change operations.\n *\n */\nexport function deleteOrUndoLanguage(event) {\n event.preventDefault();\n var $btn = $(event.currentTarget);\n $btn.toggleClass('btn-danger btn-warning');\n $btn.find(':only-child').toggleClass('fa-minus-circle fa-undo');\n var $language = $btn.closest('.language');\n $language.toggleClass('alert-danger component-deleted');\n}\n\n\nfunction setOperations($elements, operation) {\n $elements.find('.operation').each(function() {\n $(this).val(operation);\n });\n}\n\n/**\n * Mark Edited Resource Fields\n *\n * Adds edited-field class to altered inputs. Sets altered resource language to update.\n * @param jqueryObject $resourceForm jQuery object to modify\n *\n */\nexport function markEditedResourceFields($resourceForm) {\n $resourceForm.find(\"input, select, textarea\").on(\"change\", function(e) {\n $(e.target).addClass('edited-field');\n\n if ($(e.target).closest('.language').length) {\n setOperations($(e.target).closest('.language'), \"update\");\n }\n });\n}\n\nfunction enableVocabularySelect(selectItem, type) {\n selectItem.select2({\n ajax: {\n url: snacUrl + \"/vocabulary?type=\" + type,\n dataType: 'json',\n delay: 250,\n data: function(params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function(data, page) {\n return {\n results: data.results\n };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 0,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n}\n\nexport function enableLanguageSelect($language) {\n enableVocabularySelect($language.find(\"select:first\"), 'language_code');\n enableVocabularySelect($language.find(\"select:last\"), 'script_code');\n}\n\n\nexport function magicNewResourceLanguage(event) {\n var $newLanguage = newResourceLanguage(event);\n var defaultLanguage = new Option(defaults.language.term, defaults.language.id, false, true);\n var defaultScript = new Option(defaults.script.term, defaults.script.id, false, true);\n $newLanguage.find(\"select:first\").append(defaultLanguage).trigger('change');\n $newLanguage.find(\"select:last\").append(defaultScript).trigger('change');\n}\n\nexport function selectHoldingRepository(event) {\n event.preventDefault();\n var name = event.target.innerHTML;\n var id = event.target.href.split('/').pop();\n var selectedRepo = new Option(name, id, false, true);\n $(\".resource-repo:last\").append(selectedRepo).trigger('change');\n $(\"#search_form\").slideToggle();\n $(\"#search-results-box\").html(\"\");\n $(\"#searchbox\").val(\"\");\n}\n","/**\n * Select Box Loaders\n *\n * Functions that can be used to replace select boxes on the edit page with\n * pretty-formatted versions using JQuery and Select2\n *\n * @author Robbie Hott\n * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause\n * @copyright 2015 the Rector and Visitors of the University of Virginia, and\n * the Regents of the University of California\n */\n\n/**\n * Replace a select that is linked to a Vocabulary search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string idMatch ID string for the object on the page\n * @param string type The type of the vocabulary term\n * @param int minLength The minimum required length of the autocomplete search\n */\nexport function vocab_select_replace(selectItem, idMatch, type, minLength) {\n if (minLength === undefined) {\n minLength = 2;\n }\n\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl + \"/vocabulary?type=\"+type+\"&id=\";\n query += $(\"#constellationid\").val()+\"&version=\"+$(\"#version\").val();\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n return { results: data.results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: minLength,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n }\n}\n\nexport var geoPlaceSearchResults = null;\n\nexport function geovocab_select_replace(selectItem, idMatch) {\n var minLength = 2;\n\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl+\"/vocabulary?type=geo_place&format=term\";\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n if (data.results) {\n geoPlaceSearchResults = data.results;\n var selectResults = new Array();\n data.results.forEach(function(result) {\n selectResults.push({\n id: result.id,\n text: result.name + \" (\" + result.administrationCode + \", \" + result.countryCode+ \")\"\n })\n });\n return {results: selectResults};\n }\n return { results: null };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: minLength,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n }\n}\n\nvar lastSourceSearchResults = null;\n\n/**\n * Add
helper script\n *\n * Adds
to strings so that they can be shown to the user in HTML\n * after being input into a text-only field.\n */\nfunction addbr(str) {\n if (typeof str !== 'undefined' && str !== null) {\n return (str + '').replace(/(\\r\\n|\\n\\r|\\r|\\n)/g, '
' + '$1');\n }\n return '';\n}\n\n/**\n * Replace a select that is linked to a Constellation Source search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string idMatch ID string for the object on the page\n */\nexport function scm_source_select_replace(selectItem, idMatch) {\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl+\"/vocabulary?type=ic_sources&id=\";\n query += $(\"#constellationid\").val()+\"&version=\"+$(\"#version\").val();\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n // Modify the results to be in the format we want\n lastSourceSearchResults = data.results;\n // need id, text\n var results = new Array();\n data.results.forEach(function(res) {\n results.push({id: res.id, text: res.displayName});\n });\n return { results: results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 0,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n\n selectItem.on('change', function (evt) {\n // TODO: Get the current selected value and update the well in the page to reflect it!\n // Note: all the selections are available in the global lastSourceSearchResults variable.\n var sourceID = $(this).val();\n var inPageID = $(this).attr(\"id\");\n var idArray = inPageID.split(\"_\");\n if (idArray.length >= 6) {\n var i = idArray[5];\n var j = idArray[4];\n var shortName = idArray[1];\n lastSourceSearchResults.forEach(function(source) {\n if (source.id == sourceID) {\n // Update the text of the source\n if (typeof source.text !== 'undefined') {\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).html(addbr(source.text)).removeClass('hidden');\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).closest(\".panel-body\").removeClass('hidden');\n } else {\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).text(\"\").addClass('hidden');\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).closest(\".panel-body\").addClass('hidden');\n\n }\n // Update the URI of the source\n if (typeof source.uri !== 'undefined')\n $(\"#scm_\" + shortName + \"_source_uri_\" + j + \"_\" + i).html(''+source.uri+'');\n else\n $(\"#scm_\" + shortName + \"_source_uri_\" + j + \"_\" + i).html('');\n // Update the URI of the source\n if (typeof source.citation !== 'undefined')\n $(\"#scm_\" + shortName + \"_source_citation_\" + j + \"_\" + i).html(source.citation).removeClass('hidden');\n else\n $(\"#scm_\" + shortName + \"_source_citation_\" + j + \"_\" + i).html('').addClass('hidden');\n }\n });\n }\n });\n\n }\n}\n\n/**\n * Replace a select that is linked to an affiliation search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n */\nfunction affiliation_select_replace(selectItem) {\n $.get(snacUrl + \"/vocabulary?type=affiliation\").done(function(data) {\n var options = data.results;\n selectItem.select2({\n data: options,\n allowClear: true,\n theme: \"bootstrap\",\n placeholder: \"Select Affiliation\"\n });\n });\n}\n\nfunction reviewer_select_replace(selectItem) {\n if(selectItem != null) {\n selectItem.select2({\n placeholder: \"Reviewer Name or Email...\",\n ajax: {\n url: function() {\n var query = snacUrl+\"/user_search?role=Reviewer\";\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n return { results: data.results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 1,\n allowClear: false,\n theme: 'bootstrap'\n });\n }\n}\n\nfunction select_replace(selectItem, idMatch) {\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n allowClear: true,\n theme: 'bootstrap'\n });\n }\n}\n\nexport function select_replace_simple(selectItem) {\n selectItem.select2({\n width: '100%',\n allowClear: true,\n theme: 'bootstrap'\n });\n}\n\n/**\n * Load Vocab Select Options\n *\n * Replaces the select with a select2 object preloaded with an array of options\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string type The type of the vocabulary term\n * @param string type Text placeholder for select\n */\nexport function loadVocabSelectOptions(selectItem, type, placeholder) {\n return $.get(snacUrl + \"/vocabulary?type=\" + type)\n .done(function(data) {\n var options = data.results;\n selectItem.select2({\n data: options,\n allowClear: false,\n theme: 'bootstrap',\n placeholder: placeholder\n });\n });\n}\n\n/**\n * Replace all the selects that exist on the page when the page has finished loading\n */\n$(document).ready(function() {\n // Use select2 to display the select dropdowns\n // rather than the HTML default\n $(\"select\").each(function() {\n if (typeof $(this).attr('id') !== typeof undefined && $(this).attr('id') !== false) {\n // Replace the subject selects\n vocab_select_replace($(this), \"language_language_\", \"language_code\", 1);\n\n // Replace the subject selects\n vocab_select_replace($(this), \"language_script_\", \"script_code\", 1);\n\n // Replace the subject selects\n vocab_select_replace($(this), \"subject_\", \"subject\", 4);\n\n // Replace the function selects\n vocab_select_replace($(this), \"function_\", \"function\", 4);\n\n // Replace the occupation selects\n vocab_select_replace($(this), \"occupation_\", \"occupation\", 4);\n\n // Replace the entityType select\n vocab_select_replace($(this), \"entityType\", \"entity_type\", 0);\n }\n });\n\n // Replace the Affiliation dropdowns, if one exists\n if ($(\"#affiliationid\").exists())\n affiliation_select_replace($(\"#affiliationid\"));\n\n // Replace the User search dropdown, if one exists\n if ($(\"#reviewersearchbox\").exists())\n reviewer_select_replace($(\"#reviewersearchbox\"));\n});\n","import { loadVocabSelectOptions, vocab_select_replace } from \"./select_loaders.js\";\nimport { enableLanguageSelect, markEditedResourceFields, newResourceLanguage, cancelResource, saveResource, selectHoldingRepository, magicNewResourceLanguage } from \"./resource_admin.js\";\n\nwindow.loadVocabSelectOptions = loadVocabSelectOptions;\nwindow.vocab_select_replace = vocab_select_replace;\nwindow.enableLanguageSelect = enableLanguageSelect;\nwindow.markEditedResourceFields = markEditedResourceFields;\nwindow.newResourceLanguage = newResourceLanguage;\nwindow.cancelResource = cancelResource;\nwindow.saveResource = saveResource;\nwindow.selectHoldingRepository = selectHoldingRepository;\nwindow.magicNewResourceLanguage = magicNewResourceLanguage;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/edit_scripts.js b/src/virtualhosts/www/javascript/edit_scripts.js index 3ffac90f1..5dafa5c7a 100644 --- a/src/virtualhosts/www/javascript/edit_scripts.js +++ b/src/virtualhosts/www/javascript/edit_scripts.js @@ -1,3 +1,4 @@ +!function(e,t){for(var a in t)e[a]=t[a]}(window,function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=3)}({3:function(e,t,a){"use strict";a.r(t),a.d(t,"somethingHasBeenEdited",(function(){return n})),a.d(t,"setEditedFlag",(function(){return i})),a.d(t,"undoSet",(function(){return r})),a.d(t,"defaults",(function(){return o})),a.d(t,"displayErrorMessage",(function(){return l})),a.d(t,"addDateEntry",(function(){return s})),a.d(t,"addDateRangeEntry",(function(){return c})),a.d(t,"addSCMEntry",(function(){return _})),a.d(t,"makeEditable",(function(){return u})),a.d(t,"makeUneditable",(function(){return v})),a.d(t,"makeSCMUneditable",(function(){return g})),a.d(t,"setRepeatedDataDeleted",(function(){return h})),a.d(t,"newAddressLine",(function(){return C})),a.d(t,"newNameEntryComponent",(function(){return Z})),a.d(t,"updateNameEntryHeading",(function(){return E})),a.d(t,"newNameEntryRule",(function(){return I})),a.d(t,"updateDate",(function(){return w})),a.d(t,"chooseSuggestedGeoPlace",(function(){return A})),a.d(t,"magicDefaultFill",(function(){return N})); /** * Edit Scripts * @@ -8,2843 +9,5 @@ * @copyright 2015 the Rector and Visitors of the University of Virginia, and * the Regents of the University of California */ - -var biogHistEditor = null; - -// Has anything been edited on this page? -var somethingHasBeenEdited = false; - -function setEditedFlag(val) { - if (val == true) { - $("#save_and_continue").addClass("save-active"); - } else { - $("#save_and_continue").removeClass("save-active"); - } - somethingHasBeenEdited = val; -} - - -// Global Undo Set -var undoSet = new Array(); - -var defaults = { - language: { - id: 130, - term: "eng" - }, - script: { - id: 586, - term: "Latn" - } -}; - - - -/** - * Display Error message - * - * Displays the error message box to the user with the given error message - * - * @param string|object err The error message (string) or error object containing a message and type string - */ -function displayErrorMessage(err, data) { - var errorMsg = ""; - if (typeof err === 'undefined') - errorMsg = "an unknown problem occurred"; - else if ((typeof err) == "string") - errorMsg = err; - else if (err.message) - errorMsg = err.message; - else if (err.type) - errorMsg = err.type; - else - errorMsg = "an unknown problem occurred"; - - $('#error-message').html("

Oops

"+errorMsg+"

" - +"

" - +" " - +""+ - "Go to Dashboard" - +"" - +"

"); - setTimeout(function(){ - $('#error-message').slideDown(); - }, 500); - - // For reference, put the server response in the console - console.log(data); -} - -/** - * Add sub-Date GUI object - * - * Adds a Date GUI object to the Date modal for the given "short" type of data indexed by i - * - * @param string short The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index of the object to add a date object to. - * @returns boolean false to keep the browser from redrawing the page - */ -function addDateEntry(short, i){ - //next_date_{{short}}_{{i}}_j - var j = parseInt($('#next_date_'+short+'_'+i+'_j').text()); - var id = j + "_" + i; - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#sub_date_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short); - $('#add_date_'+short+'_'+i+'_div').after(html); - $('#next_date_'+short+'_'+i+'_j').text(j + 1); - turnOnButtons(short+"_date"+j, i); - turnOnTooltips(short+"_date_"+j, i); - makeEditable(short + "_date_"+j, i); - return false; -} - -/** - * Add sub-Date GUI object - * - * Adds a Date GUI object to the Date modal for the given "short" type of data indexed by i - * - * @param string short The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index of the object to add a date object to. - * @returns boolean false to keep the browser from redrawing the page - */ -function addDateRangeEntry(short, i){ - //next_date_{{short}}_{{i}}_j - var j = parseInt($('#next_date_'+short+'_'+i+'_j').text()); - var id = j + "_" + i; - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#sub_dateRange_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short); - $('#add_date_'+short+'_'+i+'_div').after(html); - $('#next_date_'+short+'_'+i+'_j').text(j + 1); - turnOnButtons(short+"_date"+j, i); - turnOnTooltips(short+"_date_"+j, i); - makeEditable(short + "_date_"+j, i); - return false; -} - -/** - * Add SCM GUI object - * - * Adds a GUI SCM object to the SCM modal for the given "short" type of data indexed by i - * - * @param string short The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index of the object to add an SCM object to. - * @returns boolean false to keep the browser from redrawing the page - */ -function addSCMEntry(short, i){ - //next_scm_{{short}}_{{i}}_j - var j = parseInt($('#next_scm_'+short+'_'+i+'_j').text()); - var id = j + "_" + i; - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#scm_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/YY/g, j).replace(/SHORT/g, short); - $('#add_scm_'+short+'_'+i+'_div').after(html); - $('#next_scm_'+short+'_'+i+'_j').text(j + 1); - turnOnSCMButtons(short, i, j); - turnOnTooltips("scm_"+short, id); - makeSCMEditable(short, i, j); - return false; -} - -/** - * Undo Edit - * - * Returns the html for the (short, i) panel back to its original state, i.e. removes - * the edit. Before doing this, to clean up the page, it first makes the edited version - * uneditable. - * - * @param string short The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - */ -function undoEdit(short, i) { - makeUneditable(short, i); - - // restore the old content - $("#" + short + "_datapart_" + i).replaceWith(undoSet[short+"-"+i]); - turnOnTooltips(short,i); - $("#" + short + "_datapart_" + i + " input[type='checkbox']").each(function() { - var obj = $(this); - obj.bootstrapToggle(); - }); -} - -/** - * Undo SCM Edit - * - * Takes an SCM GUI object (j) for a data object (short, i) and returns it back to its - * original state (removing the edit). Before doing this, to clean up the page and JS, it first - * makes the edited version uneditable, then replaces the HTML. - * - * @param string short The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @param string|int j The index within the data object SCM list on the edit page of the SCM object. - */ -function undoSCMEdit(short, i, j) { - var id = j + "_" + i; - makeSCMUneditable(short, i, j); - - // restore the old content - $("#scm_" + short + "_datapart_" + id).replaceWith(undoSet["scm_"+short+"-"+id]); - turnOnTooltips("scm_"+short, id); -} - -/** - * Change vocabulary input divs to selects - * - * Changes all div's with id "select_" for a given data object (shortName, idStr) from a list of - * inputs defining the parameters to a select (view mode) to a select box (edit mode). It then - * calls the select2 function to replace the select with an AJAX-compatible select. - * - * This function handles VOCABULARY select boxes ONLY. - * - * Note: idStr must not have the "_" pre-appended - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int idStr The index within the edit page of the object. - */ -function textToSelect(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='select_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("select_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); - var term = $("#"+shortName+"_"+name+"_term_"+idStr).val(); - var vocabtype = $("#"+shortName+"_"+name+"_vocabtype_"+idStr).val(); - var minlength = $("#"+shortName+"_"+name+"_minlength_"+idStr).val(); - var placeholder = "Select"; - if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { - placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); - } - var options = ""; - if ($("#"+shortName+"_"+name+"_defaultOptions_"+idStr).exists()) { - options = $("#"+shortName+"_"+name+"_defaultOptions_"+idStr).val(); - } - - cont.html(""+ - "" + - ""); - - if (name == "citation") - scm_source_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr); - else - vocab_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr, vocabtype, minlength); - - } - }); -} - -function textToCheckbox(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='checkbox_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^checkbox_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - var placeholderOn = ""; - if ($("#"+shortName+"_"+name+"_placeholderOn_"+idStr).exists()) { - placeholderOn = $("#"+shortName+"_"+name+"_placeholderOn_"+idStr).val(); - } - var placeholderOff = ""; - if ($("#"+shortName+"_"+name+"_placeholderOff_"+idStr).exists()) { - placeholderOff = $("#"+shortName+"_"+name+"_placeholderOff_"+idStr).val(); - } - - var html = ""; - } - if (placeholderOff != "") { - html += ""; - } - - cont.html(html); - $("#"+shortName+"_"+name+"_"+idStr).bootstrapToggle(); - } - }); - - -} - - -function checkboxToText(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='checkbox_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^checkbox_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - var checked = $("#"+shortName+"_"+name+"_"+idStr).prop('checked'); - var placeholderOn = ""; - if ($("#"+shortName+"_"+name+"_placeholderOn_"+idStr).exists()) { - placeholderOn = $("#"+shortName+"_"+name+"_placeholderOn_"+idStr).val(); - } - var placeholderOff = ""; - if ($("#"+shortName+"_"+name+"_placeholderOff_"+idStr).exists()) { - placeholderOff = $("#"+shortName+"_"+name+"_placeholderOff_"+idStr).val(); - } - - - var html = ""; - - html += "

"; - if (checked) { - if (placeholderOn != "") - html += placeholderOn; - else - html += value; - } else { - if (placeholderOff != "") - html += placeholderOff; - } - html += "

"; - if (placeholderOn != "") { - html += ""; - } - if (placeholderOff != "") { - html += ""; - } - - $("#"+shortName+"_"+name+"_"+idStr).bootstrapToggle("destroy"); - cont.html(html); - } - }); - - -} - -function textToInput(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='text_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^text_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - var size = 0; - var sizeStr = ""; - if ($("#"+shortName+"_"+name+"_size_"+idStr).exists()) { - size = parseInt($("#"+shortName+"_"+name+"_size_"+idStr).val()); - sizeStr = " size='" + size +"' "; - } - var placeholder = ""; - if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { - placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); - } - - var onKeyUp = ""; - if ($("#"+shortName+"_"+name+"_onKeyUp_"+idStr).exists()) { - onKeyUp = $("#"+shortName+"_"+name+"_onKeyUp_"+idStr).val(); - } - var onKeyUpStr = ""; - if (onKeyUp != "") { - onKeyUpStr = " onKeyUp='"+onKeyUp+"' "; - } - - var html = ""; - if (size != 0) { - html += ""; - } - if (placeholder != "") { - html += ""; - } - if (onKeyUp != "") { - html += ""; - } - - cont.html(html); - } - }); - - -} - - -function inputToText(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='text_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^text_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - var size = 0; - if ($("#"+shortName+"_"+name+"_size_"+idStr).exists()) { - size = parseInt($("#"+shortName+"_"+name+"_size_"+idStr).val()); - } - var placeholder = ""; - if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { - placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); - } - var onKeyUp = ""; - if ($("#"+shortName+"_"+name+"_onKeyUp_"+idStr).exists()) { - onKeyUp = $("#"+shortName+"_"+name+"_onKeyUp_"+idStr).val(); - } - - var html = ""; - html += "

" + value + "

"; - if (size != 0) { - html += ""; - } - if (placeholder != "") { - html += ""; - } - if (onKeyUp != "") { - html += ""; - } - - cont.html(html); - } - }); - - -} - - - -function textToTextArea(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='textarea_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^textarea_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - - var html = ""; - - cont.html(html); - } - }); -} - - -function textAreaToText(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='textarea_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace(/^textarea_/, "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var value = $("#"+shortName+"_"+name+"_"+idStr).val(); - - //var html = ""; - var html = ""; - html += "
" + value + "
"; - - cont.html(html); - } - }); -} - -/** - * Change vocabulary selects to divs of inputs - * - * Changes all div's with id "select_" for a given data object (shortName, idStr) from a select - * box (edit mode) to a list of inputs defining the parameters to a select (view mode). - * - * This function handles VOCABULARY select boxes ONLY. - * - * Note: idStr must not have the "_" pre-appended - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int idStr The index within the edit page of the object. - */ -function selectToText(shortName, idStr) { - $("div[id^='select_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("select_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); - var term = $("#"+shortName+"_"+name+"_id_"+idStr+ " option:selected").text(); - var vocabtype = $("#"+shortName+"_"+name+"_vocabtype_"+idStr).val(); - var minlength = $("#"+shortName+"_"+name+"_minlength_"+idStr).val(); - - var additionalStyle = ""; - var postText = ""; - if (vocabtype == "name_component") { - additionalStyle = "name-component-type"; - postText = " :"; - } - - cont.html("" + - "" + - "" + - "" + - "

"+term+postText+"

"); - - } - }); -} - - -var geoPlaceLoadResults = null; - -function textToGeoPlaceSelect(shortName, idStr) { - $("#"+shortName+"_datapart_" + idStr + " div[id^='selectGeo_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("selectGeo_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); - var term = $("#"+shortName+"_"+name+"_term_"+idStr).val(); - var placeholder = "Select Geo Place Term"; - - var confirmed = $("#"+shortName+"_confirmed_" + idStr).val() == "true" ? true : false; - var firstOptionSelect = ""; - var secondOptionSelect = " selected"; - if (!confirmed) { - firstOptionSelect = " selected"; - secondOptionSelect = ""; - } - - cont.html(""); - - geovocab_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr); - - } - }); -} - -function geoPlaceSelectToText(shortName, idStr) { - $("div[id^='selectGeo_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("selectGeo_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); - var term = $("#"+shortName+"_"+name+"_id_"+idStr+ " option:selected").text(); - - cont.html("" + - ""); - - } - }); -} - -/** - * Make a data object editable - * - * Make the GUI pane for a given constellation object (short, i) editable. Sets up the edit and delete - * buttons for first-order data objects. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @return boolean False to play nice with the browser - */ -function makeEditable(short, i) { - // No editing if it's already in edit mode - if ($("#" + short + "_operation_" + i).val() == "update") - return false; - // If it's deleted, then you better undelete it first - if ($("#" + short + "_operation_" + i).val() == "delete") - setDeleted(short, i); - - $("#" + short + "_editbutton_" + i).removeClass("list-group-item-info").addClass("list-group-item-warning"); - $("#" + short + "_editbutton_" + i).html("
Undo"); - $("#" + short + "_editbutton_" + i).off('click').on("click", function() { - undoEdit(short, i); - }); - $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-danger").addClass("disabled"); - $("#" + short + "_deletebutton_" + i).off('click').on("click", function() { - return false; - }); - - $("#" + short + "_panel_" + i).removeClass("panel-default").addClass("alert-info").addClass("edited-component"); - - return subMakeEditable(short, i); -} - -/** - * Make a data object editable - * - * Make the GUI pane for a given constellation object (short, i) editable. Handles removing the read-only - * statuses and changing divs into selects. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @return boolean False to play nice with the browser - */ -function subMakeEditable(short, i) { - // No editing if it's already in edit mode - if ($("#" + short + "_operation_" + i).val() == "update") - return false; - - // Add to the undo set - undoSet[short + "-" + i] = $("#"+short+"_datapart_" + i).clone(); - - - textToInput(short, i); - textToTextArea(short, i); - textToCheckbox(short, i); - - var idstr = "_" + i; - - // Enable buttons - $("#"+short+"_datapart_" + i + " button[id^='"+short+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - obj.removeAttr("disabled").removeClass("snac-hidden"); - } - }); - // Enable buttons - $("#"+short+"_datapart_" + i + " a.label").each(function() { - $(this).removeClass("snac-hidden"); - }); - - // Enable checkboxes - $("#"+short+"_datapart_" + i + " input[type='checkbox']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - obj.bootstrapToggle('enable'); - } - }); - - // Turn on CodeMirror Editors - $("#"+short+"_datapart_" + i + " textarea[id^='"+short+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) - && !obj.attr('id').endsWith("ZZ")) { - // remove the short name from the string we're parsing - var idStr = obj.attr('id').replace(short, ""); - if (idStr.indexOf('_text_') != -1 || idStr.indexOf('_source_') != -1) { - obj.get(0).CodeMirror = CodeMirror.fromTextArea(obj.get(0), { - lineNumbers: true, - lineWrapping: true, - viewportMargin: Infinity, - mode: {name: "xml"} - }); - } - } - }); - var sawSelect = false; - $("#"+short+"_datapart_" + i + " select[id^='"+short+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - sawSelect = true; - } - }); - - if (!sawSelect) { - textToSelect(short, i); - textToGeoPlaceSelect(short, i); - textToDate(short, i); - } - - // Make things re-orderable if something exists - // $( "#nameEntry_component_ui_0" ).sortable({ // id of the container containing sortable things - // items : '.name_component' // class of the things that are sortable. They MUST have ids - // }); - $("#"+short+"_datapart_" + i + " span.move-handle").each(function() { - $(this).removeClass("snac-hidden"); - }); - $( "#"+short+"_reorderable_"+i ).sortable({ - items : '.reorderable', - opacity : 0.5, - update : function( event, ui ) { - var neworder = $( "#"+short+"_reorderable_"+i ).sortable("toArray"); - console.log(neworder); - neworder.forEach(function(orderedID, index) { - $("#"+orderedID + " input.order-index").val(index); - }); - if (short == "nameEntry") - updateNameEntryHeading(i); - } - }); - - // Make the relation pictures update appropriately - if (short == 'constellationRelation') { - // make the role dropdown affect the picture - $('#'+short+'_type_id_'+i).change(function() { - updatePictureArrow(short, i, - $('#'+short+'_type_id_'+i+' option:selected').text()); - }); - - } - if (short == 'resourceRelation') { - // make the role dropdown affect the picture - $('#'+short+'_role_id_'+i).change(function() { - updatePictureArrow(short, i, - $('#'+short+'_role_id_'+i+' option:selected').text()); - }); - } - // Places should update the place heading - if (short == 'place') { - // If there is a value pre-set, then automatically confirm and update - if ($('#'+short+'_geoplace_id_'+i).val() != null && $('#'+short+'_geoplace_id_'+i).val() != "") { - updatePlaceHeading(short, i, $('#'+short+'_geoplace_id_'+i).val()); - } - // make the role dropdown affect the picture - $('#'+short+'_geoplace_id_'+i).change(function() { - updatePlaceHeading(short, i, - $('#'+short+'_geoplace_id_'+i).val()); - }); - } - - // add parser btn if nameEntry is a computed name, entity is person, and if no btn or extra name components already exist - if (short === 'nameEntry' && ($("#entityType").val() === "700") && - ($("#nameEntry_component_0_panel_" + i).find('select:first').text() === "Name") && - (!$("#nameEntry_panel_" + i).find('.name-parser').length && - $("#nameEntry_component_1_panel_" + i).length === 0)) { - $('#nameEntry_component_add_' + i).after(''); - } - - // Set this data's operation value appropriately - if ($("#" + short + "_id_" + i).val() != "") - $("#" + short + "_operation_" + i).val("update"); - else - $("#" + short + "_operation_" + i).val("insert"); - - // Asked to edit something, so make it globally known - setEditedFlag(true); - //somethingHasBeenEdited = true; - - return false; -} - -/** - * Make a data object uneditable - * - * Make each object in the GUI page for the given piece uneditable by turning them back to text. Also - * takes the color away from the pane and removes the operation flag. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @return boolean False to play nice with the browser - */ -function subMakeUneditable(shortName, i) { - - // Make inputs read-only - var idstr = "_" + i; - - - // Turn off the reordering js - $("#"+shortName+"_datapart_" + i + " span.move-handle").each(function() { - $(this).addClass("snac-hidden"); - }); - if ($( "#"+shortName+"_reorderable_"+i ).hasClass("ui-sortable")) - $( "#"+shortName+"_reorderable_"+i ).sortable("destroy"); - - // Remove CodeMirror editors - $("#"+shortName+"_datapart_" + i + " textarea[id^='"+shortName+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) - && !obj.attr('id').endsWith("ZZ") - && (obj.attr('id').indexOf('_text_') != -1 || obj.attr('id').indexOf('_source_') != -1)) { - - if (obj.get(0).CodeMirror) { - obj.get(0).CodeMirror.toTextArea(); - } - //(document.getElementById(obj.attr('id'))).CodeMirror.toTextArea(); - //obj.get(0).CodeMirror.toTextArea(); - } - }); - // Disable buttons - $("#"+shortName+"_datapart_" + i + " button[id^='"+shortName+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - obj.attr("disabled", "true").addClass("snac-hidden"); - } - }); - - // Disable buttons - $("#"+shortName+"_datapart_" + i + " a.label").each(function() { - $(this).addClass("snac-hidden"); - }); - - // Disable checkboxes - $("#"+shortName+"_datapart_" + i + " input[type='checkbox']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - obj.bootstrapToggle("disable"); - } - }); - - inputToText(shortName, i); - textAreaToText(shortName, i); - checkboxToText(shortName, i); - // Check for a select box - var sawSelect = false; - $("#"+shortName+"_datapart_" + i + " select[id^='"+shortName+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { - sawSelect = true; - } - }); - // If a select box was seen, undo it - if (sawSelect) { - selectToText(shortName, i); - geoPlaceSelectToText(shortName, i); - dateToText(shortName,i); - } - - - // Clear the operation flags - //$("#" + shortName + "_operation_" + i).val(""); - $("#"+shortName+"_datapart_" + i + " input[id^='"+shortName+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith("_operation" + idstr) && !obj.attr('id').endsWith("ZZ")) { - obj.val(""); - } - }); - - $("#" + shortName + "_panel_" + i).addClass("panel-default").removeClass("alert-info").removeClass("edited-component"); - - - -} - -/** - * Make a data object uneditable - * - * Make the GUI pane for a given constellation object (short, i) un-editable. Sets up the edit and delete - * buttons for first-order data objects, and calls the function to turn the elements back to text. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @return boolean False to play nice with the browser - */ -function makeUneditable(shortName, i) { - // Make inputs read-only - var idstr = "_" + i; - - subMakeUneditable(shortName, i); - - // restore the edit button - $("#" + shortName + "_editbutton_" + i).addClass("list-group-item-info").removeClass("list-group-item-warning"); - $("#" + shortName + "_editbutton_" + i).html("
Edit"); - $("#" + shortName + "_editbutton_" + i).off('click').on("click", function() { - makeEditable(shortName, i); - }); - - // restore the delete button - $("#" + shortName + "_deletebutton_" + i).addClass("list-group-item-danger").removeClass("disabled"); - $("#" + shortName + "_deletebutton_" + i).off('click').on("click", function() { - setDeleted(shortName, i); - }); - - return false; -} - -/** - * Make an SCM data object editable - * - * Make the GUI pane for an SCM (j) of a given constellation object (short, i) editable. Sets up the edit and delete - * buttons for first-order data objects. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @param string|int j The index within the data object SCM list on the edit page of the SCM object. - * @return boolean False to play nice with the browser - */ -function makeSCMEditable(shortName, i, j) { - var id = j + "_" + i; - var scmShortName = "scm_" + shortName; - - // No editing if it's already in edit mode - if ($("#" + scmShortName + "_operation_" + id).val() == "update") - return false; - // If it's deleted, then you better undelete it first - if ($("#" + scmShortName + "_operation_" + id).val() == "delete") - setSCMDeleted(shortName, i, j); - - $("#" + scmShortName + "_editbutton_" + id).removeClass("list-group-item-info").addClass("list-group-item-warning"); - $("#" + scmShortName + "_editbutton_" + id).html(""); - $("#" + scmShortName + "_editbutton_" + id).off('click').on("click", function() { - undoSCMEdit(shortName, i, j); - }); - $("#" + scmShortName + "_deletebutton_" + id).removeClass("list-group-item-danger").addClass("disabled"); - $("#" + scmShortName + "_deletebutton_" + id).off('click').on("click", function() { - return false; - }); - - $("#" + scmShortName + "_panel_" + id).removeClass("panel-default").addClass("alert-info").addClass("edited-component"); - - return subMakeEditable(scmShortName, id); -} - -/** - * Make an SCM data object un-editable - * - * Make the GUI pane for an SCM object (j) for a given constellation object (short, i) un-editable. Sets up the edit and delete - * buttons for SCM data objects. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @param string|int j The index within the data object SCM list on the edit page of the SCM object. - * @return boolean False to play nice with the browser - */ -function makeSCMUneditable(shortName, i, j) { - - // Make inputs read-only - var idstr = j + "_" + i; - - subMakeUneditable('scm_'+shortName, idstr); - - // restore the edit button - $("#scm_" + shortName + "_editbutton_" + idstr).addClass("list-group-item-info").removeClass("list-group-item-warning"); - $("#scm_" + shortName + "_editbutton_" + idstr).html(""); - $("#scm_" + shortName + "_editbutton_" + idstr).off('click').on("click", function() { - makeSCMEditable(shortName, i, j); - }); - - // restore the delete button - $("#scm_" + shortName + "_deletebutton_" + idstr).addClass("list-group-item-danger").removeClass("disabled"); - $("#scm_" + shortName + "_deletebutton_" + idstr).off('click').on("click", function() { - setSCMDeleted(shortName, i, j); - }); - - return false; -} - -/** - * Set a Contributor Object as deleted - * - * Sets the contributor object (shortName, i) as deleted or undeleted and makes the appropriate changes. - * - * @param string shortName The short name of the contributor object. - * @param string|int i The index within the edit page of the object. - */ -function setRepeatedDataDeleted(shortName, i) { - if ($("#" + shortName + "_operation_" + i).val() != "delete") { - $("#" + shortName + "_remove_" + i).removeClass("btn-danger").addClass("btn-warning"); - $("#" + shortName + "_remove_" + i).html(""); - } else { - $("#" + shortName + "_remove_" + i).removeClass("btn-warning").addClass("btn-danger"); - $("#" + shortName + "_remove_" + i).html(""); - } - - return subSetDeleted(shortName, i); -} - -/** - * Set a first-order data object as deleted - * - * Sets a first-order data object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - */ -function setDeleted(short, i) { - if ($("#" + short + "_operation_" + i).val() != "delete") { - // set deleted - $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-danger").addClass("list-group-item-warning"); - $("#" + short + "_deletebutton_" + i).html("
Undo"); - - // disable edit button - $("#" + short + "_editbutton_" + i).removeClass("list-group-item-info").addClass("disabled"); - $("#" + short + "_editbutton_" + i).off('click').on("click", function() { - return false; - }); - - // disable the Date button - $("#" + short + "_datebutton_" + i).removeClass("list-group-item-success").addClass("disabled").prop('disabled', true); - - // disable the SCM button - $("#" + short + "_scmbutton_" + i).removeClass("list-group-item-success").addClass("disabled").prop('disabled', true); - - } else { - // set undelete - $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-warning").addClass("list-group-item-danger"); - $("#" + short + "_deletebutton_" + i).html("
Trash"); - - // restore edit button - $("#" + short + "_editbutton_" + i).addClass("list-group-item-info").removeClass("disabled"); - $("#" + short + "_editbutton_" + i).off('click').on("click", function() { - makeEditable(short, i); - }); - - // restore the Date button - $("#" + short + "_datebutton_" + i).addClass("list-group-item-success").removeClass("disabled").prop('disabled', false); - - // restore the SCM button - $("#" + short + "_scmbutton_" + i).addClass("list-group-item-success").removeClass("disabled").prop('disabled', false); - - } - - return subSetDeleted(short, i); -} - -/** - * Make the delete/undelete happen - * - * Actually performs the changes to the object, affecting the operation and panel color. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @return boolean False to play nice with the browser - */ -function subSetDeleted(short, i) { - if ($("#" + short + "_operation_" + i).val() != "delete") { - // set deleted - $("#" + short + "_panel_" + i).removeClass("panel-default").addClass("alert-danger").addClass("deleted-component"); - - $("#" + short + "_operation_" + i).val("delete"); - } else { - // set undelete - $("#" + short + "_panel_" + i).removeClass("alert-danger").addClass("panel-default").removeClass("deleted-component"); - - // If this thing was deleted but is supposed to be an update, then return it back to update status - var sawSelect = false; - $("select[id^='"+short+"_']").each(function() { - var obj = $(this); - if(obj.attr('id').endsWith("_" + i) && !obj.attr('id').endsWith("ZZ")) { - sawSelect = true; - } - }); - if (sawSelect) { - if ($("#" + short + "_id_" + i).val() != "") - $("#" + short + "_operation_" + i).val("update"); - else - $("#" + short + "_operation_" + i).val("insert"); - } else { - $("#" + short + "_operation_" + i).val(""); - } - - } - - // Asked to delete something, so make it globally known - setEditedFlag(true); - //somethingHasBeenEdited = true; - - return false; -} - -/** - * Set an SCM data object as deleted - * - * Sets an SCM object (j) for a constellation object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page. - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @param string|int j The index within the data object SCM list on the edit page of the SCM object. - */ -function setSCMDeleted(short, i, j) { - var id = j + '_' + i; - if ($("#scm_" + short + "_operation_" + id).val() != "delete") { - // set deleted - $("#scm_" + short + "_deletebutton_" + id).removeClass("list-group-item-danger").addClass("list-group-item-warning"); - $("#scm_" + short + "_deletebutton_" + id).html(""); - - // disable edit button - $("#scm_" + short + "_editbutton_" + id).removeClass("list-group-item-info").addClass("disabled"); - $("#scm_" + short + "_editbutton_" + id).off('click').on("click", function() { - return false; - }); - - } else { - // set undelete - $("#scm_" + short + "_deletebutton_" + id).removeClass("list-group-item-warning").addClass("list-group-item-danger"); - $("#scm_" + short + "_deletebutton_" + id).html(""); - - // restore edit button - $("#scm_" + short + "_editbutton_" + id).addClass("list-group-item-info").removeClass("disabled"); - $("#scm_" + short + "_editbutton_" + id).off('click').on("click", function() { - makeSCMEditable(short, i, j); - }); - - } - - return subSetDeleted("scm_"+short, id); -} - -/** - * Turn on the Edit/Delete buttons for an object - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - */ -function turnOnButtons(shortName, i) { - - // Turn on the edit button - $("#"+shortName+"_editbutton_"+i).on("click", function() { - makeEditable(shortName, i); - }); - - // Turn on the delete buttons - $("#"+shortName+"_deletebutton_"+i).on("click", function() { - setDeleted(shortName, i); - }); -} - -function turnOnTooltips(shortName, i) { - // Load tooltips - $(function () { - $('#'+shortName+'_panel_'+ i +' [data-toggle="tooltip"]').tooltip() - }) - - // Load popovers - $(function () { - $('#'+shortName+'_panel_'+ i +' [data-toggle="popover"]').popover({ - trigger: 'hover', - container: 'body' - }) - }) - - -} - -/** - * Turn on the Edit/Delete buttons for an SCM object - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int i The index within the edit page of the object. - * @param string|int j The index within the data object SCM list on the edit page of the SCM object. - */ -function turnOnSCMButtons(shortName, i, j) { - - // Turn on the edit button - $("#scm_"+shortName+"_editbutton_"+j+"_"+i).on("click", function() { - makeSCMEditable(shortName, i, j); - }); - - // Turn on the delete buttons - $("#scm_"+shortName+"_deletebutton_"+j+"_"+i).on("click", function() { - setSCMDeleted(shortName, i, j); - }); -} - -/** - * Create a new Address Line object on page - * - * Puts a new Place Address Line object DIV on the page and attaches it correctly to the DOM and javascript. - * - * @param int i The index on the page of the place to add this component to - * @return boolean false to play nice with the browser. - */ -function newAddressLine(i) { - var nextid = 1; - if ($('#place_address_next_j_'+i).exists()) { - nextid = parseInt($('#place_address_next_j_'+i).text()); - } - console.log("Creating new address line for place " + i + " with id: " + nextid); - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#addressline_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); - $('#place_address_add_div_'+i).before(html); - - $('#place_address_' + nextid + '_operation_' + 1).val("insert"); - subMakeEditable("place_address_" + nextid, i); - - vocab_select_replace($("#place_address_"+nextid+"_type_id_"+i), "_"+i, 'address_part', 0); - - // Put the updated version number back in the DOM - $('#place_address_next_j_'+i).text(++nextid); - - return false; -} - -/** - * Create a new Resource Relation Origination Name object on page - * - * Puts a new Resource Relation Origination Name object DIV on the page and attaches it correctly to the DOM and javascript. - * - * @param int i The index on the page of the Resource Relation to add this Origination Name to - * @return boolean false to play nice with the browser. - */ -function newOriginationName(i) { - var nextid = 1; - if ($('#resource_originationName_next_j_'+i).exists()) { - nextid = parseInt($('#resource_originationName_next_j_'+i).text()); - } - console.log("Creating new origination name for resource " + i + " with id: " + nextid); - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#originationName_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); - $('#resource_originationName_add_div_'+i).before(html); - - $('#resource_originationName_' + nextid + '_operation_' + 1).val("insert"); - subMakeEditable("resource_originationName_" + nextid, i); - - // Put the updated version number back in the DOM - $('#resource_originationName_next_j_'+i).text(++nextid); - - return false; -} - - -/** - * Create a new Name Entry Component object on page - * - * Puts a new Name Entry component object DIV on the page and attaches it correctly to the DOM and javascript. - * - * @param int i The index on the page of the nameEntry to add this component to - * @return boolean false to play nice with the browser. - */ -function newNameEntryComponent(i) { - removeParserButton(i); - var nextid = 1; - if ($('#nameEntry_component_next_j_'+i).exists()) { - nextid = parseInt($('#nameEntry_component_next_j_'+i).text()); - } - console.log("Creating new name entry component for nameEntry " + i + " with id: " + nextid); - - // add parser btn if entity is person, and if no btn or other name components already exist - if (($("#entityType").val() === "700") && (nextid == 0) && - (!$("#nameEntry_panel_" + i).find('.name-parser').length && - $("#nameEntry_component_1_panel_" + i).length === 0)) { - $('#nameEntry_component_add_' + i).after(''); - } - - setEditedFlag(true); - //somethingHasBeenEdited = true; - - var text = $('#component_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); - $('#nameEntry_component_add_div_'+i).before(html); - - $('#nameEntry_component_' + nextid + '_operation_' + 1).val("insert"); - subMakeEditable("nameEntry_component_" + nextid, i); - - vocab_select_replace($("#nameEntry_component_"+nextid+"_type_id_"+i), "_"+i, 'name_component', 0); - - // Put the updated version number back in the DOM - $('#nameEntry_component_next_j_'+i).text(++nextid); - - return false; -} - -function updateNameEntryHeading(i) { - var text = ""; - var components = []; - - $("#nameEntry_panel_"+i+" div[id^='nameEntry_component_']").each(function() { - var obj = $(this); - if (!obj.hasClass("deleted-component") && obj.attr('id').endsWith("_panel_" + i) - && !obj.attr('id').endsWith("ZZ")) { - var j = obj.attr('id').replace("nameEntry_component_", "").replace("_panel_"+i, ""); - var type = $("#nameEntry_component_"+j+"_type_id_"+i+" option:selected").text(); - var partText = $("#nameEntry_component_"+j+"_text_"+i).val(); - - components.push([type, partText]); - } - }); - - var entityType = $("#entityType option:selected").text(); - text = combineNameHeading(components, entityType); - - - $("#nameEntry_heading_"+i).text(text.trim()); - $("#nameEntry_original_"+i).val(text.trim()); -} - - -/** - * Create a new Name Entry Rules object on page - * - * Puts a new Name Entry rule object DIV on the page and attaches it correctly to the DOM and javascript. - * - * @param int i The index on the page of the nameEntry to add this rule to - * @return boolean false to play nice with the browser. - */ -function newNameEntryRule(i) { - var nextid = 1; - if ($('#nameEntry_rule_next_j_'+i).exists()) { - nextid = parseInt($('#nameEntry_rule_next_j_'+i).text()); - } - console.log("Creating new name entry rule for nameEntry " + i + " with id: " + nextid); - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#rule_template').clone(); - var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); - $('#nameEntry_rule_add_div_'+i).before(html); - - $('#nameEntry_rule_' + nextid + '_operation_' + 1).val("insert"); - turnOnTooltips("nameEntry_rule_" + nextid, i); - subMakeEditable("nameEntry_rule_" + nextid, i); - - // Put the updated version number back in the DOM - $('#nameEntry_rule_next_j_'+i).text(++nextid); - - return false; -} - -/** - * Parse a date string into parts - */ -function parseDate(dateString) { - var pieces = dateString.split("-"); - if (pieces.length == 3) - return { - year : parseInt(pieces[0]), - month : parseInt(pieces[1]), - day : parseInt(pieces[2]) - }; - else if (pieces.length == 2) - return { - year : parseInt(pieces[0]), - month : parseInt(pieces[1]), - day : '' - }; - else if (pieces.length == 1 && pieces[0] != '') - return { - year : parseInt(pieces[0]), - month : '', - day : '' - }; - else return { - year : '', month : '', day : '' - } -} - -/** - * Change date input divs to select and boxes - * - * Changes all div's with id "date_" for a given data object (shortName, idStr) from a list of - * inputs defining the parameters (view mode) to a inputs and a select (edit mode). It then - * calls the select2 function to replace the select with one matching the rest of the page. - * - * Note: idStr must not have the "_" pre-appended - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int idStr The index within the edit page of the object. - */ -function textToDate(shortName, idStr) { - $("div[id^='date_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - var dateStr = $("#"+shortName+"_"+name+"_"+idStr).val(); - - var dateParts = parseDate(dateStr); - - var html = ""; - html += " - "; - html += " "; - html += " - "; - html += " "; - html += ""; - cont.html(html); - - $("#"+shortName+"_"+name+"_month_"+idStr).select2({ - width: '57%', - allowClear: true, - theme: 'bootstrap', - placeholder: 'Month' - }); - - } - }); -} - -/** - * Pad an integer - * - * This is a helper function to pad an integer with 0s for display. This is useful to pad - * a month or day with a leading 0. - * - * @param int|string num The number to pad - * @param int size The total width of the desired output - * @return string A string containing a size-wide integer representation, 0-padded - */ -function pad(num, size) { - var s = num+""; - while (s.length < size) s = "0" + s; - return s; -} - -/** - * Updates the standard date input field - * - * If the date for the data object (shortName, idStr) has been turned into a 3-field edit - * area, then this function will update the hidden standard date (YYYY-MM-DD) field with the - * newest values from the human-enterable field. - * - * Note: idStr must not have the "_" pre-appended - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int idStr The index within the edit page of the object. - */ -function updateDate(shortName, idStr) { - $("div[id^='date_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - - if ($("#"+shortName+"_"+name+"_year_"+idStr).exists()) { - var year = $("#"+shortName+"_"+name+"_year_"+idStr).val(); - var day = $("#"+shortName+"_"+name+"_day_"+idStr).val(); - var month = $("#"+shortName+"_"+name+"_month_"+idStr+ " option:selected").val(); - - var dateStr = ""; - if (year != "") { - dateStr += pad(year, 4); - if (month != "") { - dateStr += "-" + pad(month,2); - if (day != "") { - dateStr += "-" + pad(day,2); - } - } - } - - $("#"+shortName+"_"+name+"_"+idStr).val(dateStr); - } - - } - }); -} - -/** - * Return editable date area back to text - * - * If the date for the data object (shortName, idStr) has been turned into a 3-field edit - * area, then this function will return the editable area back to the view mode text, replacing - * the edit boxes with a paragraph containing the computed standard date string (YYYY-MM-DD). - * - * Note: idStr must not have the "_" pre-appended - * - * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" - * @param string|int idStr The index within the edit page of the object. - */ -function dateToText(shortName, idStr) { - $("div[id^='date_"+shortName+"']").each(function() { - var cont = $(this); - if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { - // remove the short name and "select_" from the string we're parsing - var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); - // remove the idstr to receive the name of this element - var regex = new RegExp("\_"+idStr+"$", "g"); - var name = divStr.replace(regex, ""); - - updateDate(shortName, idStr); - - - var dateStr = $("#"+shortName+"_"+name+"_"+idStr).val(); - - var html = "

"+dateStr+"

"; - html += ""; - cont.html(html); - - } - }); -} - - -// TODO: If we want to show a DIV of edited and deleted components, we should use the following two functions -// to get copies of the edited/deleted components from the page. We can then insert those copies onto a modal -// dialog box with a "Save" or "Continue" button at the top and bottom. -// -// All the pieces shown in the dialog should be disabled. One way to do this would be using the following -// method to place a semi-transparent div on top of the editable pieces, making them appear to be grayed out -// and with the not permitted cursor. -// -// .append('
'); -// -// Note: this modal should NOT be inside the constellation form so that we don't submit the values twice. - -/** - * Get all the edited components - */ -function getEdited() { - var html = ""; - - $("#constellation_form div.edited-component").each(function() { - var cont = $(this); - console.log(cont.attr('id')); - var pieces = cont.attr('id').split("_panel_"); - if (pieces.length == 2) { - html += "
" + $("#"+pieces[0] + "_datapart_" + pieces[1]).html() + "
"; - } - }); - - return html; -} - -/** - * Get all the deleted components - */ -function getDeleted() { - var html = ""; - - $("#constellation_form div.deleted-component").each(function() { - var cont = $(this); - console.log(cont.attr('id')); - var pieces = cont.attr('id').split("_panel_"); - if (pieces.length == 2) { - html += "
" + $("#"+pieces[0] + "_datapart_" + pieces[1]).html() + "
"; - } - }); - - return html; -} - -function turnOnEditDeleteButtons(part='') { - var divID = ''; - if (part != '') - divID = "#" + part + " "; - // Turn on the edit buttons - $(divID + "a[id*='editbutton']").each(function() { - var obj = $(this); - var pieces = obj.attr('id').split("_"); - - if (pieces.length == 3) { - var short = pieces[0]; - var i = pieces[2]; - obj.on("click", function() { - makeEditable(short, i); - }); - } else if (pieces.length == 5 && pieces[0] == "scm") { - var short = pieces[1]; - var i = pieces[4]; - var j = pieces[3]; - obj.on("click", function() { - makeSCMEditable(short, i, j); - }); - } else if (pieces.length == 5) { - var short = pieces[0] + "_" + pieces[1] + "_" + pieces[2]; - var i = pieces[4]; - obj.on("click", function() { - makeEditable(short, i); - }); - } - }); - - // Turn on the delete buttons - $(divID + "a[id*='deletebutton']").each(function() { - var obj = $(this); - var pieces = obj.attr('id').split("_"); - - if (pieces.length == 3) { - var short = pieces[0]; - var i = pieces[2]; - obj.on("click", function() { - setDeleted(short, i); - }); - } else if (pieces.length == 5 && pieces[0] == "scm") { - var short = pieces[1]; - var i = pieces[4]; - var j = pieces[3]; - obj.on("click", function() { - setSCMDeleted(short, i, j); - }); - } else if (pieces.length == 5) { - var short = pieces[0] + "_" + pieces[1] + "_" + pieces[2]; - var i = pieces[4]; - obj.on("click", function() { - setDeleted(short, i); - }); - } - }); -} - -function turnOnTooltipsForTab(part='') { - var divID = ''; - if (part != '') - divID = "#" + part + " "; - // Load tooltips - $(function () { - $(divID + '[data-toggle="tooltip"]').tooltip() - }) - - // Load popovers - $(function () { - $(divID + '[data-toggle="popover"]').popover({ - trigger: 'hover', - container: 'body' - }) - }) - -} - -function updatePictureArrow(shortName, i, newValue) { - $('#'+shortName+'_relationPictureArrow_'+i).text(newValue); -} - -function updatePictureTitle(shortName, i, newValue) { - $('#'+shortName+'_relationPictureTitle_'+i).text(newValue); -} - -function updatePictureIcon(shortName, i, entityType) { - var html = ""; - if (entityType == 'person') - html = '
'; - else if (entityType == 'corporateBody') - html = '
'; - else if (entityType == 'family') - html = '
'; - $('#'+shortName+'_relationPictureIcon_'+i).html(html); -} - - -var geoPlaceLoadResults = null; - -function loadGeoPlaceResultCache() { - $("input[id^='place_geoplace_id_']").each(function() { - var obj = $(this); - // Query for term by ajax - if (obj.val() != null && obj.val() != "") { - $.get(snacUrl+"/vocabulary/read?type=geoPlace&id="+obj.val(), null, function (data) { - // Check the return value from the ajax. If success, then go to dashboard - if (data.term) { - if (!geoPlaceLoadResults) - geoPlaceLoadResults = new Array(); - geoPlaceLoadResults.push(data.term); - } - }); - } - }); -} - -function chooseSuggestedGeoPlace(selectID, idStr, value) { - // idStr == id number on the page - var obj = $("#"+selectID); - obj.select2('destroy'); - obj.val(value); - geovocab_select_replace(obj, "_"+idStr); - updatePlaceHeading("place", idStr, value); -} - -function updatePlaceHeading(shortName, i, newValue) { - var place = null; - if (!geoPlaceSearchResults && !geoPlaceLoadResults) { - $('#'+shortName+'_confirmed_'+i).val("false"); - $('#'+shortName+'_geoterm_text_'+i).html("Unconfirmed"); - $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); - $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); - if ($('#'+shortName+'_original_'+i).val() != "") - $('#'+shortName+'_geoterm_caption_'+i).text("Recorded as: " + $('#'+shortName+'_original_'+i).val()); - else - $('#'+shortName+'_geoterm_caption_'+i).text(); - return; - } - - if (geoPlaceSearchResults) { - geoPlaceSearchResults.forEach(function(result) { - if (result.id == newValue) - place = result; - }); - } - - if (!place && geoPlaceLoadResults) { - geoPlaceLoadResults.forEach(function(result) { - if (result.id == newValue) - place = result; - }); - } - - if (!place) { - $('#'+shortName+'_confirmed_'+i).val("false"); - $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); - $('#'+shortName+"_geoterm_maplink_"+i).off("click"); - if ($('#'+shortName+'_original_'+i).val() != "") { - $('#'+shortName+'_geoterm_text_'+i).html("Unconfirmed"); - $('#'+shortName+'_geoterm_caption_'+i).text("Recorded as: " + $('#'+shortName+'_original_'+i).val()); - } else { - $('#'+shortName+'_geoterm_text_'+i).text("--"); - $('#'+shortName+'_geoterm_caption_'+i).text("GeoPlace term not specified"); - } - return; - } - $('#'+shortName+'_confirmed_'+i).val("true"); - $('#'+shortName+'_geoterm_text_'+i).text(place.name); - $('#'+shortName+'_geoterm_caption_'+i).text(place.administrationCode + ", " + place.countryCode); - if (place.latitude && place.longitude) { - $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); - $('#'+shortName+"_geoterm_maplink_"+i).on("click", function() {openGeoPlaceViewer(place.id); return false;}); - $('#'+shortName+"_geoterm_maplink_"+i).removeClass("disabled"); - } else { - $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); - $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); - } - - -} - -function magicDefaultFill(selectID, vocabType) { - if (typeof(defaults[vocabType]) !== undefined) { - - var data = { - id: defaults[vocabType].id, - text: defaults[vocabType].term - }; - - // If the selected item exists, then select it. Else, add a new option - // and select it. - if ($('#'+selectID).find("option[value='" + data.id + "']").length) { - $('#'+selectID).val(data.id).trigger('change'); - } else { - var newOption = new Option(data.text, data.id, false, true); - $('#'+selectID).append(newOption).trigger('change'); - } - } - -} - -function capitalize(word) { - return word[0].toUpperCase() + word.slice(1); -} - -function parseName(e) { - $('#name-parser-options').text(''); - var $nameComponents = $(e.target).closest('.name-components'); - - var $partType = $nameComponents.find("select:last"); - var $textbox = $nameComponents.find('input[type="text"]:last'); - - var name = $textbox.val(); - - var entityType = $('#entityType').text().trim(); - $('#name-parser-type').text(capitalize(entityType)); - $('#name-parser-original').text(name); - - var parser = new NameParser(); - guesses = parser.guessPerson(name); - - var parsedOption = ''; - - var counter = 0; - guesses.forEach(function(guess) { - // attach name data object to radio - for (var key in guess) { - if (guess[key] && guess[key].length != 0) { - parsedOption += "
  • " + key + ": " + guess[key] + "
  • "; - } - } - - $('#name-parser-options').append("
    " + - "
    "); - - - $('#name-parser-options').find("input[type='radio']:last").data("parsed-name", guess); - - parsedOption = ''; - counter++; - }) - - $('#name-parser-options').find("input[type='radio']:first").prop('checked', true) - - - $('#parser-accept-btn').unbind('click') - $('#parser-accept-btn').on('click', function() { - var selectedName = $('#name-parser input[type="radio"]:checked').data('parsed-name') - $.get( snacUrl + "/vocabulary/?type=name_component&entity_type=700") - .done(function(data) { - acceptParsedName(selectedName, $nameComponents, name, data.results) - }) - }) -} - -function acceptParsedName(selectedName, $nameComponents, name, nameComponentIDs) { - var i = $nameComponents.attr('id').split('_')[2]; - var $nameComponent = $nameComponents.find('.reorderable'); /// - $nameComponent.replaceWith('
    Name: ' + name + '
    '); - - var nameComponentMap = {}; - - for (var k = 0; k < nameComponentIDs.length; k++) { - nameComponentMap[nameComponentIDs[k].text] = nameComponentIDs[k].id - } - // var nameComponentMap = { - // 'Surname': 400223, - // 'Forename': 400224, - // 'NameAddition': 400236, - // 'Date': 400237, - // 'NameExpansion': 400226, - // 'Numeration': 400225 - // }; - - for (var key in selectedName) { - if (key == 'NameAdditions') { - key = 'NameAddition'; - for (var j = 0; j < selectedName['NameAdditions'].length; j++) { - newNameEntryComponent(i); - var option = new Option(key, nameComponentMap[key], false, true); - $partType = $nameComponents.find("select:last"); - $partType.append(option).trigger('change'); - $textbox = $nameComponents.find("input[type='text']:last"); - $textbox.val(selectedName["NameAdditions"][j]); - - $partType.append(option).trigger('change'); - } - } else if (selectedName[key] && nameComponentMap[key]) { - newNameEntryComponent(i); - var option = new Option(key, nameComponentMap[key], false, true); - $partType = $nameComponents.find("select:last"); - $partType.append(option).trigger('change'); - $textbox = $nameComponents.find("input[type='text']:last"); - $textbox.val(selectedName[key]); - - $partType.append(option).trigger('change'); - } - } - - $("#nameEntry_datapart_" + i).find(".name-parser").remove(); - updateNameEntryHeading(i); -} - -function removeParserButton(i) { - $('#nameEntry_datapart_' + i).find('.name-parser').remove(); -} - -/** - * Things to do when the page finishes loading - */ -$(document).ready(function() { - // Load the place cache, if needed - loadGeoPlaceResultCache(); - - // listen for name-parsing - $('#nameEntries').on('click', '.name-parser', function(event) { - event.preventDefault(); - parseName(event); - $("#name-parser").modal('toggle'); - }); - - $('#name-parser').on('shown.bs.modal', function () { - $('#parser-accept-btn').focus(); - }) - - // If the constellation is in "insert" mode, then we should automatically set "somethingHasBeenEdited" - // to be true... - if ($('#operation').val() == 'insert') - setEditedFlag(true); - //somethingHasBeenEdited = true; - - turnOnEditDeleteButtons(); - - // Attach functions to the entityType select - if ($('#entityType').exists()) { - $('#entityType').change(function() { - setEditedFlag(true); - //somethingHasBeenEdited = true; - // If there is an ID, then we need to set this to update - // Else, the main-level operation should be and remain insert - if ($('#constellationid').val() != null && - $('#constellationid').val() != "") { - $('#operation').val("update"); - } - }); - } - - // Name Entry doesn't get any AJAX, since it is pre-loaded - var nameEntryid = 1; - if ($('#next_nameEntry_i').exists()) { - nameEntryid = parseInt($('#next_nameEntry_i').text()); - } - console.log("Next NameEntry ID: " + nameEntryid); - if ($('#btn_add_nameEntry').exists()){ - $('#btn_add_nameEntry').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#nameEntry_template').clone(); - var html = text.html().replace(/ZZ/g, nameEntryid); - $('#add_nameEntry_div').after(html); - turnOnButtons("nameEntry", nameEntryid); - turnOnTooltips("nameEntry", nameEntryid); - makeEditable("nameEntry", nameEntryid); - nameEntryid = nameEntryid + 1; - return false; - }); - } - - - // Attach functions to each of the "+ Add New _______" buttons - - // Code to handle adding new genders to the page - var genderid = 1; - var genderOpen = false; - if ($('#genderstab').exists()){ - $('#genderstab').click(function(){ - // Don't open a second time - if (genderOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=genders", null, function (data) { - genderOpen = true; - $('#genders').html(data); - - turnOnEditDeleteButtons("genders"); - - if ($('#next_gender_i').exists()) { - genderid = parseInt($('#next_gender_i').text()); - } - console.log("Next Gender ID: " + genderid); - if ($('#btn_add_gender').exists()){ - $('#btn_add_gender').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#gender_template').clone(); - var html = text.html().replace(/ZZ/g, genderid); - $('#add_gender_div').after(html); - turnOnButtons("gender", genderid); - turnOnTooltips("gender", genderid); - makeEditable("gender", genderid); - genderid = genderid + 1; - return false; - }); - } - - turnOnTooltipsForTab("genders"); - }); - }); - } - - // Code to handle adding new genders to the page - var existid = 1; - var existOpen = false; - if ($('#existstab').exists()){ - $('#existstab').click(function(){ - // Don't open a second time - if (existOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=dates", null, function (data) { - existOpen = true; - $('#dates').html(data); - - turnOnEditDeleteButtons("dates"); - - if ($('#next_exist_i').exists()) { - existid = parseInt($('#next_exist_i').text()); - } - console.log("Next Exist Date ID: " + existid); - if ($('#btn_add_exist_date').exists()){ - $('#btn_add_exist_date').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#exist_date_template').clone(); - var html = text.html().replace(/ZZ/g, existid); - $('#add_exist_div').after(html); - turnOnButtons("exist", existid); - turnOnTooltips("exist", existid); - makeEditable("exist", existid); - existid = existid + 1; - return false; - }); - } - if ($('#btn_add_exist_dateRange').exists()){ - $('#btn_add_exist_dateRange').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#exist_dateRange_template').clone(); - var html = text.html().replace(/ZZ/g, existid); - $('#add_exist_div').after(html); - turnOnButtons("exist", existid); - turnOnTooltips("exist", existid); - makeEditable("exist", existid); - existid = existid + 1; - return false; - }); - } - - turnOnTooltipsForTab("dates"); - }); - }); - } - - var sameAsid = 1; - var sameAsOpen = false; - if ($('#sameAstab').exists()){ - $('#sameAstab').click(function(){ - // Don't open a second time - if (sameAsOpen) - return; - //set sameAs vocab type id - $.get(snacUrl+"/vocabulary?type=record_type&q=SameAs", null, function(data) { - sameAsTermId = data.results[0].id; - $("#sameAs_type_id_ZZ").val(sameAsTermId); - }); - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=sameAs", null, function (data) { - sameAsOpen = true; - $('#sameAs').html(data); - - turnOnEditDeleteButtons("sameAs"); - - if ($('#next_sameAs_i').exists()) { - sameAsid = parseInt($('#next_sameAs_i').text()); - } - console.log("Next sameAs ID: " + sameAsid); - if ($('#btn_add_sameAs').exists()){ - $('#btn_add_sameAs').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#sameAs_template').clone(); - var html = text.html().replace(/ZZ/g, sameAsid); - $('#add_sameAs_div').after(html); - turnOnButtons("sameAs", sameAsid); - turnOnTooltips("sameAs", sameAsid); - makeEditable("sameAs", sameAsid); - sameAsid = sameAsid + 1; - return false; - }); - } - - turnOnTooltipsForTab("sameAs"); - }); - }); - } - - - var entityIDid = 1; - var entityIDOpen = false; - if ($('#entityIDtab').exists()){ - $('#entityIDtab').click(function(){ - // Don't open a second time - if (entityIDOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=entityID", null, function (data) { - entityIDOpen = true; - $('#entityID').html(data); - - turnOnEditDeleteButtons("entityID"); - - if ($('#next_entityID_i').exists()) { - entityIDid = parseInt($('#next_entityID_i').text()); - } - console.log("Next entityID ID: " + entityIDid); - if ($('#btn_add_entityID').exists()){ - $('#btn_add_entityID').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#entityID_template').clone(); - var html = text.html().replace(/ZZ/g, entityIDid); - $('#add_entityID_div').after(html); - turnOnButtons("entityID", entityIDid); - turnOnTooltips("entityID", entityIDid); - makeEditable("entityID", entityIDid); - entityIDid = entityIDid + 1; - return false; - }); - } - - turnOnTooltipsForTab("entityID"); - }); - }); - } - - var sourceid = 1; - var sourceOpen = false; - if ($('#sourcestab').exists()){ - $('#sourcestab').click(function(){ - // Don't open a second time - if (sourceOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=sources", null, function (data) { - sourceOpen = true; - $('#sources').html(data); - - turnOnEditDeleteButtons("sources"); - - if ($('#next_source_i').exists()) { - sourceid = parseInt($('#next_source_i').text()); - } - console.log("Next source ID: " + sourceid); - if ($('#btn_add_source').exists()){ - $('#btn_add_source').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#source_template').clone(); - var html = text.html().replace(/ZZ/g, sourceid); - $('#add_source_div').after(html); - turnOnButtons("source", sourceid); - turnOnTooltips("source", sourceid); - makeEditable("source", sourceid); - sourceid = sourceid + 1; - return false; - }); - } - - turnOnTooltipsForTab("sources"); - }); - }); - } - - var resourceRelationid = 1; - var resourceRelationOpen = false; - if ($('#resourceRelationstab').exists()){ - $('#resourceRelationstab').click(function(){ - // Don't open a second time - if (resourceRelationOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=resourceRelations", null, function (data) { - resourceRelationOpen = true; - $('#resourceRelations').html(data); - - turnOnEditDeleteButtons("resourceRelations"); - - if ($('#next_resourceRelation_i').exists()) { - resourceRelationid = parseInt($('#next_resourceRelation_i').text()); - } - console.log("Next resourceRelation ID: " + resourceRelationid); - if ($('#btn_create_resourceRelation').exists()){ - $('#btn_create_resourceRelation').click(function(){ - var rid = $('input[name=resourceChoice]:checked', '#resource_search_form').val(); - if (rid != null && resourceResults != null && rid != 'new') { - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#resourceRelation_template').clone(); - var html = text.html().replace(/ZZ/g, resourceRelationid); - $('#add_resourceRelation_div').after(html); - - if (typeof resourceResults[rid].id !== 'undefined') - $('#resourceRelation_resourceid_'+resourceRelationid).val(resourceResults[rid].id); - if (typeof resourceResults[rid].version !== 'undefined') - $('#resourceRelation_resourceversion_'+resourceRelationid).val(resourceResults[rid].version); - - if (typeof resourceResults[rid].link !== 'undefined') - $('#resourceRelation_linkText_'+resourceRelationid).html(""+resourceResults[rid].link+"" + - " View"); - if (typeof resourceResults[rid].displayEntry !== 'undefined') - $('#resourceRelation_displayEntryText_'+resourceRelationid).text(resourceResults[rid].displayEntry); - if (typeof resourceResults[rid].title !== 'undefined') { - $('#resourceRelation_titleText_'+resourceRelationid).text(resourceResults[rid].title); - updatePictureTitle('resourceRelation', resourceRelationid, resourceResults[rid].title); - } - if (typeof resourceResults[rid].abstract !== 'undefined') - $('#resourceRelation_abstractText_'+resourceRelationid).text(resourceResults[rid].abstract); - if (typeof resourceResults[rid].extent !== 'undefined') - $('#resourceRelation_extentText_'+resourceRelationid).text(resourceResults[rid].extent); - // if (typeof resourceResults[rid].date !== 'undefined') - // $('#resourceRelation_dateText_'+resourceRelationid).text(resourceResults[rid].date); - if (typeof resourceResults[rid].documentType !== 'undefined' && typeof resourceResults[rid].documentType.term !== 'undefined') - $('#resourceRelation_documentTypeText_'+resourceRelationid).text(resourceResults[rid].documentType.term); - - $('#resourceRelation_linkText_'+resourceRelationid).after("View in SNAC"); - turnOnButtons("resourceRelation", resourceRelationid); - turnOnTooltips("resourceRelation", resourceRelationid); - makeEditable("resourceRelation", resourceRelationid); - resourceRelationid = resourceRelationid + 1; - $("#resource-results-box").html(""); - return true; - } - return false; - }); - } - - if ($('#btn_open_create_resource').exists()){ - $('#btn_open_create_resource').click(function(){ - // Close this modal and open the new modal - $("#resourceSearchPane").modal("hide"); - - // Set a 500ms timeout to give the hidden search pane time to fully close - setTimeout(function() {$("#resourceCreatePane").modal("show");}, 500); - - // Grab the empty template and replace - var text = $('#resource_template').clone(); - var html = text.html().replace(/ZZ/g, 0); - $('#resource-create-box').html(html); - var $resourceForm = $("#resource_create_form"); - // Copy the search contents to title or href - if ($("#resource-searchbox").val().indexOf("http") == -1) - $resourceForm.find("#resource-title").val($("#resource-searchbox").val()); - else - $resourceForm.find("#resource-url").val($("#resource-searchbox").val()); - - $resourceForm.find('[data-toggle="popover"]').popover({ - trigger: 'hover', - container: 'body' - }); - loadVocabSelectOptions($resourceForm.find("#resource-type-select"), "document_type", "Resource Type"); - vocab_select_replace($resourceForm.find("#resource-repo"), "", "holding", 3); - $resourceForm.find("#new-resource-language-btn").on("click", newResourceLanguage); - $resourceForm.find("#magic-resource-language-btn").on("click", magicNewResourceLanguage); - - $('#search-results-box').on("click", "a.list-group-item", selectHoldingRepository); - var timeoutID = null; - $resourceForm.find('#searchbox').keyup(function() { - clearTimeout(timeoutID); - timeoutID = setTimeout(function() { setSearchPosition(0); searchAndUpdate(); }, 500); - }); - - // Remove the search results from the other modal - $("#resource-results-box").html(""); - return false; - }); - } - - if ($('#btn_create_resource').exists()){ - $('#resource_create_form').on("submit", function(){ - // Remove leading and trailing whitespace - if ($("#resource_create_form #resource-url").val() == "") { - if (!confirm('Are you sure you want to save without an HREF?')) { - return; - } - } - $("#resource_create_form input, textarea").each(function() { - $(this).val($.trim($(this).val())); - }); - setDeletedResourceLanguageOperations($("#resource_create_form")); - - $.post(snacUrl+"/save_resource", $("#resource_create_form").serialize(), function (data) { - if (typeof data.result !== 'undefined' && data.result !== 'false') { - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#resourceRelation_template').clone(); - var html = text.html().replace(/ZZ/g, resourceRelationid); // clones DOM, replaces zz with next ids - $('#add_resourceRelation_div').after(html); - - if (typeof data.resource.id !== 'undefined') - $('#resourceRelation_resourceid_'+resourceRelationid).val(data.resource.id); - if (typeof data.resource.version !== 'undefined') - $('#resourceRelation_resourceversion_'+resourceRelationid).val(data.resource.version); - - if (typeof data.resource.link !== 'undefined') - $('#resourceRelation_linkText_'+resourceRelationid).html(""+data.resource.link+"" + - " View"); - if (typeof data.resource.displayEntry !== 'undefined') - $('#resourceRelation_displayEntryText_'+resourceRelationid).text(data.resource.displayEntry); - if (typeof data.resource.title !== 'undefined') { - $('#resourceRelation_titleText_'+resourceRelationid).text(data.resource.title); - updatePictureTitle('resourceRelation', resourceRelationid, data.resource.title); - } - if (typeof data.resource.abstract !== 'undefined') - $('#resourceRelation_abstractText_'+resourceRelationid).text(data.resource.abstract); - if (typeof data.resource.extent !== 'undefined') - $('#resourceRelation_extentText_'+resourceRelationid).text(data.resource.extent); - if (typeof data.resource.documentType !== 'undefined' && typeof data.resource.documentType.term !== 'undefined') - $('#resourceRelation_documentTypeText_'+resourceRelationid).text(data.resource.documentType.term); - - $('#resourceRelation_linkText_'+resourceRelationid).after("View in SNAC"); - turnOnButtons("resourceRelation", resourceRelationid); - turnOnTooltips("resourceRelation", resourceRelationid); - makeEditable("resourceRelation", resourceRelationid); - resourceRelationid = resourceRelationid + 1; - $("#resourceCreatePane").modal("hide"); - $('#resource-create-box').html(""); - return true; - } else { - console.log(data); - return false; - } - }); - return false; - }); - } - - turnOnTooltipsForTab("resourceRelations"); - }); - }); - } - - - var constellationRelationid = 1; - var constellationRelationOpen = false; - if ($('#constellationRelationstab').exists()){ - $('#constellationRelationstab').click(function(){ - // Don't open a second time - if (constellationRelationOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=constellationRelations", null, function (data) { - constellationRelationOpen = true; - $('#constellationRelations').html(data); - - turnOnEditDeleteButtons("constellationRelations"); - - if ($('#next_constellationRelation_i').exists()) { - constellationRelationid = parseInt($('#next_constellationRelation_i').text()); - } - console.log("Next constellationRelation ID: " + constellationRelationid); - if ($('#btn_create_constellationRelation').exists()){ - $('#btn_create_constellationRelation').click(function(){ - var cid = $('input[name=relationChoice]:checked', '#relation_search_form').val() - if (cid != null) { - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#constellationRelation_template').clone(); - var html = text.html().replace(/ZZ/g, constellationRelationid); - $('#add_constellationRelation_div').after(html); - $('#constellationRelation_targetID_'+constellationRelationid).val(cid); - $('#constellationRelation_content_'+constellationRelationid).val($('#relationChoice_nameEntry_'+cid).val()); - $('#constellationRelation_targetArkID_'+constellationRelationid).val($('#relationChoice_arkID_'+cid).val()); - $('#constellationRelation_targetEntityType_'+constellationRelationid).val($('#relationChoice_entityType_'+cid).val()); - - updatePictureIcon('constellationRelation', constellationRelationid, $('#relationChoice_entityTypeText_'+cid).val()); - updatePictureTitle('constellationRelation', constellationRelationid, $('#relationChoice_nameEntry_'+cid).val()); - - $('#constellationRelation_contentText_'+constellationRelationid).text($('#relationChoice_nameEntry_'+cid).val()); - $('#constellationRelation_targetArkIDText_'+constellationRelationid).text($('#relationChoice_arkID_'+cid).val()); - - turnOnButtons("constellationRelation", constellationRelationid); - turnOnTooltips("constellationRelation", constellationRelationid); - makeEditable("constellationRelation", constellationRelationid); - - constellationRelationid = constellationRelationid + 1; - - return true; - - } - - - return false; - }); - } - - turnOnTooltipsForTab("constellationRelations"); - }); - }); - } - - var languageid = 1; - var languageOpen = false; - if ($('#languagesUsedtab').exists()){ - $('#languagesUsedtab').click(function(){ - // Don't open a second time - if (languageOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=languagesUsed", null, function (data) { - languageOpen = true; - $('#languagesUsed').html(data); - - turnOnEditDeleteButtons("languagesUsed"); - - if ($('#next_language_i').exists()) { - languageid = parseInt($('#next_language_i').text()); - } - console.log("Next language ID: " + languageid); - if ($('#btn_add_language').exists()){ - $('#btn_add_language').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#language_template').clone(); - var html = text.html().replace(/ZZ/g, languageid); - $('#add_language_div').after(html); - turnOnButtons("language", languageid); - turnOnTooltips("language", languageid); - makeEditable("language", languageid); - languageid = languageid + 1; - return false; - }); - } - - turnOnTooltipsForTab("languagesUsed"); - }); - }); - } - - var subjectid = 1; - var subjectOpen = false; - if ($('#subjectstab').exists()){ - $('#subjectstab').click(function(){ - // Don't open a second time - if (subjectOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=subjects", null, function (data) { - subjectOpen = true; - $('#subjects').html(data); - - turnOnEditDeleteButtons("subjects"); - - if ($('#next_subject_i').exists()) { - subjectid = parseInt($('#next_subject_i').text()); - } - console.log("Next subject ID: " + subjectid); - if ($('#btn_add_subject').exists()){ - $('#btn_add_subject').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#subject_template').clone(); - var html = text.html().replace(/ZZ/g, subjectid); - $('#add_subject_div').after(html); - turnOnButtons("subject", subjectid); - turnOnTooltips("subject", subjectid); - makeEditable("subject", subjectid); - subjectid = subjectid + 1; - return false; - }); - } - - turnOnTooltipsForTab("subjects"); - }); - }); - } - - var nationalityid = 1; - var nationalityOpen = false; - if ($('#nationalitiestab').exists()){ - $('#nationalitiestab').click(function(){ - // Don't open a second time - if (nationalityOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=nationalities", null, function (data) { - nationalityOpen = true; - $('#nationalities').html(data); - - turnOnEditDeleteButtons("nationalities"); - - if ($('#next_nationality_i').exists()) { - nationalityid = parseInt($('#next_nationality_i').text()); - } - console.log("Next nationality ID: " + nationalityid); - if ($('#btn_add_nationality').exists()){ - $('#btn_add_nationality').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#nationality_template').clone(); - var html = text.html().replace(/ZZ/g, nationalityid); - $('#add_nationality_div').after(html); - turnOnButtons("nationality", nationalityid); - turnOnTooltips("nationality", nationalityid); - makeEditable("nationality", nationalityid); - nationalityid = nationalityid + 1; - return false; - }); - } - - turnOnTooltipsForTab("nationalities"); - }); - }); - } - - var functionid = 1; - var functionOpen = false; - if ($('#functionstab').exists()){ - $('#functionstab').click(function(){ - // Don't open a second time - if (functionOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=functions", null, function (data) { - functionOpen = true; - $('#functions').html(data); - - turnOnEditDeleteButtons("functions"); - - if ($('#next_function_i').exists()) { - functionid = parseInt($('#next_function_i').text()); - } - console.log("Next function ID: " + functionid); - if ($('#btn_add_function').exists()){ - $('#btn_add_function').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#function_template').clone(); - var html = text.html().replace(/ZZ/g, functionid); - $('#add_function_div').after(html); - turnOnButtons("function", functionid); - turnOnTooltips("function", functionid); - makeEditable("function", functionid); - functionid = functionid + 1; - return false; - }); - } - - turnOnTooltipsForTab("functions"); - }); - }); - } - - var occupationid = 1; - var occupationOpen = false; - if ($('#occupationstab').exists()){ - $('#occupationstab').click(function(){ - // Don't open a second time - if (occupationOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=occupations", null, function (data) { - occupationOpen = true; - $('#occupations').html(data); - - turnOnEditDeleteButtons("occupations"); - - if ($('#next_occupation_i').exists()) { - occupationid = parseInt($('#next_occupation_i').text()); - } - console.log("Next occupation ID: " + occupationid); - if ($('#btn_add_occupation').exists()){ - $('#btn_add_occupation').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#occupation_template').clone(); - var html = text.html().replace(/ZZ/g, occupationid); - $('#add_occupation_div').after(html); - turnOnButtons("occupation", occupationid); - turnOnTooltips("occupation", occupationid); - makeEditable("occupation", occupationid); - occupationid = occupationid + 1; - return false; - }); - } - - turnOnTooltipsForTab("occupations"); - }); - }); - } - - var legalStatusid = 1; - var legalStatusOpen = false; - if ($('#legalStatusestab').exists()){ - $('#legalStatusestab').click(function(){ - // Don't open a second time - if (legalStatusOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=legalStatuses", null, function (data) { - legalStatusOpen = true; - $('#legalStatuses').html(data); - - turnOnEditDeleteButtons("legalStatuses"); - - if ($('#next_legalStatus_i').exists()) { - legalStatusid = parseInt($('#next_legalStatus_i').text()); - } - console.log("Next legalStatus ID: " + legalStatusid); - if ($('#btn_add_legalStatus').exists()){ - $('#btn_add_legalStatus').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#legalStatus_template').clone(); - var html = text.html().replace(/ZZ/g, legalStatusid); - $('#add_legalStatus_div').after(html); - turnOnButtons("legalStatus", legalStatusid); - turnOnTooltips("legalStatus", legalStatusid); - makeEditable("legalStatus", legalStatusid); - legalStatusid = legalStatusid + 1; - return false; - }); - } - - turnOnTooltipsForTab("legalStatuses"); - }); - }); - } - - var placeid = 1; - var placeOpen = false; - if ($('#placestab').exists()){ - $('#placestab').click(function(){ - // Don't open a second time - if (placeOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=places", null, function (data) { - placeOpen = true; - $('#places').html(data); - - // Load the place cache, if needed - loadGeoPlaceResultCache(); - - turnOnEditDeleteButtons("places"); - - if ($('#next_place_i').exists()) { - placeid = parseInt($('#next_place_i').text()); - } - console.log("Next place ID: " + placeid); - if ($('#btn_add_place').exists()){ - $('#btn_add_place').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#place_template').clone(); - var html = text.html().replace(/ZZ/g, placeid); - $('#add_place_div').after(html); - turnOnButtons("place", placeid); - turnOnTooltips("place", placeid); - makeEditable("place", placeid); - placeid = placeid + 1; - return false; - }); - } - - turnOnTooltipsForTab("places"); - }); - }); - } - - var conventionDeclarationid = 1; - var conventionDeclarationOpen = false; - if ($('#conventionDeclarationstab').exists()){ - $('#conventionDeclarationstab').click(function(){ - // Don't open a second time - if (conventionDeclarationOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=conventionDeclarations", null, function (data) { - conventionDeclarationOpen = true; - $('#conventionDeclarations').html(data); - - turnOnEditDeleteButtons("conventionDeclarations"); - - if ($('#next_conventionDeclaration_i').exists()) { - conventionDeclarationid = parseInt($('#next_conventionDeclaration_i').text()); - } - console.log("Next conventionDeclaration ID: " + conventionDeclarationid); - if ($('#btn_add_conventionDeclaration').exists()){ - $('#btn_add_conventionDeclaration').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#conventionDeclaration_template').clone(); - var html = text.html().replace(/ZZ/g, conventionDeclarationid); - $('#add_conventionDeclaration_div').after(html); - turnOnButtons("conventionDeclaration", conventionDeclarationid); - turnOnTooltips("conventionDeclaration", conventionDeclarationid); - makeEditable("conventionDeclaration", conventionDeclarationid); - conventionDeclarationid = conventionDeclarationid + 1; - return false; - }); - } - - turnOnTooltipsForTab("conventionDeclarations"); - }); - }); - } - - var generalContextid = 1; - var generalContextOpen = false; - if ($('#generalContextstab').exists()){ - $('#generalContextstab').click(function(){ - // Don't open a second time - if (generalContextOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=generalContexts", null, function (data) { - generalContextOpen = true; - $('#generalContexts').html(data); - - turnOnEditDeleteButtons("generalContexts"); - - if ($('#next_generalContext_i').exists()) { - generalContextid = parseInt($('#next_generalContext_i').text()); - } - console.log("Next generalContext ID: " + generalContextid); - if ($('#btn_add_generalContext').exists()){ - $('#btn_add_generalContext').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#generalContext_template').clone(); - var html = text.html().replace(/ZZ/g, generalContextid); - $('#add_generalContext_div').after(html); - turnOnButtons("generalContext", generalContextid); - turnOnTooltips("generalContext", generalContextid); - makeEditable("generalContext", generalContextid); - generalContextid = generalContextid + 1; - return false; - }); - } - - turnOnTooltipsForTab("generalContexts"); - }); - }); - } - - var structureOrGenealogyid = 1; - var structureOrGenealogyOpen = false; - if ($('#structureOrGenealogiestab').exists()){ - $('#structureOrGenealogiestab').click(function(){ - // Don't open a second time - if (structureOrGenealogyOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=structureOrGenealogies", null, function (data) { - structureOrGenealogyOpen = true; - $('#structureOrGenealogies').html(data); - - turnOnEditDeleteButtons("structureOrGenealogies"); - - if ($('#next_structureOrGenealogy_i').exists()) { - structureOrGenealogyid = parseInt($('#next_structureOrGenealogy_i').text()); - } - console.log("Next structureOrGenealogy ID: " + structureOrGenealogyid); - if ($('#btn_add_structureOrGenealogy').exists()){ - $('#btn_add_structureOrGenealogy').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#structureOrGenealogy_template').clone(); - var html = text.html().replace(/ZZ/g, structureOrGenealogyid); - $('#add_structureOrGenealogy_div').after(html); - turnOnButtons("structureOrGenealogy", structureOrGenealogyid); - turnOnTooltips("structureOrGenealogy", structureOrGenealogyid); - makeEditable("structureOrGenealogy", structureOrGenealogyid); - structureOrGenealogyid = structureOrGenealogyid + 1; - return false; - }); - } - - turnOnTooltipsForTab("structureOrGenealogies"); - }); - }); - } - - var mandateid = 1; - var mandateOpen = false; - if ($('#mandatestab').exists()){ - $('#mandatestab').click(function(){ - // Don't open a second time - if (mandateOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=mandates", null, function (data) { - mandateOpen = true; - $('#mandates').html(data); - - turnOnEditDeleteButtons("mandates"); - - if ($('#next_mandate_i').exists()) { - mandateid = parseInt($('#next_mandate_i').text()); - } - console.log("Next mandate ID: " + mandateid); - if ($('#btn_add_mandate').exists()){ - $('#btn_add_mandate').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#mandate_template').clone(); - var html = text.html().replace(/ZZ/g, mandateid); - $('#add_mandate_div').after(html); - turnOnButtons("mandate", mandateid); - turnOnTooltips("mandate", mandateid); - makeEditable("mandate", mandateid); - mandateid = mandateid + 1; - return false; - }); - } - - turnOnTooltipsForTab("mandates"); - }); - }); - } - - var biogHistid = 1; - var biogHistOpen = false; - if ($('#biogHiststab').exists()){ - $('#biogHiststab').click(function(){ - // Don't open a second time - if (biogHistOpen) - return; - - $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=biogHists", null, function (data) { - biogHistOpen = true; - $('#biogHists').html(data); - - turnOnEditDeleteButtons("biogHists"); - - if ($('#next_biogHist_i').exists()) { - biogHistid = parseInt($('#next_biogHist_i').text()); - } - console.log("Next biogHist ID: " + biogHistid); - if ($('#btn_add_biogHist').exists()){ - $('#btn_add_biogHist').click(function(){ - setEditedFlag(true); - //somethingHasBeenEdited = true; - var text = $('#biogHist_template').clone(); - var html = text.html().replace(/ZZ/g, biogHistid); - $('#add_biogHist_div').after(html); - turnOnButtons("biogHist", biogHistid); - turnOnTooltips("biogHist", biogHistid); - makeEditable("biogHist", biogHistid); - biogHistid = biogHistid + 1; - return false; - }); - } - - turnOnTooltipsForTab("biogHists"); - }); - }); - } - - turnOnTooltipsForTab(); - - - $("#info-dropdown").click(function(e) { - $(this).parent().toggleClass("open"); - e.stopPropagation(); - }); - -}); +var n=!1;function i(e){1==e?$("#save_and_continue").addClass("save-active"):$("#save_and_continue").removeClass("save-active"),n=e}var r=new Array,o={language:{id:130,term:"eng"},script:{id:586,term:"Latn"}};function l(e,t){var a="";a=void 0===e?"an unknown problem occurred":"string"==typeof e?e:e.message?e.message:e.type?e.type:"an unknown problem occurred",$("#error-message").html("

    Oops

    "+a+'

    Go to Dashboard

    '),setTimeout((function(){$("#error-message").slideDown()}),500),console.log(t)}function s(e,t){var a=parseInt($("#next_date_"+e+"_"+t+"_j").text());i(!0);var n=$("#sub_date_template").clone().html().replace(/ZZ/g,t).replace(/XX/g,a).replace(/SHORT/g,e);return $("#add_date_"+e+"_"+t+"_div").after(n),$("#next_date_"+e+"_"+t+"_j").text(a+1),k(e+"_date"+a,t),R(e+"_date_"+a,t),u(e+"_date_"+a,t),!1}function c(e,t){var a=parseInt($("#next_date_"+e+"_"+t+"_j").text());i(!0);var n=$("#sub_dateRange_template").clone().html().replace(/ZZ/g,t).replace(/XX/g,a).replace(/SHORT/g,e);return $("#add_date_"+e+"_"+t+"_div").after(n),$("#next_date_"+e+"_"+t+"_j").text(a+1),k(e+"_date"+a,t),R(e+"_date_"+a,t),u(e+"_date_"+a,t),!1}function _(e,t){var a=parseInt($("#next_scm_"+e+"_"+t+"_j").text()),n=a+"_"+t;i(!0);var r=$("#scm_template").clone().html().replace(/ZZ/g,t).replace(/YY/g,a).replace(/SHORT/g,e);return $("#add_scm_"+e+"_"+t+"_div").after(r),$("#next_scm_"+e+"_"+t+"_j").text(a+1),function(e,t,a){$("#scm_"+e+"_editbutton_"+a+"_"+t).on("click",(function(){f(e,t,a)})),$("#scm_"+e+"_deletebutton_"+a+"_"+t).on("click",(function(){y(e,t,a)}))}(e,t,a),R("scm_"+e,n),f(e,t,a),!1}var d=null;function u(e,t){return"update"!=$("#"+e+"_operation_"+t).val()&&("delete"==$("#"+e+"_operation_"+t).val()&&x(e,t),$("#"+e+"_editbutton_"+t).removeClass("list-group-item-info").addClass("list-group-item-warning"),$("#"+e+"_editbutton_"+t).html('
    Undo'),$("#"+e+"_editbutton_"+t).off("click").on("click",(function(){!function(e,t){v(e,t),$("#"+e+"_datapart_"+t).replaceWith(r[e+"-"+t]),R(e,t),$("#"+e+"_datapart_"+t+" input[type='checkbox']").each((function(){$(this).bootstrapToggle()}))}(e,t)})),$("#"+e+"_deletebutton_"+t).removeClass("list-group-item-danger").addClass("disabled"),$("#"+e+"_deletebutton_"+t).off("click").on("click",(function(){return!1})),$("#"+e+"_panel_"+t).removeClass("panel-default").addClass("alert-info").addClass("edited-component"),p(e,t))}function p(e,t){if("update"==$("#"+e+"_operation_"+t).val())return!1;var a,n;r[e+"-"+t]=$("#"+e+"_datapart_"+t).clone(),a=e,n=t,$("#"+a+"_datapart_"+n+" div[id^='text_"+a+"']").each((function(){var e=$(this);if(e.attr("id").endsWith("_"+n)&&!e.attr("id").endsWith("ZZ")){var t=e.attr("id").replace(/^text_/,"").replace(a+"_",""),i=new RegExp("_"+n+"$","g"),r=t.replace(i,""),o=$("#"+a+"_"+r+"_"+n).val(),l=0,s="";$("#"+a+"_"+r+"_size_"+n).exists()&&(s=" size='"+(l=parseInt($("#"+a+"_"+r+"_size_"+n).val()))+"' ");var c="";$("#"+a+"_"+r+"_placeholder_"+n).exists()&&(c=$("#"+a+"_"+r+"_placeholder_"+n).val());var _="";$("#"+a+"_"+r+"_onKeyUp_"+n).exists()&&(_=$("#"+a+"_"+r+"_onKeyUp_"+n).val());var d="";""!=_&&(d=" onKeyUp='"+_+"' ");var u="';0!=l&&(u+=''),""!=c&&(u+=''),""!=_&&(u+=''),e.html(u)}})),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='textarea_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace(/^textarea_/,"").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_"+t).val(),l="";a.html(l)}}))}(e,t),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='checkbox_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace(/^checkbox_/,"").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_"+t).val(),l="";$("#"+e+"_"+r+"_placeholderOn_"+t).exists()&&(l=$("#"+e+"_"+r+"_placeholderOn_"+t).val());var s="";$("#"+e+"_"+r+"_placeholderOff_"+t).exists()&&(s=$("#"+e+"_"+r+"_placeholderOff_"+t).val());var c="'),""!=s&&(c+=''),a.html(c),$("#"+e+"_"+r+"_"+t).bootstrapToggle()}}))}(e,t);var o="_"+t;$("#"+e+"_datapart_"+t+" button[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith(o)&&!e.attr("id").endsWith("ZZ")&&e.removeAttr("disabled").removeClass("snac-hidden")})),$("#"+e+"_datapart_"+t+" a.label").each((function(){$(this).removeClass("snac-hidden")})),$("#"+e+"_datapart_"+t+" input[type='checkbox']").each((function(){var e=$(this);e.attr("id").endsWith(o)&&!e.attr("id").endsWith("ZZ")&&e.bootstrapToggle("enable")})),$("#"+e+"_datapart_"+t+" textarea[id^='"+e+"_']").each((function(){var t=$(this);if(t.attr("id").endsWith(o)&&!t.attr("id").endsWith("ZZ")){var a=t.attr("id").replace(e,"");-1==a.indexOf("_text_")&&-1==a.indexOf("_source_")||(t.get(0).CodeMirror=CodeMirror.fromTextArea(t.get(0),{lineNumbers:!0,lineWrapping:!0,viewportMargin:1/0,mode:{name:"xml"}}))}}));var l=!1;return $("#"+e+"_datapart_"+t+" select[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith(o)&&!e.attr("id").endsWith("ZZ")&&(l=!0)})),l||(function(e,t){$("#"+e+"_datapart_"+t+" div[id^='select_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace("select_","").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_id_"+t).val(),l=$("#"+e+"_"+r+"_term_"+t).val(),s=$("#"+e+"_"+r+"_vocabtype_"+t).val(),c=$("#"+e+"_"+r+"_minlength_"+t).val(),_="Select";$("#"+e+"_"+r+"_placeholder_"+t).exists()&&(_=$("#"+e+"_"+r+"_placeholder_"+t).val());var d="";$("#"+e+"_"+r+"_defaultOptions_"+t).exists()&&(d=$("#"+e+"_"+r+"_defaultOptions_"+t).val()),a.html("'),"citation"==r?scm_source_select_replace($("#"+e+"_"+r+"_id_"+t),"_"+t):vocab_select_replace($("#"+e+"_"+r+"_id_"+t),"_"+t,s,c)}}))}(e,t),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='selectGeo_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace("selectGeo_","").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_id_"+t).val(),l=$("#"+e+"_"+r+"_term_"+t).val(),s="",c=" selected";"true"==$("#"+e+"_confirmed_"+t).val()||(s=" selected",c=""),a.html(""),geovocab_select_replace($("#"+e+"_"+r+"_id_"+t),"_"+t)}}))}(e,t),function(e,t){$("div[id^='date_"+e+"']").each((function(){var a,n=$(this);if(n.attr("id").endsWith("_"+t)&&!n.attr("id").endsWith("ZZ")){var i=n.attr("id").replace("date_","").replace(e+"_",""),r=new RegExp("_"+t+"$","g"),o=i.replace(r,""),l=$("#"+e+"_"+o+"_"+t).val(),s=3==(a=l.split("-")).length?{year:parseInt(a[0]),month:parseInt(a[1]),day:parseInt(a[2])}:2==a.length?{year:parseInt(a[0]),month:parseInt(a[1]),day:""}:1==a.length&&""!=a[0]?{year:parseInt(a[0]),month:"",day:""}:{year:"",month:"",day:""},c="";c+=" - ",c+=" ",c+=" - ",c+=" ",c+="",n.html(c),$("#"+e+"_"+o+"_month_"+t).select2({width:"57%",allowClear:!0,theme:"bootstrap",placeholder:"Month"})}}))}(e,t)),$("#"+e+"_datapart_"+t+" span.move-handle").each((function(){$(this).removeClass("snac-hidden")})),$("#"+e+"_reorderable_"+t).sortable({items:".reorderable",opacity:.5,update:function(a,n){var i=$("#"+e+"_reorderable_"+t).sortable("toArray");console.log(i),i.forEach((function(e,t){$("#"+e+" input.order-index").val(t)})),"nameEntry"==e&&E(t)}}),"constellationRelation"==e&&$("#"+e+"_type_id_"+t).change((function(){W(e,t,$("#"+e+"_type_id_"+t+" option:selected").text())})),"resourceRelation"==e&&$("#"+e+"_role_id_"+t).change((function(){W(e,t,$("#"+e+"_role_id_"+t+" option:selected").text())})),"place"==e&&(null!=$("#"+e+"_geoplace_id_"+t).val()&&""!=$("#"+e+"_geoplace_id_"+t).val()&&j(e,t,$("#"+e+"_geoplace_id_"+t).val()),$("#"+e+"_geoplace_id_"+t).change((function(){j(e,t,$("#"+e+"_geoplace_id_"+t).val())}))),"nameEntry"!==e||"700"!==$("#entityType").val()||"Name"!==$("#nameEntry_component_0_panel_"+t).find("select:first").text()||$("#nameEntry_panel_"+t).find(".name-parser").length||0!==$("#nameEntry_component_1_panel_"+t).length||$("#nameEntry_component_add_"+t).after(''),""!=$("#"+e+"_id_"+t).val()?$("#"+e+"_operation_"+t).val("update"):$("#"+e+"_operation_"+t).val("insert"),i(!0),!1}function m(e,t){var a="_"+t;$("#"+e+"_datapart_"+t+" span.move-handle").each((function(){$(this).addClass("snac-hidden")})),$("#"+e+"_reorderable_"+t).hasClass("ui-sortable")&&$("#"+e+"_reorderable_"+t).sortable("destroy"),$("#"+e+"_datapart_"+t+" textarea[id^='"+e+"_']").each((function(){var e=$(this);!e.attr("id").endsWith(a)||e.attr("id").endsWith("ZZ")||-1==e.attr("id").indexOf("_text_")&&-1==e.attr("id").indexOf("_source_")||e.get(0).CodeMirror&&e.get(0).CodeMirror.toTextArea()})),$("#"+e+"_datapart_"+t+" button[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith(a)&&!e.attr("id").endsWith("ZZ")&&e.attr("disabled","true").addClass("snac-hidden")})),$("#"+e+"_datapart_"+t+" a.label").each((function(){$(this).addClass("snac-hidden")})),$("#"+e+"_datapart_"+t+" input[type='checkbox']").each((function(){var e=$(this);e.attr("id").endsWith(a)&&!e.attr("id").endsWith("ZZ")&&e.bootstrapToggle("disable")})),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='text_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace(/^text_/,"").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_"+t).val(),l=0;$("#"+e+"_"+r+"_size_"+t).exists()&&(l=parseInt($("#"+e+"_"+r+"_size_"+t).val()));var s="";$("#"+e+"_"+r+"_placeholder_"+t).exists()&&(s=$("#"+e+"_"+r+"_placeholder_"+t).val());var c="";$("#"+e+"_"+r+"_onKeyUp_"+t).exists()&&(c=$("#"+e+"_"+r+"_onKeyUp_"+t).val());var _="';_+="

    "+o+"

    ",0!=l&&(_+=''),""!=s&&(_+=''),""!=c&&(_+=''),a.html(_)}}))}(e,t),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='textarea_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace(/^textarea_/,"").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_"+t).val(),l="";l+="
    "+o+"
    ",a.html(l)}}))}(e,t),function(e,t){$("#"+e+"_datapart_"+t+" div[id^='checkbox_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace(/^checkbox_/,"").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_"+t).val(),l=$("#"+e+"_"+r+"_"+t).prop("checked"),s="";$("#"+e+"_"+r+"_placeholderOn_"+t).exists()&&(s=$("#"+e+"_"+r+"_placeholderOn_"+t).val());var c="";$("#"+e+"_"+r+"_placeholderOff_"+t).exists()&&(c=$("#"+e+"_"+r+"_placeholderOff_"+t).val());var _="',_+="

    ",l?_+=""!=s?s:o:""!=c&&(_+=c),_+="

    ",""!=s&&(_+=''),""!=c&&(_+=''),$("#"+e+"_"+r+"_"+t).bootstrapToggle("destroy"),a.html(_)}}))}(e,t);var n=!1;$("#"+e+"_datapart_"+t+" select[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith(a)&&!e.attr("id").endsWith("ZZ")&&(n=!0)})),n&&(function(e,t){$("div[id^='select_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace("select_","").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_id_"+t).val(),l=$("#"+e+"_"+r+"_id_"+t+" option:selected").text(),s=$("#"+e+"_"+r+"_vocabtype_"+t).val(),c=$("#"+e+"_"+r+"_minlength_"+t).val(),_="",d="";"name_component"==s&&(_="name-component-type",d=" :"),a.html('

    '+l+d+"

    ")}}))}(e,t),function(e,t){$("div[id^='selectGeo_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace("selectGeo_","").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,""),o=$("#"+e+"_"+r+"_id_"+t).val(),l=$("#"+e+"_"+r+"_id_"+t+" option:selected").text();a.html('')}}))}(e,t),function(e,t){$("div[id^='date_"+e+"']").each((function(){var a=$(this);if(a.attr("id").endsWith("_"+t)&&!a.attr("id").endsWith("ZZ")){var n=a.attr("id").replace("date_","").replace(e+"_",""),i=new RegExp("_"+t+"$","g"),r=n.replace(i,"");w(e,t);var o=$("#"+e+"_"+r+"_"+t).val(),l="

    "+o+"

    ";l+="",a.html(l)}}))}(e,t)),$("#"+e+"_datapart_"+t+" input[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith("_operation"+a)&&!e.attr("id").endsWith("ZZ")&&e.val("")})),$("#"+e+"_panel_"+t).addClass("panel-default").removeClass("alert-info").removeClass("edited-component")}function v(e,t){return m(e,t),$("#"+e+"_editbutton_"+t).addClass("list-group-item-info").removeClass("list-group-item-warning"),$("#"+e+"_editbutton_"+t).html('
    Edit'),$("#"+e+"_editbutton_"+t).off("click").on("click",(function(){u(e,t)})),$("#"+e+"_deletebutton_"+t).addClass("list-group-item-danger").removeClass("disabled"),$("#"+e+"_deletebutton_"+t).off("click").on("click",(function(){x(e,t)})),!1}function f(e,t,a){var n=a+"_"+t,i="scm_"+e;return"update"!=$("#"+i+"_operation_"+n).val()&&("delete"==$("#"+i+"_operation_"+n).val()&&y(e,t,a),$("#"+i+"_editbutton_"+n).removeClass("list-group-item-info").addClass("list-group-item-warning"),$("#"+i+"_editbutton_"+n).html(''),$("#"+i+"_editbutton_"+n).off("click").on("click",(function(){!function(e,t,a){var n=a+"_"+t;g(e,t,a),$("#scm_"+e+"_datapart_"+n).replaceWith(r["scm_"+e+"-"+n]),R("scm_"+e,n)}(e,t,a)})),$("#"+i+"_deletebutton_"+n).removeClass("list-group-item-danger").addClass("disabled"),$("#"+i+"_deletebutton_"+n).off("click").on("click",(function(){return!1})),$("#"+i+"_panel_"+n).removeClass("panel-default").addClass("alert-info").addClass("edited-component"),p(i,n))}function g(e,t,a){var n=a+"_"+t;return m("scm_"+e,n),$("#scm_"+e+"_editbutton_"+n).addClass("list-group-item-info").removeClass("list-group-item-warning"),$("#scm_"+e+"_editbutton_"+n).html(''),$("#scm_"+e+"_editbutton_"+n).off("click").on("click",(function(){f(e,t,a)})),$("#scm_"+e+"_deletebutton_"+n).addClass("list-group-item-danger").removeClass("disabled"),$("#scm_"+e+"_deletebutton_"+n).off("click").on("click",(function(){y(e,t,a)})),!1}function h(e,t){return"delete"!=$("#"+e+"_operation_"+t).val()?($("#"+e+"_remove_"+t).removeClass("btn-danger").addClass("btn-warning"),$("#"+e+"_remove_"+t).html('')):($("#"+e+"_remove_"+t).removeClass("btn-warning").addClass("btn-danger"),$("#"+e+"_remove_"+t).html('')),b(e,t)}function x(e,t){return"delete"!=$("#"+e+"_operation_"+t).val()?($("#"+e+"_deletebutton_"+t).removeClass("list-group-item-danger").addClass("list-group-item-warning"),$("#"+e+"_deletebutton_"+t).html('
    Undo'),$("#"+e+"_editbutton_"+t).removeClass("list-group-item-info").addClass("disabled"),$("#"+e+"_editbutton_"+t).off("click").on("click",(function(){return!1})),$("#"+e+"_datebutton_"+t).removeClass("list-group-item-success").addClass("disabled").prop("disabled",!0),$("#"+e+"_scmbutton_"+t).removeClass("list-group-item-success").addClass("disabled").prop("disabled",!0)):($("#"+e+"_deletebutton_"+t).removeClass("list-group-item-warning").addClass("list-group-item-danger"),$("#"+e+"_deletebutton_"+t).html('
    Trash'),$("#"+e+"_editbutton_"+t).addClass("list-group-item-info").removeClass("disabled"),$("#"+e+"_editbutton_"+t).off("click").on("click",(function(){u(e,t)})),$("#"+e+"_datebutton_"+t).addClass("list-group-item-success").removeClass("disabled").prop("disabled",!1),$("#"+e+"_scmbutton_"+t).addClass("list-group-item-success").removeClass("disabled").prop("disabled",!1)),b(e,t)}function b(e,t){if("delete"!=$("#"+e+"_operation_"+t).val())$("#"+e+"_panel_"+t).removeClass("panel-default").addClass("alert-danger").addClass("deleted-component"),$("#"+e+"_operation_"+t).val("delete");else{$("#"+e+"_panel_"+t).removeClass("alert-danger").addClass("panel-default").removeClass("deleted-component");var a=!1;$("select[id^='"+e+"_']").each((function(){var e=$(this);e.attr("id").endsWith("_"+t)&&!e.attr("id").endsWith("ZZ")&&(a=!0)})),a?""!=$("#"+e+"_id_"+t).val()?$("#"+e+"_operation_"+t).val("update"):$("#"+e+"_operation_"+t).val("insert"):$("#"+e+"_operation_"+t).val("")}return i(!0),!1}function y(e,t,a){var n=a+"_"+t;return"delete"!=$("#scm_"+e+"_operation_"+n).val()?($("#scm_"+e+"_deletebutton_"+n).removeClass("list-group-item-danger").addClass("list-group-item-warning"),$("#scm_"+e+"_deletebutton_"+n).html(''),$("#scm_"+e+"_editbutton_"+n).removeClass("list-group-item-info").addClass("disabled"),$("#scm_"+e+"_editbutton_"+n).off("click").on("click",(function(){return!1}))):($("#scm_"+e+"_deletebutton_"+n).removeClass("list-group-item-warning").addClass("list-group-item-danger"),$("#scm_"+e+"_deletebutton_"+n).html(''),$("#scm_"+e+"_editbutton_"+n).addClass("list-group-item-info").removeClass("disabled"),$("#scm_"+e+"_editbutton_"+n).off("click").on("click",(function(){f(e,t,a)}))),b("scm_"+e,n)}function k(e,t){$("#"+e+"_editbutton_"+t).on("click",(function(){u(e,t)})),$("#"+e+"_deletebutton_"+t).on("click",(function(){x(e,t)}))}function R(e,t){$((function(){$("#"+e+"_panel_"+t+' [data-toggle="tooltip"]').tooltip()})),$((function(){$("#"+e+"_panel_"+t+' [data-toggle="popover"]').popover({trigger:"hover",container:"body"})}))}function C(e){var t=1;$("#place_address_next_j_"+e).exists()&&(t=parseInt($("#place_address_next_j_"+e).text())),console.log("Creating new address line for place "+e+" with id: "+t),i(!0);var a=$("#addressline_template").clone().html().replace(/ZZ/g,e).replace(/YY/g,t);return $("#place_address_add_div_"+e).before(a),$("#place_address_"+t+"_operation_1").val("insert"),p("place_address_"+t,e),vocab_select_replace($("#place_address_"+t+"_type_id_"+e),"_"+e,"address_part",0),$("#place_address_next_j_"+e).text(++t),!1}function Z(e){!function(e){$("#nameEntry_datapart_"+e).find(".name-parser").remove()}(e);var t=1;$("#nameEntry_component_next_j_"+e).exists()&&(t=parseInt($("#nameEntry_component_next_j_"+e).text())),console.log("Creating new name entry component for nameEntry "+e+" with id: "+t),"700"!==$("#entityType").val()||0!=t||$("#nameEntry_panel_"+e).find(".name-parser").length||0!==$("#nameEntry_component_1_panel_"+e).length||$("#nameEntry_component_add_"+e).after(''),i(!0);var a=$("#component_template").clone().html().replace(/ZZ/g,e).replace(/YY/g,t);return $("#nameEntry_component_add_div_"+e).before(a),$("#nameEntry_component_"+t+"_operation_1").val("insert"),p("nameEntry_component_"+t,e),vocab_select_replace($("#nameEntry_component_"+t+"_type_id_"+e),"_"+e,"name_component",0),$("#nameEntry_component_next_j_"+e).text(++t),!1}function E(e){var t="",a=[];$("#nameEntry_panel_"+e+" div[id^='nameEntry_component_']").each((function(){var t=$(this);if(!t.hasClass("deleted-component")&&t.attr("id").endsWith("_panel_"+e)&&!t.attr("id").endsWith("ZZ")){var n=t.attr("id").replace("nameEntry_component_","").replace("_panel_"+e,""),i=$("#nameEntry_component_"+n+"_type_id_"+e+" option:selected").text(),r=$("#nameEntry_component_"+n+"_text_"+e).val();a.push([i,r])}}));var n=$("#entityType option:selected").text();t=combineNameHeading(a,n),$("#nameEntry_heading_"+e).text(t.trim()),$("#nameEntry_original_"+e).val(t.trim())}function I(e){var t=1;$("#nameEntry_rule_next_j_"+e).exists()&&(t=parseInt($("#nameEntry_rule_next_j_"+e).text())),console.log("Creating new name entry rule for nameEntry "+e+" with id: "+t),i(!0);var a=$("#rule_template").clone().html().replace(/ZZ/g,e).replace(/YY/g,t);return $("#nameEntry_rule_add_div_"+e).before(a),$("#nameEntry_rule_"+t+"_operation_1").val("insert"),R("nameEntry_rule_"+t,e),p("nameEntry_rule_"+t,e),$("#nameEntry_rule_next_j_"+e).text(++t),!1}function D(e,t){for(var a=e+"";a.lengthUnconfirmed"),$("#"+e+"_geoterm_caption_"+t).text("Recorded as: "+$("#"+e+"_original_"+t).val())):($("#"+e+"_geoterm_text_"+t).text("--"),$("#"+e+"_geoterm_caption_"+t).text("GeoPlace term not specified"))))):($("#"+e+"_confirmed_"+t).val("false"),$("#"+e+"_geoterm_text_"+t).html("Unconfirmed"),$("#"+e+"_geoterm_maplink_"+t).addClass("disabled"),$("#"+e+"_geoterm_maplink_"+t).prop("onclick",null).off("click"),void(""!=$("#"+e+"_original_"+t).val()?$("#"+e+"_geoterm_caption_"+t).text("Recorded as: "+$("#"+e+"_original_"+t).val()):$("#"+e+"_geoterm_caption_"+t).text()))}function N(e,t){if(void 0!==typeof o[t]){var a={id:o[t].id,text:o[t].term};if($("#"+e).find("option[value='"+a.id+"']").length)$("#"+e).val(a.id).trigger("change");else{var n=new Option(a.text,a.id,!1,!0);$("#"+e).append(n).trigger("change")}}}function G(e,t,a,n){var i=t.attr("id").split("_")[2];t.find(".reorderable").replaceWith('
    Name: '+a+"
    ");for(var r={},o=0;o"+t+": "+e[t]+"");$("#name-parser-options").append("
    "),$("#name-parser-options").find("input[type='radio']:last").data("parsed-name",e),o="",l++})),$("#name-parser-options").find("input[type='radio']:first").prop("checked",!0),$("#parser-accept-btn").unbind("click"),$("#parser-accept-btn").on("click",(function(){var e=$('#name-parser input[type="radio"]:checked').data("parsed-name");$.get(snacUrl+"/vocabulary/?type=name_component&entity_type=700").done((function(t){G(e,a,n,t.results)}))}))}(e),$("#name-parser").modal("toggle")})),$("#name-parser").on("shown.bs.modal",(function(){$("#parser-accept-btn").focus()})),"insert"==$("#operation").val()&&i(!0),T(),$("#entityType").exists()&&$("#entityType").change((function(){i(!0),null!=$("#constellationid").val()&&""!=$("#constellationid").val()&&$("#operation").val("update")}));var e=1;$("#next_nameEntry_i").exists()&&(e=parseInt($("#next_nameEntry_i").text())),console.log("Next NameEntry ID: "+e),$("#btn_add_nameEntry").exists()&&$("#btn_add_nameEntry").click((function(){i(!0);var t=$("#nameEntry_template").clone().html().replace(/ZZ/g,e);return $("#add_nameEntry_div").after(t),k("nameEntry",e),R("nameEntry",e),u("nameEntry",e),e+=1,!1}));var t=1,a=!1;$("#genderstab").exists()&&$("#genderstab").click((function(){a||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=genders",null,(function(e){a=!0,$("#genders").html(e),T("genders"),$("#next_gender_i").exists()&&(t=parseInt($("#next_gender_i").text())),console.log("Next Gender ID: "+t),$("#btn_add_gender").exists()&&$("#btn_add_gender").click((function(){i(!0);var e=$("#gender_template").clone().html().replace(/ZZ/g,t);return $("#add_gender_div").after(e),k("gender",t),R("gender",t),u("gender",t),t+=1,!1})),O("genders")}))}));var n=1,r=!1;$("#existstab").exists()&&$("#existstab").click((function(){r||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=dates",null,(function(e){r=!0,$("#dates").html(e),T("dates"),$("#next_exist_i").exists()&&(n=parseInt($("#next_exist_i").text())),console.log("Next Exist Date ID: "+n),$("#btn_add_exist_date").exists()&&$("#btn_add_exist_date").click((function(){i(!0);var e=$("#exist_date_template").clone().html().replace(/ZZ/g,n);return $("#add_exist_div").after(e),k("exist",n),R("exist",n),u("exist",n),n+=1,!1})),$("#btn_add_exist_dateRange").exists()&&$("#btn_add_exist_dateRange").click((function(){i(!0);var e=$("#exist_dateRange_template").clone().html().replace(/ZZ/g,n);return $("#add_exist_div").after(e),k("exist",n),R("exist",n),u("exist",n),n+=1,!1})),O("dates")}))}));var o=1,l=!1;$("#sameAstab").exists()&&$("#sameAstab").click((function(){l||($.get(snacUrl+"/vocabulary?type=record_type&q=SameAs",null,(function(e){sameAsTermId=e.results[0].id,$("#sameAs_type_id_ZZ").val(sameAsTermId)})),$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=sameAs",null,(function(e){l=!0,$("#sameAs").html(e),T("sameAs"),$("#next_sameAs_i").exists()&&(o=parseInt($("#next_sameAs_i").text())),console.log("Next sameAs ID: "+o),$("#btn_add_sameAs").exists()&&$("#btn_add_sameAs").click((function(){i(!0);var e=$("#sameAs_template").clone().html().replace(/ZZ/g,o);return $("#add_sameAs_div").after(e),k("sameAs",o),R("sameAs",o),u("sameAs",o),o+=1,!1})),O("sameAs")})))}));var s=1,c=!1;$("#entityIDtab").exists()&&$("#entityIDtab").click((function(){c||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=entityID",null,(function(e){c=!0,$("#entityID").html(e),T("entityID"),$("#next_entityID_i").exists()&&(s=parseInt($("#next_entityID_i").text())),console.log("Next entityID ID: "+s),$("#btn_add_entityID").exists()&&$("#btn_add_entityID").click((function(){i(!0);var e=$("#entityID_template").clone().html().replace(/ZZ/g,s);return $("#add_entityID_div").after(e),k("entityID",s),R("entityID",s),u("entityID",s),s+=1,!1})),O("entityID")}))}));var _=1,d=!1;$("#sourcestab").exists()&&$("#sourcestab").click((function(){d||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=sources",null,(function(e){d=!0,$("#sources").html(e),T("sources"),$("#next_source_i").exists()&&(_=parseInt($("#next_source_i").text())),console.log("Next source ID: "+_),$("#btn_add_source").exists()&&$("#btn_add_source").click((function(){i(!0);var e=$("#source_template").clone().html().replace(/ZZ/g,_);return $("#add_source_div").after(e),k("source",_),R("source",_),u("source",_),_+=1,!1})),O("sources")}))}));var p=1,m=!1;$("#resourceRelationstab").exists()&&$("#resourceRelationstab").click((function(){m||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=resourceRelations",null,(function(e){m=!0,$("#resourceRelations").html(e),T("resourceRelations"),$("#next_resourceRelation_i").exists()&&(p=parseInt($("#next_resourceRelation_i").text())),console.log("Next resourceRelation ID: "+p),$("#btn_create_resourceRelation").exists()&&$("#btn_create_resourceRelation").click((function(){var e=$("input[name=resourceChoice]:checked","#resource_search_form").val();if(null!=e&&null!=resourceResults&&"new"!=e){i(!0);var t=$("#resourceRelation_template").clone().html().replace(/ZZ/g,p);return $("#add_resourceRelation_div").after(t),void 0!==resourceResults[e].id&&$("#resourceRelation_resourceid_"+p).val(resourceResults[e].id),void 0!==resourceResults[e].version&&$("#resourceRelation_resourceversion_"+p).val(resourceResults[e].version),void 0!==resourceResults[e].link&&$("#resourceRelation_linkText_"+p).html(""+resourceResults[e].link+" View"),void 0!==resourceResults[e].displayEntry&&$("#resourceRelation_displayEntryText_"+p).text(resourceResults[e].displayEntry),void 0!==resourceResults[e].title&&($("#resourceRelation_titleText_"+p).text(resourceResults[e].title),U("resourceRelation",p,resourceResults[e].title)),void 0!==resourceResults[e].abstract&&$("#resourceRelation_abstractText_"+p).text(resourceResults[e].abstract),void 0!==resourceResults[e].extent&&$("#resourceRelation_extentText_"+p).text(resourceResults[e].extent),void 0!==resourceResults[e].documentType&&void 0!==resourceResults[e].documentType.term&&$("#resourceRelation_documentTypeText_"+p).text(resourceResults[e].documentType.term),$("#resourceRelation_linkText_"+p).after("View in SNAC"),k("resourceRelation",p),R("resourceRelation",p),u("resourceRelation",p),p+=1,$("#resource-results-box").html(""),!0}return!1})),$("#btn_open_create_resource").exists()&&$("#btn_open_create_resource").click((function(){$("#resourceSearchPane").modal("hide"),setTimeout((function(){$("#resourceCreatePane").modal("show")}),500);var e=$("#resource_template").clone().html().replace(/ZZ/g,0);$("#resource-create-box").html(e);var t=$("#resource_create_form");-1==$("#resource-searchbox").val().indexOf("http")?t.find("#resource-title").val($("#resource-searchbox").val()):t.find("#resource-url").val($("#resource-searchbox").val()),t.find('[data-toggle="popover"]').popover({trigger:"hover",container:"body"}),loadVocabSelectOptions(t.find("#resource-type-select"),"document_type","Resource Type"),vocab_select_replace(t.find("#resource-repo"),"","holding",3),t.find("#new-resource-language-btn").on("click",newResourceLanguage),t.find("#magic-resource-language-btn").on("click",magicNewResourceLanguage),$("#search-results-box").on("click","a.list-group-item",selectHoldingRepository);var a=null;return t.find("#searchbox").keyup((function(){clearTimeout(a),a=setTimeout((function(){setSearchPosition(0),searchAndUpdate()}),500)})),$("#resource-results-box").html(""),!1})),$("#btn_create_resource").exists()&&$("#resource_create_form").on("submit",(function(){if(""!=$("#resource_create_form #resource-url").val()||confirm("Are you sure you want to save without an HREF?"))return $("#resource_create_form input, textarea").each((function(){$(this).val($.trim($(this).val()))})),setDeletedResourceLanguageOperations($("#resource_create_form")),$.post(snacUrl+"/save_resource",$("#resource_create_form").serialize(),(function(e){if(void 0!==e.result&&"false"!==e.result){i(!0);var t=$("#resourceRelation_template").clone().html().replace(/ZZ/g,p);return $("#add_resourceRelation_div").after(t),void 0!==e.resource.id&&$("#resourceRelation_resourceid_"+p).val(e.resource.id),void 0!==e.resource.version&&$("#resourceRelation_resourceversion_"+p).val(e.resource.version),void 0!==e.resource.link&&$("#resourceRelation_linkText_"+p).html(""+e.resource.link+" View"),void 0!==e.resource.displayEntry&&$("#resourceRelation_displayEntryText_"+p).text(e.resource.displayEntry),void 0!==e.resource.title&&($("#resourceRelation_titleText_"+p).text(e.resource.title),U("resourceRelation",p,e.resource.title)),void 0!==e.resource.abstract&&$("#resourceRelation_abstractText_"+p).text(e.resource.abstract),void 0!==e.resource.extent&&$("#resourceRelation_extentText_"+p).text(e.resource.extent),void 0!==e.resource.documentType&&void 0!==e.resource.documentType.term&&$("#resourceRelation_documentTypeText_"+p).text(e.resource.documentType.term),$("#resourceRelation_linkText_"+p).after("View in SNAC"),k("resourceRelation",p),R("resourceRelation",p),u("resourceRelation",p),p+=1,$("#resourceCreatePane").modal("hide"),$("#resource-create-box").html(""),!0}return console.log(e),!1})),!1})),O("resourceRelations")}))}));var v=1,f=!1;$("#constellationRelationstab").exists()&&$("#constellationRelationstab").click((function(){f||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=constellationRelations",null,(function(e){f=!0,$("#constellationRelations").html(e),T("constellationRelations"),$("#next_constellationRelation_i").exists()&&(v=parseInt($("#next_constellationRelation_i").text())),console.log("Next constellationRelation ID: "+v),$("#btn_create_constellationRelation").exists()&&$("#btn_create_constellationRelation").click((function(){var e=$("input[name=relationChoice]:checked","#relation_search_form").val();if(null!=e){i(!0);var t=$("#constellationRelation_template").clone().html().replace(/ZZ/g,v);return $("#add_constellationRelation_div").after(t),$("#constellationRelation_targetID_"+v).val(e),$("#constellationRelation_content_"+v).val($("#relationChoice_nameEntry_"+e).val()),$("#constellationRelation_targetArkID_"+v).val($("#relationChoice_arkID_"+e).val()),$("#constellationRelation_targetEntityType_"+v).val($("#relationChoice_entityType_"+e).val()),function(e,t,a){var n="";"person"==a?n='
    ':"corporateBody"==a?n='
    ':"family"==a&&(n='
    '),$("#"+e+"_relationPictureIcon_"+t).html(n)}("constellationRelation",v,$("#relationChoice_entityTypeText_"+e).val()),U("constellationRelation",v,$("#relationChoice_nameEntry_"+e).val()),$("#constellationRelation_contentText_"+v).text($("#relationChoice_nameEntry_"+e).val()),$("#constellationRelation_targetArkIDText_"+v).text($("#relationChoice_arkID_"+e).val()),k("constellationRelation",v),R("constellationRelation",v),u("constellationRelation",v),v+=1,!0}return!1})),O("constellationRelations")}))}));var g=1,h=!1;$("#languagesUsedtab").exists()&&$("#languagesUsedtab").click((function(){h||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=languagesUsed",null,(function(e){h=!0,$("#languagesUsed").html(e),T("languagesUsed"),$("#next_language_i").exists()&&(g=parseInt($("#next_language_i").text())),console.log("Next language ID: "+g),$("#btn_add_language").exists()&&$("#btn_add_language").click((function(){i(!0);var e=$("#language_template").clone().html().replace(/ZZ/g,g);return $("#add_language_div").after(e),k("language",g),R("language",g),u("language",g),g+=1,!1})),O("languagesUsed")}))}));var x=1,b=!1;$("#subjectstab").exists()&&$("#subjectstab").click((function(){b||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=subjects",null,(function(e){b=!0,$("#subjects").html(e),T("subjects"),$("#next_subject_i").exists()&&(x=parseInt($("#next_subject_i").text())),console.log("Next subject ID: "+x),$("#btn_add_subject").exists()&&$("#btn_add_subject").click((function(){i(!0);var e=$("#subject_template").clone().html().replace(/ZZ/g,x);return $("#add_subject_div").after(e),k("subject",x),R("subject",x),u("subject",x),x+=1,!1})),O("subjects")}))}));var y=1,C=!1;$("#nationalitiestab").exists()&&$("#nationalitiestab").click((function(){C||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=nationalities",null,(function(e){C=!0,$("#nationalities").html(e),T("nationalities"),$("#next_nationality_i").exists()&&(y=parseInt($("#next_nationality_i").text())),console.log("Next nationality ID: "+y),$("#btn_add_nationality").exists()&&$("#btn_add_nationality").click((function(){i(!0);var e=$("#nationality_template").clone().html().replace(/ZZ/g,y);return $("#add_nationality_div").after(e),k("nationality",y),R("nationality",y),u("nationality",y),y+=1,!1})),O("nationalities")}))}));var Z=1,E=!1;$("#functionstab").exists()&&$("#functionstab").click((function(){E||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=functions",null,(function(e){E=!0,$("#functions").html(e),T("functions"),$("#next_function_i").exists()&&(Z=parseInt($("#next_function_i").text())),console.log("Next function ID: "+Z),$("#btn_add_function").exists()&&$("#btn_add_function").click((function(){i(!0);var e=$("#function_template").clone().html().replace(/ZZ/g,Z);return $("#add_function_div").after(e),k("function",Z),R("function",Z),u("function",Z),Z+=1,!1})),O("functions")}))}));var I=1,D=!1;$("#occupationstab").exists()&&$("#occupationstab").click((function(){D||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=occupations",null,(function(e){D=!0,$("#occupations").html(e),T("occupations"),$("#next_occupation_i").exists()&&(I=parseInt($("#next_occupation_i").text())),console.log("Next occupation ID: "+I),$("#btn_add_occupation").exists()&&$("#btn_add_occupation").click((function(){i(!0);var e=$("#occupation_template").clone().html().replace(/ZZ/g,I);return $("#add_occupation_div").after(e),k("occupation",I),R("occupation",I),u("occupation",I),I+=1,!1})),O("occupations")}))}));var w=1,W=!1;$("#legalStatusestab").exists()&&$("#legalStatusestab").click((function(){W||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=legalStatuses",null,(function(e){W=!0,$("#legalStatuses").html(e),T("legalStatuses"),$("#next_legalStatus_i").exists()&&(w=parseInt($("#next_legalStatus_i").text())),console.log("Next legalStatus ID: "+w),$("#btn_add_legalStatus").exists()&&$("#btn_add_legalStatus").click((function(){i(!0);var e=$("#legalStatus_template").clone().html().replace(/ZZ/g,w);return $("#add_legalStatus_div").after(e),k("legalStatus",w),R("legalStatus",w),u("legalStatus",w),w+=1,!1})),O("legalStatuses")}))}));var A=1,j=!1;$("#placestab").exists()&&$("#placestab").click((function(){j||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=places",null,(function(e){j=!0,$("#places").html(e),S(),T("places"),$("#next_place_i").exists()&&(A=parseInt($("#next_place_i").text())),console.log("Next place ID: "+A),$("#btn_add_place").exists()&&$("#btn_add_place").click((function(){i(!0);var e=$("#place_template").clone().html().replace(/ZZ/g,A);return $("#add_place_div").after(e),k("place",A),R("place",A),u("place",A),A+=1,!1})),O("places")}))}));var N=1,H=!1;$("#conventionDeclarationstab").exists()&&$("#conventionDeclarationstab").click((function(){H||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=conventionDeclarations",null,(function(e){H=!0,$("#conventionDeclarations").html(e),T("conventionDeclarations"),$("#next_conventionDeclaration_i").exists()&&(N=parseInt($("#next_conventionDeclaration_i").text())),console.log("Next conventionDeclaration ID: "+N),$("#btn_add_conventionDeclaration").exists()&&$("#btn_add_conventionDeclaration").click((function(){i(!0);var e=$("#conventionDeclaration_template").clone().html().replace(/ZZ/g,N);return $("#add_conventionDeclaration_div").after(e),k("conventionDeclaration",N),R("conventionDeclaration",N),u("conventionDeclaration",N),N+=1,!1})),O("conventionDeclarations")}))}));var P=1,M=!1;$("#generalContextstab").exists()&&$("#generalContextstab").click((function(){M||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=generalContexts",null,(function(e){M=!0,$("#generalContexts").html(e),T("generalContexts"),$("#next_generalContext_i").exists()&&(P=parseInt($("#next_generalContext_i").text())),console.log("Next generalContext ID: "+P),$("#btn_add_generalContext").exists()&&$("#btn_add_generalContext").click((function(){i(!0);var e=$("#generalContext_template").clone().html().replace(/ZZ/g,P);return $("#add_generalContext_div").after(e),k("generalContext",P),R("generalContext",P),u("generalContext",P),P+=1,!1})),O("generalContexts")}))}));var Y=1,z=!1;$("#structureOrGenealogiestab").exists()&&$("#structureOrGenealogiestab").click((function(){z||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=structureOrGenealogies",null,(function(e){z=!0,$("#structureOrGenealogies").html(e),T("structureOrGenealogies"),$("#next_structureOrGenealogy_i").exists()&&(Y=parseInt($("#next_structureOrGenealogy_i").text())),console.log("Next structureOrGenealogy ID: "+Y),$("#btn_add_structureOrGenealogy").exists()&&$("#btn_add_structureOrGenealogy").click((function(){i(!0);var e=$("#structureOrGenealogy_template").clone().html().replace(/ZZ/g,Y);return $("#add_structureOrGenealogy_div").after(e),k("structureOrGenealogy",Y),R("structureOrGenealogy",Y),u("structureOrGenealogy",Y),Y+=1,!1})),O("structureOrGenealogies")}))}));var K=1,V=!1;$("#mandatestab").exists()&&$("#mandatestab").click((function(){V||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=mandates",null,(function(e){V=!0,$("#mandates").html(e),T("mandates"),$("#next_mandate_i").exists()&&(K=parseInt($("#next_mandate_i").text())),console.log("Next mandate ID: "+K),$("#btn_add_mandate").exists()&&$("#btn_add_mandate").click((function(){i(!0);var e=$("#mandate_template").clone().html().replace(/ZZ/g,K);return $("#add_mandate_div").after(e),k("mandate",K),R("mandate",K),u("mandate",K),K+=1,!1})),O("mandates")}))}));var L=1,F=!1;$("#biogHiststab").exists()&&$("#biogHiststab").click((function(){F||$.get(snacUrl+"/edit_part/"+$("#constellationid").val()+"/"+$("#version").val()+"?part=biogHists",null,(function(e){F=!0,$("#biogHists").html(e),T("biogHists"),$("#next_biogHist_i").exists()&&(L=parseInt($("#next_biogHist_i").text())),console.log("Next biogHist ID: "+L),$("#btn_add_biogHist").exists()&&$("#btn_add_biogHist").click((function(){i(!0);var e=$("#biogHist_template").clone().html().replace(/ZZ/g,L);return $("#add_biogHist_div").after(e),k("biogHist",L),R("biogHist",L),u("biogHist",L),L+=1,!1})),O("biogHists")}))})),O(),$("#info-dropdown").click((function(e){$(this).parent().toggleClass("open"),e.stopPropagation()}))}))}})); +//# sourceMappingURL=edit_scripts.js.map \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/edit_scripts.js.map b/src/virtualhosts/www/javascript/edit_scripts.js.map new file mode 100644 index 000000000..5b654aba8 --- /dev/null +++ b/src/virtualhosts/www/javascript/edit_scripts.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/virtualhosts/www/javascript/src/edit_scripts.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","somethingHasBeenEdited","setEditedFlag","val","$","addClass","removeClass","undoSet","Array","defaults","language","id","term","script","displayErrorMessage","err","data","errorMsg","message","type","html","snacUrl","setTimeout","slideDown","console","log","addDateEntry","short","j","parseInt","text","clone","replace","after","turnOnButtons","turnOnTooltips","makeEditable","addDateRangeEntry","addSCMEntry","shortName","on","makeSCMEditable","setSCMDeleted","turnOnSCMButtons","geoPlaceLoadResults","setDeleted","off","makeUneditable","replaceWith","each","this","bootstrapToggle","undoEdit","subMakeEditable","idStr","cont","attr","endsWith","divStr","regex","RegExp","size","sizeStr","exists","placeholder","onKeyUp","onKeyUpStr","textToTextArea","placeholderOn","placeholderOff","textToCheckbox","idstr","obj","removeAttr","indexOf","CodeMirror","fromTextArea","lineNumbers","lineWrapping","viewportMargin","Infinity","sawSelect","vocabtype","minlength","options","scm_source_select_replace","vocab_select_replace","textToSelect","firstOptionSelect","secondOptionSelect","geovocab_select_replace","textToGeoPlaceSelect","pieces","dateStr","dateParts","split","length","year","month","day","forEach","mInt","select2","width","allowClear","theme","textToDate","sortable","items","opacity","update","event","ui","neworder","orderedID","index","updateNameEntryHeading","change","updatePictureArrow","updatePlaceHeading","find","subMakeUneditable","hasClass","toTextArea","inputToText","textAreaToText","checked","prop","checkboxToText","additionalStyle","postText","selectToText","geoPlaceSelectToText","updateDate","dateToText","scmShortName","makeSCMUneditable","undoSCMEdit","setRepeatedDataDeleted","subSetDeleted","tooltip","popover","trigger","container","newAddressLine","nextid","before","newNameEntryComponent","remove","removeParserButton","components","partText","push","entityType","combineNameHeading","trim","newNameEntryRule","pad","num","turnOnEditDeleteButtons","part","divID","turnOnTooltipsForTab","newValue","updatePictureTitle","loadGeoPlaceResultCache","chooseSuggestedGeoPlace","selectID","place","geoPlaceSearchResults","result","administrationCode","countryCode","latitude","longitude","openGeoPlaceViewer","magicDefaultFill","vocabType","undefined","newOption","Option","append","acceptParsedName","selectedName","$nameComponents","nameComponentIDs","nameComponentMap","k","option","$partType","$textbox","document","ready","preventDefault","e","word","target","closest","toUpperCase","slice","guesses","NameParser","guessPerson","parsedOption","counter","guess","unbind","done","results","parseName","modal","focus","nameEntryid","click","genderid","genderOpen","existid","existOpen","sameAsid","sameAsOpen","sameAsTermId","entityIDid","entityIDOpen","sourceid","sourceOpen","resourceRelationid","resourceRelationOpen","rid","resourceResults","version","link","displayEntry","title","abstract","extent","documentType","$resourceForm","loadVocabSelectOptions","newResourceLanguage","magicNewResourceLanguage","selectHoldingRepository","timeoutID","keyup","clearTimeout","setSearchPosition","searchAndUpdate","confirm","setDeletedResourceLanguageOperations","post","serialize","resource","constellationRelationid","constellationRelationOpen","cid","updatePictureIcon","languageid","languageOpen","subjectid","subjectOpen","nationalityid","nationalityOpen","functionid","functionOpen","occupationid","occupationOpen","legalStatusid","legalStatusOpen","placeid","placeOpen","conventionDeclarationid","conventionDeclarationOpen","generalContextid","generalContextOpen","structureOrGenealogyid","structureOrGenealogyOpen","mandateid","mandateOpen","biogHistid","biogHistO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UAAW+O,GACxBA,GAAwB,GACjB,KAIfjH,EAAqB,kBAKpC,IAAImH,EAAa,EACVC,GAAe,EAClBlR,EAAE,iBAAiB2D,UACtB3D,EAAE,iBAAiBiN,OAAM,WAEXiE,GAGJlR,EAAEtB,IAAIuC,QAAQ,cAAcjB,EAAE,oBAAoBD,MAAM,IAAIC,EAAE,YAAYD,MAAM,kBAAmB,MAAM,SAAUa,GAC/GsQ,GAAe,EACflR,EAAE,cAAcgB,KAAKJ,GAErB+I,EAAwB,aAEpB3J,EAAE,oBAAoB2D,WACtBsN,EAAaxP,SAASzB,EAAE,oBAAoB0B,SAEhDN,QAAQC,IAAI,qBAAuB4P,GAC/BjR,EAAE,qBAAqB2D,UACvB3D,EAAE,qBAAqBiN,OAAM,WACzBnN,GAAc,GAEd,IACIkB,EADOhB,EAAE,sBAAsB2B,QACnBX,OAAOY,QAAQ,MAAOqP,GAMtC,OALAjR,EAAE,qBAAqB6B,MAAMb,GAC7Bc,EAAc,WAAYmP,GAC1BlP,EAAe,WAAYkP,GAC3BjP,EAAa,WAAYiP,GACzBA,GAA0B,GACnB,KAIfnH,EAAqB,mBAKjCA,IAGA9J,EAAE,kBAAkBiN,OAAM,SAASnB,GAC/B9L,EAAE8C,MAAMqO,SAASC,YAAY,QAC7BtF,EAAEuF","file":"edit_scripts.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","/**\n * Edit Scripts\n *\n * Scripts used in the edit page\n *\n * @author Robbie Hott\n * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause\n * @copyright 2015 the Rector and Visitors of the University of Virginia, and\n * the Regents of the University of California\n */\n\nvar biogHistEditor = null;\n\n// Has anything been edited on this page?\nexport var somethingHasBeenEdited = false;\n\nexport function setEditedFlag(val) {\n if (val == true) {\n $(\"#save_and_continue\").addClass(\"save-active\");\n } else {\n $(\"#save_and_continue\").removeClass(\"save-active\");\n }\n somethingHasBeenEdited = val;\n}\n\n\n// Global Undo Set\nexport var undoSet = new Array();\n\nexport var defaults = {\n language: {\n id: 130,\n term: \"eng\"\n },\n script: {\n id: 586,\n term: \"Latn\"\n }\n};\n\n\n\n/**\n * Display Error message\n *\n * Displays the error message box to the user with the given error message\n *\n * @param string|object err The error message (string) or error object containing a message and type string\n */\nexport function displayErrorMessage(err, data) {\n var errorMsg = \"\";\n if (typeof err === 'undefined')\n errorMsg = \"an unknown problem occurred\";\n else if ((typeof err) == \"string\")\n errorMsg = err;\n else if (err.message)\n errorMsg = err.message;\n else if (err.type)\n errorMsg = err.type;\n else\n errorMsg = \"an unknown problem occurred\";\n\n $('#error-message').html(\"

    Oops

    \"+errorMsg+\"

    \"\n +\"

    \"\n +\" \"\n +\"\"+\n \"Go to Dashboard\"\n +\"\"\n +\"

    \");\n setTimeout(function(){\n $('#error-message').slideDown();\n }, 500);\n\n // For reference, put the server response in the console\n console.log(data);\n}\n\n/**\n * Add sub-Date GUI object\n *\n * Adds a Date GUI object to the Date modal for the given \"short\" type of data indexed by i\n *\n * @param string short The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index of the object to add a date object to.\n * @returns boolean false to keep the browser from redrawing the page\n */\nexport function addDateEntry(short, i){\n\t//next_date_{{short}}_{{i}}_j\n\tvar j = parseInt($('#next_date_'+short+'_'+i+'_j').text());\n\tvar id = j + \"_\" + i;\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\tvar text = $('#sub_date_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short);\n $('#add_date_'+short+'_'+i+'_div').after(html);\n $('#next_date_'+short+'_'+i+'_j').text(j + 1);\n turnOnButtons(short+\"_date\"+j, i);\n turnOnTooltips(short+\"_date_\"+j, i);\n makeEditable(short + \"_date_\"+j, i);\n return false;\n}\n\n/**\n * Add sub-Date GUI object\n *\n * Adds a Date GUI object to the Date modal for the given \"short\" type of data indexed by i\n *\n * @param string short The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index of the object to add a date object to.\n * @returns boolean false to keep the browser from redrawing the page\n */\nexport function addDateRangeEntry(short, i){\n\t//next_date_{{short}}_{{i}}_j\n\tvar j = parseInt($('#next_date_'+short+'_'+i+'_j').text());\n\tvar id = j + \"_\" + i;\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\tvar text = $('#sub_dateRange_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short);\n $('#add_date_'+short+'_'+i+'_div').after(html);\n $('#next_date_'+short+'_'+i+'_j').text(j + 1);\n turnOnButtons(short+\"_date\"+j, i);\n turnOnTooltips(short+\"_date_\"+j, i);\n makeEditable(short + \"_date_\"+j, i);\n return false;\n}\n\n/**\n * Add SCM GUI object\n *\n * Adds a GUI SCM object to the SCM modal for the given \"short\" type of data indexed by i\n *\n * @param string short The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index of the object to add an SCM object to.\n * @returns boolean false to keep the browser from redrawing the page\n */\nexport function addSCMEntry(short, i){\n\t//next_scm_{{short}}_{{i}}_j\n\tvar j = parseInt($('#next_scm_'+short+'_'+i+'_j').text());\n\tvar id = j + \"_\" + i;\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\tvar text = $('#scm_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/YY/g, j).replace(/SHORT/g, short);\n $('#add_scm_'+short+'_'+i+'_div').after(html);\n $('#next_scm_'+short+'_'+i+'_j').text(j + 1);\n turnOnSCMButtons(short, i, j);\n turnOnTooltips(\"scm_\"+short, id);\n makeSCMEditable(short, i, j);\n return false;\n}\n\n/**\n * Undo Edit\n *\n * Returns the html for the (short, i) panel back to its original state, i.e. removes\n * the edit. Before doing this, to clean up the page, it first makes the edited version\n * uneditable.\n *\n * @param string short The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n */\nfunction undoEdit(short, i) {\n\tmakeUneditable(short, i);\n\n\t// restore the old content\n\t$(\"#\" + short + \"_datapart_\" + i).replaceWith(undoSet[short+\"-\"+i]);\n turnOnTooltips(short,i);\n $(\"#\" + short + \"_datapart_\" + i + \" input[type='checkbox']\").each(function() {\n var obj = $(this);\n obj.bootstrapToggle();\n });\n}\n\n/**\n * Undo SCM Edit\n *\n * Takes an SCM GUI object (j) for a data object (short, i) and returns it back to its\n * original state (removing the edit). Before doing this, to clean up the page and JS, it first\n * makes the edited version uneditable, then replaces the HTML.\n *\n * @param string short The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @param string|int j The index within the data object SCM list on the edit page of the SCM object.\n */\nfunction undoSCMEdit(short, i, j) {\n\tvar id = j + \"_\" + i;\n\tmakeSCMUneditable(short, i, j);\n\n\t// restore the old content\n\t$(\"#scm_\" + short + \"_datapart_\" + id).replaceWith(undoSet[\"scm_\"+short+\"-\"+id]);\n turnOnTooltips(\"scm_\"+short, id);\n}\n\n/**\n * Change vocabulary input divs to selects\n *\n * Changes all div's with id \"select_\" for a given data object (shortName, idStr) from a list of\n * inputs defining the parameters to a select (view mode) to a select box (edit mode). It then\n * calls the select2 function to replace the select with an AJAX-compatible select.\n *\n * This function handles VOCABULARY select boxes ONLY.\n *\n * Note: idStr must not have the \"_\" pre-appended\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int idStr The index within the edit page of the object.\n */\nfunction textToSelect(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='select_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"select_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_term_\"+idStr).val();\n var vocabtype = $(\"#\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr).val();\n var minlength = $(\"#\"+shortName+\"_\"+name+\"_minlength_\"+idStr).val();\n var placeholder = \"Select\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).exists()) {\n placeholder = $(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).val();\n }\n var options = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_defaultOptions_\"+idStr).exists()) {\n options = $(\"#\"+shortName+\"_\"+name+\"_defaultOptions_\"+idStr).val();\n }\n\n cont.html(\"\"+\n \"\" +\n \"\");\n\n if (name == \"citation\")\n scm_source_select_replace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr);\n else\n vocab_select_replace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr, vocabtype, minlength);\n\n }\n });\n}\n\nfunction textToCheckbox(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='checkbox_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^checkbox_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n var placeholderOn = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholderOn_\"+idStr).exists()) {\n placeholderOn = $(\"#\"+shortName+\"_\"+name+\"_placeholderOn_\"+idStr).val();\n }\n var placeholderOff = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholderOff_\"+idStr).exists()) {\n placeholderOff = $(\"#\"+shortName+\"_\"+name+\"_placeholderOff_\"+idStr).val();\n }\n\n var html = \"\";\n if (placeholderOn != \"\") {\n html += \"\";\n }\n if (placeholderOff != \"\") {\n html += \"\";\n }\n\n cont.html(html);\n $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).bootstrapToggle();\n }\n });\n\n\n}\n\n\nfunction checkboxToText(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='checkbox_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^checkbox_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n var checked = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).prop('checked');\n var placeholderOn = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholderOn_\"+idStr).exists()) {\n placeholderOn = $(\"#\"+shortName+\"_\"+name+\"_placeholderOn_\"+idStr).val();\n }\n var placeholderOff = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholderOff_\"+idStr).exists()) {\n placeholderOff = $(\"#\"+shortName+\"_\"+name+\"_placeholderOff_\"+idStr).val();\n }\n\n\n var html = \"\";\n\n html += \"

    \";\n if (checked) {\n if (placeholderOn != \"\")\n html += placeholderOn;\n else\n html += value;\n } else {\n if (placeholderOff != \"\")\n html += placeholderOff;\n }\n html += \"

    \";\n if (placeholderOn != \"\") {\n html += \"\";\n }\n if (placeholderOff != \"\") {\n html += \"\";\n }\n\n $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).bootstrapToggle(\"destroy\");\n cont.html(html);\n }\n });\n\n\n}\n\nfunction textToInput(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='text_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^text_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n var size = 0;\n var sizeStr = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_size_\"+idStr).exists()) {\n size = parseInt($(\"#\"+shortName+\"_\"+name+\"_size_\"+idStr).val());\n sizeStr = \" size='\" + size +\"' \";\n }\n var placeholder = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).exists()) {\n placeholder = $(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).val();\n }\n\n var onKeyUp = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_onKeyUp_\"+idStr).exists()) {\n onKeyUp = $(\"#\"+shortName+\"_\"+name+\"_onKeyUp_\"+idStr).val();\n }\n var onKeyUpStr = \"\";\n if (onKeyUp != \"\") {\n onKeyUpStr = \" onKeyUp='\"+onKeyUp+\"' \";\n }\n\n var html = \"\";\n if (size != 0) {\n html += \"\";\n }\n if (placeholder != \"\") {\n html += \"\";\n }\n if (onKeyUp != \"\") {\n html += \"\";\n }\n\n cont.html(html);\n }\n });\n\n\n}\n\n\nfunction inputToText(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='text_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^text_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n var size = 0;\n if ($(\"#\"+shortName+\"_\"+name+\"_size_\"+idStr).exists()) {\n size = parseInt($(\"#\"+shortName+\"_\"+name+\"_size_\"+idStr).val());\n }\n var placeholder = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).exists()) {\n placeholder = $(\"#\"+shortName+\"_\"+name+\"_placeholder_\"+idStr).val();\n }\n var onKeyUp = \"\";\n if ($(\"#\"+shortName+\"_\"+name+\"_onKeyUp_\"+idStr).exists()) {\n onKeyUp = $(\"#\"+shortName+\"_\"+name+\"_onKeyUp_\"+idStr).val();\n }\n\n var html = \"\";\n html += \"

    \" + value + \"

    \";\n if (size != 0) {\n html += \"\";\n }\n if (placeholder != \"\") {\n html += \"\";\n }\n if (onKeyUp != \"\") {\n html += \"\";\n }\n\n cont.html(html);\n }\n });\n\n\n}\n\n\n\nfunction textToTextArea(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='textarea_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^textarea_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n\n var html = \"\";\n\n cont.html(html);\n }\n });\n}\n\n\nfunction textAreaToText(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='textarea_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(/^textarea_/, \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var value = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n\n //var html = \"\";\n var html = \"\";\n html += \"
    \" + value + \"
    \";\n\n cont.html(html);\n }\n });\n}\n\n/**\n * Change vocabulary selects to divs of inputs\n *\n * Changes all div's with id \"select_\" for a given data object (shortName, idStr) from a select\n * box (edit mode) to a list of inputs defining the parameters to a select (view mode).\n *\n * This function handles VOCABULARY select boxes ONLY.\n *\n * Note: idStr must not have the \"_\" pre-appended\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int idStr The index within the edit page of the object.\n */\nfunction selectToText(shortName, idStr) {\n $(\"div[id^='select_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"select_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr+ \" option:selected\").text();\n var vocabtype = $(\"#\"+shortName+\"_\"+name+\"_vocabtype_\"+idStr).val();\n var minlength = $(\"#\"+shortName+\"_\"+name+\"_minlength_\"+idStr).val();\n\n var additionalStyle = \"\";\n var postText = \"\";\n if (vocabtype == \"name_component\") {\n additionalStyle = \"name-component-type\";\n postText = \" :\";\n }\n\n cont.html(\"\" +\n \"\" +\n \"\" +\n \"\" +\n \"

    \"+term+postText+\"

    \");\n\n }\n });\n}\n\n\nvar geoPlaceLoadResults = null;\n\nfunction textToGeoPlaceSelect(shortName, idStr) {\n $(\"#\"+shortName+\"_datapart_\" + idStr + \" div[id^='selectGeo_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"selectGeo_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_term_\"+idStr).val();\n var placeholder = \"Select Geo Place Term\";\n\n var confirmed = $(\"#\"+shortName+\"_confirmed_\" + idStr).val() == \"true\" ? true : false;\n var firstOptionSelect = \"\";\n var secondOptionSelect = \" selected\";\n if (!confirmed) {\n firstOptionSelect = \" selected\";\n secondOptionSelect = \"\";\n }\n\n cont.html(\"\");\n\n geovocab_select_replace($(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr), \"_\"+idStr);\n\n }\n });\n}\n\nfunction geoPlaceSelectToText(shortName, idStr) {\n $(\"div[id^='selectGeo_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"selectGeo_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var id = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr).val();\n var term = $(\"#\"+shortName+\"_\"+name+\"_id_\"+idStr+ \" option:selected\").text();\n\n cont.html(\"\" +\n \"\");\n\n }\n });\n}\n\n/**\n * Make a data object editable\n *\n * Make the GUI pane for a given constellation object (short, i) editable. Sets up the edit and delete\n * buttons for first-order data objects.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @return boolean False to play nice with the browser\n */\nexport function makeEditable(short, i) {\n // No editing if it's already in edit mode\n if ($(\"#\" + short + \"_operation_\" + i).val() == \"update\")\n return false;\n // If it's deleted, then you better undelete it first\n if ($(\"#\" + short + \"_operation_\" + i).val() == \"delete\")\n setDeleted(short, i);\n\n $(\"#\" + short + \"_editbutton_\" + i).removeClass(\"list-group-item-info\").addClass(\"list-group-item-warning\");\n $(\"#\" + short + \"_editbutton_\" + i).html(\"
    Undo\");\n $(\"#\" + short + \"_editbutton_\" + i).off('click').on(\"click\", function() {\n \tundoEdit(short, i);\n });\n $(\"#\" + short + \"_deletebutton_\" + i).removeClass(\"list-group-item-danger\").addClass(\"disabled\");\n $(\"#\" + short + \"_deletebutton_\" + i).off('click').on(\"click\", function() {\n return false;\n });\n\n $(\"#\" + short + \"_panel_\" + i).removeClass(\"panel-default\").addClass(\"alert-info\").addClass(\"edited-component\");\n\n return subMakeEditable(short, i);\n}\n\n/**\n * Make a data object editable\n *\n * Make the GUI pane for a given constellation object (short, i) editable. Handles removing the read-only\n * statuses and changing divs into selects.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @return boolean False to play nice with the browser\n */\nfunction subMakeEditable(short, i) {\n // No editing if it's already in edit mode\n if ($(\"#\" + short + \"_operation_\" + i).val() == \"update\")\n return false;\n\n // Add to the undo set\n undoSet[short + \"-\" + i] = $(\"#\"+short+\"_datapart_\" + i).clone();\n\n\n textToInput(short, i);\n textToTextArea(short, i);\n textToCheckbox(short, i);\n\n var idstr = \"_\" + i;\n\n // Enable buttons\n $(\"#\"+short+\"_datapart_\" + i + \" button[id^='\"+short+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n obj.removeAttr(\"disabled\").removeClass(\"snac-hidden\");\n }\n });\n // Enable buttons\n $(\"#\"+short+\"_datapart_\" + i + \" a.label\").each(function() {\n $(this).removeClass(\"snac-hidden\");\n });\n\n // Enable checkboxes\n $(\"#\"+short+\"_datapart_\" + i + \" input[type='checkbox']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n obj.bootstrapToggle('enable');\n }\n });\n\n // Turn on CodeMirror Editors\n $(\"#\"+short+\"_datapart_\" + i + \" textarea[id^='\"+short+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr)\n && !obj.attr('id').endsWith(\"ZZ\")) {\n // remove the short name from the string we're parsing\n var idStr = obj.attr('id').replace(short, \"\");\n if (idStr.indexOf('_text_') != -1 || idStr.indexOf('_source_') != -1) {\n obj.get(0).CodeMirror = CodeMirror.fromTextArea(obj.get(0), {\n lineNumbers: true,\n lineWrapping: true,\n viewportMargin: Infinity,\n mode: {name: \"xml\"}\n });\n }\n }\n });\n var sawSelect = false;\n $(\"#\"+short+\"_datapart_\" + i + \" select[id^='\"+short+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n sawSelect = true;\n }\n });\n\n if (!sawSelect) {\n textToSelect(short, i);\n textToGeoPlaceSelect(short, i);\n textToDate(short, i);\n }\n\n // Make things re-orderable if something exists\n // $( \"#nameEntry_component_ui_0\" ).sortable({ // id of the container containing sortable things\n // items : '.name_component' // class of the things that are sortable. They MUST have ids\n // });\n $(\"#\"+short+\"_datapart_\" + i + \" span.move-handle\").each(function() {\n $(this).removeClass(\"snac-hidden\");\n });\n $( \"#\"+short+\"_reorderable_\"+i ).sortable({\n items : '.reorderable',\n opacity : 0.5,\n update : function( event, ui ) {\n var neworder = $( \"#\"+short+\"_reorderable_\"+i ).sortable(\"toArray\");\n console.log(neworder);\n neworder.forEach(function(orderedID, index) {\n $(\"#\"+orderedID + \" input.order-index\").val(index);\n });\n if (short == \"nameEntry\")\n updateNameEntryHeading(i);\n }\n });\n\n // Make the relation pictures update appropriately\n if (short == 'constellationRelation') {\n // make the role dropdown affect the picture\n $('#'+short+'_type_id_'+i).change(function() {\n updatePictureArrow(short, i,\n $('#'+short+'_type_id_'+i+' option:selected').text());\n });\n\n }\n if (short == 'resourceRelation') {\n // make the role dropdown affect the picture\n $('#'+short+'_role_id_'+i).change(function() {\n updatePictureArrow(short, i,\n $('#'+short+'_role_id_'+i+' option:selected').text());\n });\n }\n // Places should update the place heading\n if (short == 'place') {\n // If there is a value pre-set, then automatically confirm and update\n if ($('#'+short+'_geoplace_id_'+i).val() != null && $('#'+short+'_geoplace_id_'+i).val() != \"\") {\n updatePlaceHeading(short, i, $('#'+short+'_geoplace_id_'+i).val());\n }\n // make the role dropdown affect the picture\n $('#'+short+'_geoplace_id_'+i).change(function() {\n updatePlaceHeading(short, i,\n $('#'+short+'_geoplace_id_'+i).val());\n });\n }\n\n // add parser btn if nameEntry is a computed name, entity is person, and if no btn or extra name components already exist\n if (short === 'nameEntry' && ($(\"#entityType\").val() === \"700\") &&\n ($(\"#nameEntry_component_0_panel_\" + i).find('select:first').text() === \"Name\") &&\n (!$(\"#nameEntry_panel_\" + i).find('.name-parser').length &&\n $(\"#nameEntry_component_1_panel_\" + i).length === 0)) {\n $('#nameEntry_component_add_' + i).after('');\n }\n\n // Set this data's operation value appropriately\n if ($(\"#\" + short + \"_id_\" + i).val() != \"\")\n \t$(\"#\" + short + \"_operation_\" + i).val(\"update\");\n else\n \t$(\"#\" + short + \"_operation_\" + i).val(\"insert\");\n\n // Asked to edit something, so make it globally known\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\n return false;\n}\n\n/**\n * Make a data object uneditable\n *\n * Make each object in the GUI page for the given piece uneditable by turning them back to text. Also\n * takes the color away from the pane and removes the operation flag.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @return boolean False to play nice with the browser\n */\nfunction subMakeUneditable(shortName, i) {\n\n\t// Make inputs read-only\n var idstr = \"_\" + i;\n\n\n // Turn off the reordering js\n $(\"#\"+shortName+\"_datapart_\" + i + \" span.move-handle\").each(function() {\n $(this).addClass(\"snac-hidden\");\n });\n if ($( \"#\"+shortName+\"_reorderable_\"+i ).hasClass(\"ui-sortable\"))\n $( \"#\"+shortName+\"_reorderable_\"+i ).sortable(\"destroy\");\n\n // Remove CodeMirror editors\n $(\"#\"+shortName+\"_datapart_\" + i + \" textarea[id^='\"+shortName+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr)\n && !obj.attr('id').endsWith(\"ZZ\")\n && (obj.attr('id').indexOf('_text_') != -1 || obj.attr('id').indexOf('_source_') != -1)) {\n\n if (obj.get(0).CodeMirror) {\n obj.get(0).CodeMirror.toTextArea();\n }\n //(document.getElementById(obj.attr('id'))).CodeMirror.toTextArea();\n //obj.get(0).CodeMirror.toTextArea();\n }\n });\n // Disable buttons\n $(\"#\"+shortName+\"_datapart_\" + i + \" button[id^='\"+shortName+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n obj.attr(\"disabled\", \"true\").addClass(\"snac-hidden\");\n }\n });\n\n // Disable buttons\n $(\"#\"+shortName+\"_datapart_\" + i + \" a.label\").each(function() {\n $(this).addClass(\"snac-hidden\");\n });\n\n // Disable checkboxes\n $(\"#\"+shortName+\"_datapart_\" + i + \" input[type='checkbox']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n obj.bootstrapToggle(\"disable\");\n }\n });\n\n inputToText(shortName, i);\n textAreaToText(shortName, i);\n checkboxToText(shortName, i);\n // Check for a select box\n var sawSelect = false;\n $(\"#\"+shortName+\"_datapart_\" + i + \" select[id^='\"+shortName+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n sawSelect = true;\n }\n });\n // If a select box was seen, undo it\n if (sawSelect) {\n selectToText(shortName, i);\n geoPlaceSelectToText(shortName, i);\n dateToText(shortName,i);\n }\n\n\n // Clear the operation flags\n //$(\"#\" + shortName + \"_operation_\" + i).val(\"\");\n $(\"#\"+shortName+\"_datapart_\" + i + \" input[id^='\"+shortName+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(\"_operation\" + idstr) && !obj.attr('id').endsWith(\"ZZ\")) {\n obj.val(\"\");\n }\n });\n\n\t$(\"#\" + shortName + \"_panel_\" + i).addClass(\"panel-default\").removeClass(\"alert-info\").removeClass(\"edited-component\");\n\n\n\n}\n\n/**\n * Make a data object uneditable\n *\n * Make the GUI pane for a given constellation object (short, i) un-editable. Sets up the edit and delete\n * buttons for first-order data objects, and calls the function to turn the elements back to text.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @return boolean False to play nice with the browser\n */\nexport function makeUneditable(shortName, i) {\n\t// Make inputs read-only\n var idstr = \"_\" + i;\n\n subMakeUneditable(shortName, i);\n\n // restore the edit button\n $(\"#\" + shortName + \"_editbutton_\" + i).addClass(\"list-group-item-info\").removeClass(\"list-group-item-warning\");\n $(\"#\" + shortName + \"_editbutton_\" + i).html(\"
    Edit\");\n $(\"#\" + shortName + \"_editbutton_\" + i).off('click').on(\"click\", function() {\n \tmakeEditable(shortName, i);\n });\n\n // restore the delete button\n $(\"#\" + shortName + \"_deletebutton_\" + i).addClass(\"list-group-item-danger\").removeClass(\"disabled\");\n $(\"#\" + shortName + \"_deletebutton_\" + i).off('click').on(\"click\", function() {\n setDeleted(shortName, i);\n });\n\n return false;\n}\n\n/**\n * Make an SCM data object editable\n *\n * Make the GUI pane for an SCM (j) of a given constellation object (short, i) editable. Sets up the edit and delete\n * buttons for first-order data objects.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @param string|int j The index within the data object SCM list on the edit page of the SCM object.\n * @return boolean False to play nice with the browser\n */\nfunction makeSCMEditable(shortName, i, j) {\n\tvar id = j + \"_\" + i;\n var scmShortName = \"scm_\" + shortName;\n\n // No editing if it's already in edit mode\n if ($(\"#\" + scmShortName + \"_operation_\" + id).val() == \"update\")\n return false;\n // If it's deleted, then you better undelete it first\n if ($(\"#\" + scmShortName + \"_operation_\" + id).val() == \"delete\")\n setSCMDeleted(shortName, i, j);\n\n $(\"#\" + scmShortName + \"_editbutton_\" + id).removeClass(\"list-group-item-info\").addClass(\"list-group-item-warning\");\n $(\"#\" + scmShortName + \"_editbutton_\" + id).html(\"\");\n $(\"#\" + scmShortName + \"_editbutton_\" + id).off('click').on(\"click\", function() {\n \tundoSCMEdit(shortName, i, j);\n });\n $(\"#\" + scmShortName + \"_deletebutton_\" + id).removeClass(\"list-group-item-danger\").addClass(\"disabled\");\n $(\"#\" + scmShortName + \"_deletebutton_\" + id).off('click').on(\"click\", function() {\n return false;\n });\n\n $(\"#\" + scmShortName + \"_panel_\" + id).removeClass(\"panel-default\").addClass(\"alert-info\").addClass(\"edited-component\");\n\n return subMakeEditable(scmShortName, id);\n}\n\n/**\n * Make an SCM data object un-editable\n *\n * Make the GUI pane for an SCM object (j) for a given constellation object (short, i) un-editable. Sets up the edit and delete\n * buttons for SCM data objects.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @param string|int j The index within the data object SCM list on the edit page of the SCM object.\n * @return boolean False to play nice with the browser\n */\nexport function makeSCMUneditable(shortName, i, j) {\n\n\t// Make inputs read-only\n var idstr = j + \"_\" + i;\n\n subMakeUneditable('scm_'+shortName, idstr);\n\n // restore the edit button\n $(\"#scm_\" + shortName + \"_editbutton_\" + idstr).addClass(\"list-group-item-info\").removeClass(\"list-group-item-warning\");\n $(\"#scm_\" + shortName + \"_editbutton_\" + idstr).html(\"\");\n $(\"#scm_\" + shortName + \"_editbutton_\" + idstr).off('click').on(\"click\", function() {\n \tmakeSCMEditable(shortName, i, j);\n });\n\n // restore the delete button\n $(\"#scm_\" + shortName + \"_deletebutton_\" + idstr).addClass(\"list-group-item-danger\").removeClass(\"disabled\");\n $(\"#scm_\" + shortName + \"_deletebutton_\" + idstr).off('click').on(\"click\", function() {\n setSCMDeleted(shortName, i, j);\n });\n\n return false;\n}\n\n/**\n * Set a Contributor Object as deleted\n *\n * Sets the contributor object (shortName, i) as deleted or undeleted and makes the appropriate changes.\n *\n * @param string shortName The short name of the contributor object.\n * @param string|int i The index within the edit page of the object.\n */\nexport function setRepeatedDataDeleted(shortName, i) {\n if ($(\"#\" + shortName + \"_operation_\" + i).val() != \"delete\") {\n $(\"#\" + shortName + \"_remove_\" + i).removeClass(\"btn-danger\").addClass(\"btn-warning\");\n $(\"#\" + shortName + \"_remove_\" + i).html(\"\");\n } else {\n $(\"#\" + shortName + \"_remove_\" + i).removeClass(\"btn-warning\").addClass(\"btn-danger\");\n $(\"#\" + shortName + \"_remove_\" + i).html(\"\");\n }\n\n return subSetDeleted(shortName, i);\n}\n\n/**\n * Set a first-order data object as deleted\n *\n * Sets a first-order data object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n */\nfunction setDeleted(short, i) {\n if ($(\"#\" + short + \"_operation_\" + i).val() != \"delete\") {\n \t// set deleted\n $(\"#\" + short + \"_deletebutton_\" + i).removeClass(\"list-group-item-danger\").addClass(\"list-group-item-warning\");\n $(\"#\" + short + \"_deletebutton_\" + i).html(\"
    Undo\");\n\n // disable edit button\n $(\"#\" + short + \"_editbutton_\" + i).removeClass(\"list-group-item-info\").addClass(\"disabled\");\n $(\"#\" + short + \"_editbutton_\" + i).off('click').on(\"click\", function() {\n return false;\n });\n\n // disable the Date button\n $(\"#\" + short + \"_datebutton_\" + i).removeClass(\"list-group-item-success\").addClass(\"disabled\").prop('disabled', true);\n\n // disable the SCM button\n $(\"#\" + short + \"_scmbutton_\" + i).removeClass(\"list-group-item-success\").addClass(\"disabled\").prop('disabled', true);\n\n } else {\n \t// set undelete\n $(\"#\" + short + \"_deletebutton_\" + i).removeClass(\"list-group-item-warning\").addClass(\"list-group-item-danger\");\n $(\"#\" + short + \"_deletebutton_\" + i).html(\"
    Trash\");\n\n // restore edit button\n $(\"#\" + short + \"_editbutton_\" + i).addClass(\"list-group-item-info\").removeClass(\"disabled\");\n $(\"#\" + short + \"_editbutton_\" + i).off('click').on(\"click\", function() {\n makeEditable(short, i);\n });\n\n // restore the Date button\n $(\"#\" + short + \"_datebutton_\" + i).addClass(\"list-group-item-success\").removeClass(\"disabled\").prop('disabled', false);\n\n // restore the SCM button\n $(\"#\" + short + \"_scmbutton_\" + i).addClass(\"list-group-item-success\").removeClass(\"disabled\").prop('disabled', false);\n\n }\n\n return subSetDeleted(short, i);\n}\n\n/**\n * Make the delete/undelete happen\n *\n * Actually performs the changes to the object, affecting the operation and panel color.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @return boolean False to play nice with the browser\n */\nfunction subSetDeleted(short, i) {\n if ($(\"#\" + short + \"_operation_\" + i).val() != \"delete\") {\n \t// set deleted\n \t$(\"#\" + short + \"_panel_\" + i).removeClass(\"panel-default\").addClass(\"alert-danger\").addClass(\"deleted-component\");\n\n $(\"#\" + short + \"_operation_\" + i).val(\"delete\");\n } else {\n \t// set undelete\n \t$(\"#\" + short + \"_panel_\" + i).removeClass(\"alert-danger\").addClass(\"panel-default\").removeClass(\"deleted-component\");\n\n // If this thing was deleted but is supposed to be an update, then return it back to update status\n var sawSelect = false;\n $(\"select[id^='\"+short+\"_']\").each(function() {\n var obj = $(this);\n if(obj.attr('id').endsWith(\"_\" + i) && !obj.attr('id').endsWith(\"ZZ\")) {\n sawSelect = true;\n }\n });\n if (sawSelect) {\n \t if ($(\"#\" + short + \"_id_\" + i).val() != \"\")\n \t \t$(\"#\" + short + \"_operation_\" + i).val(\"update\");\n \t else\n \t \t$(\"#\" + short + \"_operation_\" + i).val(\"insert\");\n } else {\n \t$(\"#\" + short + \"_operation_\" + i).val(\"\");\n }\n\n }\n\n // Asked to delete something, so make it globally known\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\n return false;\n}\n\n/**\n * Set an SCM data object as deleted\n *\n * Sets an SCM object (j) for a constellation object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page.\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @param string|int j The index within the data object SCM list on the edit page of the SCM object.\n */\nfunction setSCMDeleted(short, i, j) {\n\tvar id = j + '_' + i;\n if ($(\"#scm_\" + short + \"_operation_\" + id).val() != \"delete\") {\n \t// set deleted\n $(\"#scm_\" + short + \"_deletebutton_\" + id).removeClass(\"list-group-item-danger\").addClass(\"list-group-item-warning\");\n $(\"#scm_\" + short + \"_deletebutton_\" + id).html(\"\");\n\n // disable edit button\n $(\"#scm_\" + short + \"_editbutton_\" + id).removeClass(\"list-group-item-info\").addClass(\"disabled\");\n $(\"#scm_\" + short + \"_editbutton_\" + id).off('click').on(\"click\", function() {\n return false;\n });\n\n } else {\n \t// set undelete\n $(\"#scm_\" + short + \"_deletebutton_\" + id).removeClass(\"list-group-item-warning\").addClass(\"list-group-item-danger\");\n $(\"#scm_\" + short + \"_deletebutton_\" + id).html(\"\");\n\n // restore edit button\n $(\"#scm_\" + short + \"_editbutton_\" + id).addClass(\"list-group-item-info\").removeClass(\"disabled\");\n $(\"#scm_\" + short + \"_editbutton_\" + id).off('click').on(\"click\", function() {\n makeSCMEditable(short, i, j);\n });\n\n }\n\n return subSetDeleted(\"scm_\"+short, id);\n}\n\n/**\n * Turn on the Edit/Delete buttons for an object\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n */\nfunction turnOnButtons(shortName, i) {\n\n // Turn on the edit button\n $(\"#\"+shortName+\"_editbutton_\"+i).on(\"click\", function() {\n makeEditable(shortName, i);\n });\n\n // Turn on the delete buttons\n $(\"#\"+shortName+\"_deletebutton_\"+i).on(\"click\", function() {\n setDeleted(shortName, i);\n });\n}\n\nfunction turnOnTooltips(shortName, i) {\n // Load tooltips\n $(function () {\n $('#'+shortName+'_panel_'+ i +' [data-toggle=\"tooltip\"]').tooltip()\n })\n\n // Load popovers\n $(function () {\n $('#'+shortName+'_panel_'+ i +' [data-toggle=\"popover\"]').popover({\n trigger: 'hover',\n container: 'body'\n })\n })\n\n\n}\n\n/**\n * Turn on the Edit/Delete buttons for an SCM object\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int i The index within the edit page of the object.\n * @param string|int j The index within the data object SCM list on the edit page of the SCM object.\n */\nfunction turnOnSCMButtons(shortName, i, j) {\n\n // Turn on the edit button\n $(\"#scm_\"+shortName+\"_editbutton_\"+j+\"_\"+i).on(\"click\", function() {\n makeSCMEditable(shortName, i, j);\n });\n\n // Turn on the delete buttons\n $(\"#scm_\"+shortName+\"_deletebutton_\"+j+\"_\"+i).on(\"click\", function() {\n setSCMDeleted(shortName, i, j);\n });\n}\n\n/**\n * Create a new Address Line object on page\n *\n * Puts a new Place Address Line object DIV on the page and attaches it correctly to the DOM and javascript.\n *\n * @param int i The index on the page of the place to add this component to\n * @return boolean false to play nice with the browser.\n */\nexport function newAddressLine(i) {\n\tvar nextid = 1;\n\tif ($('#place_address_next_j_'+i).exists()) {\n\t nextid = parseInt($('#place_address_next_j_'+i).text());\n\t}\n\tconsole.log(\"Creating new address line for place \" + i + \" with id: \" + nextid);\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#addressline_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid);\n $('#place_address_add_div_'+i).before(html);\n\n $('#place_address_' + nextid + '_operation_' + 1).val(\"insert\");\n subMakeEditable(\"place_address_\" + nextid, i);\n\n vocab_select_replace($(\"#place_address_\"+nextid+\"_type_id_\"+i), \"_\"+i, 'address_part', 0);\n\n // Put the updated version number back in the DOM\n $('#place_address_next_j_'+i).text(++nextid);\n\n return false;\n}\n\n/**\n * Create a new Resource Relation Origination Name object on page\n *\n * Puts a new Resource Relation Origination Name object DIV on the page and attaches it correctly to the DOM and javascript.\n *\n * @param int i The index on the page of the Resource Relation to add this Origination Name to\n * @return boolean false to play nice with the browser.\n */\nfunction newOriginationName(i) {\n\tvar nextid = 1;\n\tif ($('#resource_originationName_next_j_'+i).exists()) {\n\t nextid = parseInt($('#resource_originationName_next_j_'+i).text());\n\t}\n\tconsole.log(\"Creating new origination name for resource \" + i + \" with id: \" + nextid);\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#originationName_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid);\n $('#resource_originationName_add_div_'+i).before(html);\n\n $('#resource_originationName_' + nextid + '_operation_' + 1).val(\"insert\");\n subMakeEditable(\"resource_originationName_\" + nextid, i);\n\n // Put the updated version number back in the DOM\n $('#resource_originationName_next_j_'+i).text(++nextid);\n\n return false;\n}\n\n\n/**\n * Create a new Name Entry Component object on page\n *\n * Puts a new Name Entry component object DIV on the page and attaches it correctly to the DOM and javascript.\n *\n * @param int i The index on the page of the nameEntry to add this component to\n * @return boolean false to play nice with the browser.\n */\nexport function newNameEntryComponent(i) {\n removeParserButton(i);\n\tvar nextid = 1;\n\tif ($('#nameEntry_component_next_j_'+i).exists()) {\n\t nextid = parseInt($('#nameEntry_component_next_j_'+i).text());\n\t}\n\tconsole.log(\"Creating new name entry component for nameEntry \" + i + \" with id: \" + nextid);\n\n // add parser btn if entity is person, and if no btn or other name components already exist\n if (($(\"#entityType\").val() === \"700\") && (nextid == 0) &&\n (!$(\"#nameEntry_panel_\" + i).find('.name-parser').length &&\n $(\"#nameEntry_component_1_panel_\" + i).length === 0)) {\n $('#nameEntry_component_add_' + i).after('');\n }\n\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\n var text = $('#component_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid);\n $('#nameEntry_component_add_div_'+i).before(html);\n\n $('#nameEntry_component_' + nextid + '_operation_' + 1).val(\"insert\");\n subMakeEditable(\"nameEntry_component_\" + nextid, i);\n\n vocab_select_replace($(\"#nameEntry_component_\"+nextid+\"_type_id_\"+i), \"_\"+i, 'name_component', 0);\n\n // Put the updated version number back in the DOM\n $('#nameEntry_component_next_j_'+i).text(++nextid);\n\n return false;\n}\n\nexport function updateNameEntryHeading(i) {\n var text = \"\";\n var components = [];\n\n $(\"#nameEntry_panel_\"+i+\" div[id^='nameEntry_component_']\").each(function() {\n var obj = $(this);\n if (!obj.hasClass(\"deleted-component\") && obj.attr('id').endsWith(\"_panel_\" + i)\n && !obj.attr('id').endsWith(\"ZZ\")) {\n var j = obj.attr('id').replace(\"nameEntry_component_\", \"\").replace(\"_panel_\"+i, \"\");\n var type = $(\"#nameEntry_component_\"+j+\"_type_id_\"+i+\" option:selected\").text();\n var partText = $(\"#nameEntry_component_\"+j+\"_text_\"+i).val();\n\n components.push([type, partText]);\n }\n });\n\n var entityType = $(\"#entityType option:selected\").text();\n text = combineNameHeading(components, entityType);\n\n\n $(\"#nameEntry_heading_\"+i).text(text.trim());\n $(\"#nameEntry_original_\"+i).val(text.trim());\n}\n\n\n/**\n * Create a new Name Entry Rules object on page\n *\n * Puts a new Name Entry rule object DIV on the page and attaches it correctly to the DOM and javascript.\n *\n * @param int i The index on the page of the nameEntry to add this rule to\n * @return boolean false to play nice with the browser.\n */\nexport function newNameEntryRule(i) {\n\tvar nextid = 1;\n\tif ($('#nameEntry_rule_next_j_'+i).exists()) {\n\t nextid = parseInt($('#nameEntry_rule_next_j_'+i).text());\n\t}\n\tconsole.log(\"Creating new name entry rule for nameEntry \" + i + \" with id: \" + nextid);\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#rule_template').clone();\n var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid);\n $('#nameEntry_rule_add_div_'+i).before(html);\n\n $('#nameEntry_rule_' + nextid + '_operation_' + 1).val(\"insert\");\n turnOnTooltips(\"nameEntry_rule_\" + nextid, i);\n subMakeEditable(\"nameEntry_rule_\" + nextid, i);\n\n // Put the updated version number back in the DOM\n $('#nameEntry_rule_next_j_'+i).text(++nextid);\n\n return false;\n}\n\n/**\n * Parse a date string into parts\n */\nfunction parseDate(dateString) {\n var pieces = dateString.split(\"-\");\n if (pieces.length == 3)\n return {\n year : parseInt(pieces[0]),\n month : parseInt(pieces[1]),\n day : parseInt(pieces[2])\n };\n else if (pieces.length == 2)\n return {\n year : parseInt(pieces[0]),\n month : parseInt(pieces[1]),\n day : ''\n };\n else if (pieces.length == 1 && pieces[0] != '')\n return {\n year : parseInt(pieces[0]),\n month : '',\n day : ''\n };\n else return {\n year : '', month : '', day : ''\n }\n}\n\n/**\n * Change date input divs to select and boxes\n *\n * Changes all div's with id \"date_\" for a given data object (shortName, idStr) from a list of\n * inputs defining the parameters (view mode) to a inputs and a select (edit mode). It then\n * calls the select2 function to replace the select with one matching the rest of the page.\n *\n * Note: idStr must not have the \"_\" pre-appended\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int idStr The index within the edit page of the object.\n */\nfunction textToDate(shortName, idStr) {\n $(\"div[id^='date_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"date_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n var dateStr = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n\n var dateParts = parseDate(dateStr);\n\n var html = \"\";\n html += \" - \";\n html += \" \";\n html += \" - \";\n html += \" \";\n html += \"\";\n cont.html(html);\n\n $(\"#\"+shortName+\"_\"+name+\"_month_\"+idStr).select2({\n width: '57%',\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Month'\n });\n\n }\n });\n}\n\n/**\n * Pad an integer\n *\n * This is a helper function to pad an integer with 0s for display. This is useful to pad\n * a month or day with a leading 0.\n *\n * @param int|string num The number to pad\n * @param int size The total width of the desired output\n * @return string A string containing a size-wide integer representation, 0-padded\n */\nfunction pad(num, size) {\n var s = num+\"\";\n while (s.length < size) s = \"0\" + s;\n return s;\n}\n\n/**\n * Updates the standard date input field\n *\n * If the date for the data object (shortName, idStr) has been turned into a 3-field edit\n * area, then this function will update the hidden standard date (YYYY-MM-DD) field with the\n * newest values from the human-enterable field.\n *\n * Note: idStr must not have the \"_\" pre-appended\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int idStr The index within the edit page of the object.\n */\nexport function updateDate(shortName, idStr) {\n $(\"div[id^='date_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"date_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n\n if ($(\"#\"+shortName+\"_\"+name+\"_year_\"+idStr).exists()) {\n var year = $(\"#\"+shortName+\"_\"+name+\"_year_\"+idStr).val();\n var day = $(\"#\"+shortName+\"_\"+name+\"_day_\"+idStr).val();\n var month = $(\"#\"+shortName+\"_\"+name+\"_month_\"+idStr+ \" option:selected\").val();\n\n var dateStr = \"\";\n if (year != \"\") {\n dateStr += pad(year, 4);\n if (month != \"\") {\n dateStr += \"-\" + pad(month,2);\n if (day != \"\") {\n dateStr += \"-\" + pad(day,2);\n }\n }\n }\n\n $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val(dateStr);\n }\n\n }\n });\n}\n\n/**\n * Return editable date area back to text\n *\n * If the date for the data object (shortName, idStr) has been turned into a 3-field edit\n * area, then this function will return the editable area back to the view mode text, replacing\n * the edit boxes with a paragraph containing the computed standard date string (YYYY-MM-DD).\n *\n * Note: idStr must not have the \"_\" pre-appended\n *\n * @param string shortName The short name of the data object, such as \"nameEntry\" or \"occupation\"\n * @param string|int idStr The index within the edit page of the object.\n */\nfunction dateToText(shortName, idStr) {\n $(\"div[id^='date_\"+shortName+\"']\").each(function() {\n var cont = $(this);\n if(cont.attr('id').endsWith(\"_\"+idStr) && !cont.attr('id').endsWith(\"ZZ\")) {\n // remove the short name and \"select_\" from the string we're parsing\n var divStr = cont.attr('id').replace(\"date_\", \"\").replace(shortName + \"_\", \"\");\n // remove the idstr to receive the name of this element\n var regex = new RegExp(\"\\_\"+idStr+\"$\", \"g\");\n var name = divStr.replace(regex, \"\");\n\n updateDate(shortName, idStr);\n\n\n var dateStr = $(\"#\"+shortName+\"_\"+name+\"_\"+idStr).val();\n\n var html = \"

    \"+dateStr+\"

    \";\n html += \"\";\n cont.html(html);\n\n }\n });\n}\n\n\n// TODO: If we want to show a DIV of edited and deleted components, we should use the following two functions\n// to get copies of the edited/deleted components from the page. We can then insert those copies onto a modal\n// dialog box with a \"Save\" or \"Continue\" button at the top and bottom.\n//\n// All the pieces shown in the dialog should be disabled. One way to do this would be using the following\n// method to place a semi-transparent div on top of the editable pieces, making them appear to be grayed out\n// and with the not permitted cursor.\n//\n// .append('
    ');\n//\n// Note: this modal should NOT be inside the constellation form so that we don't submit the values twice.\n\n/**\n * Get all the edited components\n */\nfunction getEdited() {\n var html = \"\";\n\n $(\"#constellation_form div.edited-component\").each(function() {\n var cont = $(this);\n console.log(cont.attr('id'));\n var pieces = cont.attr('id').split(\"_panel_\");\n if (pieces.length == 2) {\n html += \"
    \" + $(\"#\"+pieces[0] + \"_datapart_\" + pieces[1]).html() + \"
    \";\n }\n });\n\n return html;\n}\n\n/**\n * Get all the deleted components\n */\nfunction getDeleted() {\n var html = \"\";\n\n $(\"#constellation_form div.deleted-component\").each(function() {\n var cont = $(this);\n console.log(cont.attr('id'));\n var pieces = cont.attr('id').split(\"_panel_\");\n if (pieces.length == 2) {\n html += \"
    \" + $(\"#\"+pieces[0] + \"_datapart_\" + pieces[1]).html() + \"
    \";\n }\n });\n\n return html;\n}\n\nfunction turnOnEditDeleteButtons(part='') {\n var divID = '';\n if (part != '')\n divID = \"#\" + part + \" \";\n // Turn on the edit buttons\n $(divID + \"a[id*='editbutton']\").each(function() {\n var obj = $(this);\n var pieces = obj.attr('id').split(\"_\");\n\n if (pieces.length == 3) {\n var short = pieces[0];\n var i = pieces[2];\n obj.on(\"click\", function() {\n makeEditable(short, i);\n });\n } else if (pieces.length == 5 && pieces[0] == \"scm\") {\n var short = pieces[1];\n var i = pieces[4];\n var j = pieces[3];\n obj.on(\"click\", function() {\n makeSCMEditable(short, i, j);\n });\n } else if (pieces.length == 5) {\n var short = pieces[0] + \"_\" + pieces[1] + \"_\" + pieces[2];\n var i = pieces[4];\n obj.on(\"click\", function() {\n makeEditable(short, i);\n });\n }\n });\n\n // Turn on the delete buttons\n $(divID + \"a[id*='deletebutton']\").each(function() {\n var obj = $(this);\n var pieces = obj.attr('id').split(\"_\");\n\n if (pieces.length == 3) {\n var short = pieces[0];\n var i = pieces[2];\n obj.on(\"click\", function() {\n setDeleted(short, i);\n });\n } else if (pieces.length == 5 && pieces[0] == \"scm\") {\n var short = pieces[1];\n var i = pieces[4];\n var j = pieces[3];\n obj.on(\"click\", function() {\n setSCMDeleted(short, i, j);\n });\n } else if (pieces.length == 5) {\n var short = pieces[0] + \"_\" + pieces[1] + \"_\" + pieces[2];\n var i = pieces[4];\n obj.on(\"click\", function() {\n setDeleted(short, i);\n });\n }\n });\n}\n\nfunction turnOnTooltipsForTab(part='') {\n var divID = '';\n if (part != '')\n divID = \"#\" + part + \" \";\n // Load tooltips\n $(function () {\n $(divID + '[data-toggle=\"tooltip\"]').tooltip()\n })\n\n // Load popovers\n $(function () {\n $(divID + '[data-toggle=\"popover\"]').popover({\n trigger: 'hover',\n container: 'body'\n })\n })\n\n}\n\nfunction updatePictureArrow(shortName, i, newValue) {\n $('#'+shortName+'_relationPictureArrow_'+i).text(newValue);\n}\n\nfunction updatePictureTitle(shortName, i, newValue) {\n $('#'+shortName+'_relationPictureTitle_'+i).text(newValue);\n}\n\nfunction updatePictureIcon(shortName, i, entityType) {\n var html = \"\";\n if (entityType == 'person')\n html = '
    ';\n else if (entityType == 'corporateBody')\n html = '
    ';\n else if (entityType == 'family')\n html = '
    ';\n $('#'+shortName+'_relationPictureIcon_'+i).html(html);\n}\n\n\nvar geoPlaceLoadResults = null;\n\nfunction loadGeoPlaceResultCache() {\n $(\"input[id^='place_geoplace_id_']\").each(function() {\n var obj = $(this);\n // Query for term by ajax\n if (obj.val() != null && obj.val() != \"\") {\n $.get(snacUrl+\"/vocabulary/read?type=geoPlace&id=\"+obj.val(), null, function (data) {\n // Check the return value from the ajax. If success, then go to dashboard\n if (data.term) {\n if (!geoPlaceLoadResults)\n geoPlaceLoadResults = new Array();\n geoPlaceLoadResults.push(data.term);\n }\n });\n }\n });\n}\n\nexport function chooseSuggestedGeoPlace(selectID, idStr, value) {\n // idStr == id number on the page\n var obj = $(\"#\"+selectID);\n obj.select2('destroy');\n obj.val(value);\n geovocab_select_replace(obj, \"_\"+idStr);\n updatePlaceHeading(\"place\", idStr, value);\n}\n\nfunction updatePlaceHeading(shortName, i, newValue) {\n var place = null;\n if (!geoPlaceSearchResults && !geoPlaceLoadResults) {\n $('#'+shortName+'_confirmed_'+i).val(\"false\");\n $('#'+shortName+'_geoterm_text_'+i).html(\"Unconfirmed\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).addClass(\"disabled\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).prop('onclick',null).off(\"click\");\n if ($('#'+shortName+'_original_'+i).val() != \"\")\n $('#'+shortName+'_geoterm_caption_'+i).text(\"Recorded as: \" + $('#'+shortName+'_original_'+i).val());\n else\n $('#'+shortName+'_geoterm_caption_'+i).text();\n return;\n }\n\n if (geoPlaceSearchResults) {\n geoPlaceSearchResults.forEach(function(result) {\n if (result.id == newValue)\n place = result;\n });\n }\n\n if (!place && geoPlaceLoadResults) {\n geoPlaceLoadResults.forEach(function(result) {\n if (result.id == newValue)\n place = result;\n });\n }\n\n if (!place) {\n $('#'+shortName+'_confirmed_'+i).val(\"false\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).addClass(\"disabled\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).off(\"click\");\n if ($('#'+shortName+'_original_'+i).val() != \"\") {\n $('#'+shortName+'_geoterm_text_'+i).html(\"Unconfirmed\");\n $('#'+shortName+'_geoterm_caption_'+i).text(\"Recorded as: \" + $('#'+shortName+'_original_'+i).val());\n } else {\n $('#'+shortName+'_geoterm_text_'+i).text(\"--\");\n $('#'+shortName+'_geoterm_caption_'+i).text(\"GeoPlace term not specified\");\n }\n return;\n }\n $('#'+shortName+'_confirmed_'+i).val(\"true\");\n $('#'+shortName+'_geoterm_text_'+i).text(place.name);\n $('#'+shortName+'_geoterm_caption_'+i).text(place.administrationCode + \", \" + place.countryCode);\n if (place.latitude && place.longitude) {\n $('#'+shortName+\"_geoterm_maplink_\"+i).prop('onclick',null).off(\"click\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).on(\"click\", function() {openGeoPlaceViewer(place.id); return false;});\n $('#'+shortName+\"_geoterm_maplink_\"+i).removeClass(\"disabled\");\n } else {\n $('#'+shortName+\"_geoterm_maplink_\"+i).addClass(\"disabled\");\n $('#'+shortName+\"_geoterm_maplink_\"+i).prop('onclick',null).off(\"click\");\n }\n\n\n}\n\nexport function magicDefaultFill(selectID, vocabType) {\n if (typeof(defaults[vocabType]) !== undefined) {\n\n var data = {\n id: defaults[vocabType].id,\n text: defaults[vocabType].term\n };\n\n // If the selected item exists, then select it. Else, add a new option\n // and select it.\n if ($('#'+selectID).find(\"option[value='\" + data.id + \"']\").length) {\n $('#'+selectID).val(data.id).trigger('change');\n } else {\n var newOption = new Option(data.text, data.id, false, true);\n $('#'+selectID).append(newOption).trigger('change');\n }\n }\n\n}\n\nfunction capitalize(word) {\n return word[0].toUpperCase() + word.slice(1);\n}\n\nfunction parseName(e) {\n $('#name-parser-options').text('');\n var $nameComponents = $(e.target).closest('.name-components');\n\n var $partType = $nameComponents.find(\"select:last\");\n var $textbox = $nameComponents.find('input[type=\"text\"]:last');\n\n var name = $textbox.val();\n\n var entityType = $('#entityType').text().trim();\n $('#name-parser-type').text(capitalize(entityType));\n $('#name-parser-original').text(name);\n\n var parser = new NameParser();\n var guesses = parser.guessPerson(name);\n\n var parsedOption = '';\n\n var counter = 0;\n guesses.forEach(function(guess) {\n // attach name data object to radio\n for (var key in guess) {\n if (guess[key] && guess[key].length != 0) {\n parsedOption += \"
  • \" + key + \": \" + guess[key] + \"
  • \";\n }\n }\n\n $('#name-parser-options').append(\"
    \" +\n \"
    \");\n\n\n $('#name-parser-options').find(\"input[type='radio']:last\").data(\"parsed-name\", guess);\n\n parsedOption = '';\n counter++;\n })\n\n $('#name-parser-options').find(\"input[type='radio']:first\").prop('checked', true)\n\n\n $('#parser-accept-btn').unbind('click')\n $('#parser-accept-btn').on('click', function() {\n var selectedName = $('#name-parser input[type=\"radio\"]:checked').data('parsed-name')\n $.get( snacUrl + \"/vocabulary/?type=name_component&entity_type=700\")\n .done(function(data) {\n acceptParsedName(selectedName, $nameComponents, name, data.results)\n })\n })\n}\n\nfunction acceptParsedName(selectedName, $nameComponents, name, nameComponentIDs) {\n var i = $nameComponents.attr('id').split('_')[2];\n var $nameComponent = $nameComponents.find('.reorderable'); ///\n $nameComponent.replaceWith('
    Name: ' + name + '
    ');\n\n var nameComponentMap = {};\n\n for (var k = 0; k < nameComponentIDs.length; k++) {\n nameComponentMap[nameComponentIDs[k].text] = nameComponentIDs[k].id\n }\n // var nameComponentMap = {\n // 'Surname': 400223,\n // 'Forename': 400224,\n // 'NameAddition': 400236,\n // 'Date': 400237,\n // 'NameExpansion': 400226,\n // 'Numeration': 400225\n // };\n\n for (var key in selectedName) {\n if (key == 'NameAdditions') {\n key = 'NameAddition';\n for (var j = 0; j < selectedName['NameAdditions'].length; j++) {\n newNameEntryComponent(i);\n var option = new Option(key, nameComponentMap[key], false, true);\n $partType = $nameComponents.find(\"select:last\");\n $partType.append(option).trigger('change');\n $textbox = $nameComponents.find(\"input[type='text']:last\");\n $textbox.val(selectedName[\"NameAdditions\"][j]);\n\n $partType.append(option).trigger('change');\n }\n } else if (selectedName[key] && nameComponentMap[key]) {\n newNameEntryComponent(i);\n var option = new Option(key, nameComponentMap[key], false, true);\n $partType = $nameComponents.find(\"select:last\");\n $partType.append(option).trigger('change');\n $textbox = $nameComponents.find(\"input[type='text']:last\");\n $textbox.val(selectedName[key]);\n\n $partType.append(option).trigger('change');\n }\n }\n\n $(\"#nameEntry_datapart_\" + i).find(\".name-parser\").remove();\n updateNameEntryHeading(i);\n}\n\nfunction removeParserButton(i) {\n $('#nameEntry_datapart_' + i).find('.name-parser').remove();\n}\n\n/**\n * Things to do when the page finishes loading\n */\n$(document).ready(function() {\n // Load the place cache, if needed\n loadGeoPlaceResultCache();\n\n // listen for name-parsing\n $('#nameEntries').on('click', '.name-parser', function(event) {\n event.preventDefault();\n parseName(event);\n $(\"#name-parser\").modal('toggle');\n });\n\n $('#name-parser').on('shown.bs.modal', function () {\n $('#parser-accept-btn').focus();\n })\n\n // If the constellation is in \"insert\" mode, then we should automatically set \"somethingHasBeenEdited\"\n // to be true...\n if ($('#operation').val() == 'insert')\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\n turnOnEditDeleteButtons();\n\n\t// Attach functions to the entityType select\n\tif ($('#entityType').exists()) {\n\t\t$('#entityType').change(function() {\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n // If there is an ID, then we need to set this to update\n // Else, the main-level operation should be and remain insert\n\t\t\tif ($('#constellationid').val() != null &&\n\t\t\t\t\t$('#constellationid').val() != \"\") {\n\t\t\t\t$('#operation').val(\"update\");\n\t\t\t}\n\t\t});\n\t}\n\n // Name Entry doesn't get any AJAX, since it is pre-loaded\n\tvar nameEntryid = 1;\n\tif ($('#next_nameEntry_i').exists()) {\n\t nameEntryid = parseInt($('#next_nameEntry_i').text());\n\t}\n\tconsole.log(\"Next NameEntry ID: \" + nameEntryid);\n\tif ($('#btn_add_nameEntry').exists()){\n\t\t$('#btn_add_nameEntry').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n\t\t\tvar text = $('#nameEntry_template').clone();\n\t var html = text.html().replace(/ZZ/g, nameEntryid);\n\t $('#add_nameEntry_div').after(html);\n turnOnButtons(\"nameEntry\", nameEntryid);\n turnOnTooltips(\"nameEntry\", nameEntryid);\n makeEditable(\"nameEntry\", nameEntryid);\n\t nameEntryid = nameEntryid + 1;\n\t return false;\n\t\t});\n\t}\n\n\n\t// Attach functions to each of the \"+ Add New _______\" buttons\n\n\t// Code to handle adding new genders to the page\n\tvar genderid = 1;\n var genderOpen = false;\n\tif ($('#genderstab').exists()){\n\t\t$('#genderstab').click(function(){\n // Don't open a second time\n if (genderOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=genders\", null, function (data) {\n genderOpen = true;\n $('#genders').html(data);\n\n turnOnEditDeleteButtons(\"genders\");\n\n if ($('#next_gender_i').exists()) {\n genderid = parseInt($('#next_gender_i').text());\n }\n console.log(\"Next Gender ID: \" + genderid);\n if ($('#btn_add_gender').exists()){\n $('#btn_add_gender').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#gender_template').clone();\n var html = text.html().replace(/ZZ/g, genderid);\n $('#add_gender_div').after(html);\n turnOnButtons(\"gender\", genderid);\n turnOnTooltips(\"gender\", genderid);\n makeEditable(\"gender\", genderid);\n genderid = genderid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"genders\");\n });\n });\n }\n\n\t// Code to handle adding new genders to the page\n\tvar existid = 1;\n var existOpen = false;\n\tif ($('#existstab').exists()){\n\t\t$('#existstab').click(function(){\n // Don't open a second time\n if (existOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=dates\", null, function (data) {\n existOpen = true;\n $('#dates').html(data);\n\n turnOnEditDeleteButtons(\"dates\");\n\n if ($('#next_exist_i').exists()) {\n existid = parseInt($('#next_exist_i').text());\n }\n console.log(\"Next Exist Date ID: \" + existid);\n if ($('#btn_add_exist_date').exists()){\n $('#btn_add_exist_date').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#exist_date_template').clone();\n var html = text.html().replace(/ZZ/g, existid);\n $('#add_exist_div').after(html);\n turnOnButtons(\"exist\", existid);\n turnOnTooltips(\"exist\", existid);\n makeEditable(\"exist\", existid);\n existid = existid + 1;\n return false;\n });\n }\n if ($('#btn_add_exist_dateRange').exists()){\n $('#btn_add_exist_dateRange').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#exist_dateRange_template').clone();\n var html = text.html().replace(/ZZ/g, existid);\n $('#add_exist_div').after(html);\n turnOnButtons(\"exist\", existid);\n turnOnTooltips(\"exist\", existid);\n makeEditable(\"exist\", existid);\n existid = existid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"dates\");\n });\n });\n }\n\n\tvar sameAsid = 1;\n var sameAsOpen = false;\n\tif ($('#sameAstab').exists()){\n\t\t$('#sameAstab').click(function(){\n // Don't open a second time\n if (sameAsOpen)\n return;\n //set sameAs vocab type id\n $.get(snacUrl+\"/vocabulary?type=record_type&q=SameAs\", null, function(data) {\n sameAsTermId = data.results[0].id;\n $(\"#sameAs_type_id_ZZ\").val(sameAsTermId);\n });\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=sameAs\", null, function (data) {\n sameAsOpen = true;\n $('#sameAs').html(data);\n\n turnOnEditDeleteButtons(\"sameAs\");\n\n if ($('#next_sameAs_i').exists()) {\n sameAsid = parseInt($('#next_sameAs_i').text());\n }\n console.log(\"Next sameAs ID: \" + sameAsid);\n if ($('#btn_add_sameAs').exists()){\n $('#btn_add_sameAs').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#sameAs_template').clone();\n var html = text.html().replace(/ZZ/g, sameAsid);\n $('#add_sameAs_div').after(html);\n turnOnButtons(\"sameAs\", sameAsid);\n turnOnTooltips(\"sameAs\", sameAsid);\n makeEditable(\"sameAs\", sameAsid);\n sameAsid = sameAsid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"sameAs\");\n });\n });\n }\n\n\n\tvar entityIDid = 1;\n var entityIDOpen = false;\n\tif ($('#entityIDtab').exists()){\n\t\t$('#entityIDtab').click(function(){\n // Don't open a second time\n if (entityIDOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=entityID\", null, function (data) {\n entityIDOpen = true;\n $('#entityID').html(data);\n\n turnOnEditDeleteButtons(\"entityID\");\n\n if ($('#next_entityID_i').exists()) {\n entityIDid = parseInt($('#next_entityID_i').text());\n }\n console.log(\"Next entityID ID: \" + entityIDid);\n if ($('#btn_add_entityID').exists()){\n $('#btn_add_entityID').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#entityID_template').clone();\n var html = text.html().replace(/ZZ/g, entityIDid);\n $('#add_entityID_div').after(html);\n turnOnButtons(\"entityID\", entityIDid);\n turnOnTooltips(\"entityID\", entityIDid);\n makeEditable(\"entityID\", entityIDid);\n entityIDid = entityIDid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"entityID\");\n });\n });\n }\n\n\tvar sourceid = 1;\n var sourceOpen = false;\n\tif ($('#sourcestab').exists()){\n\t\t$('#sourcestab').click(function(){\n // Don't open a second time\n if (sourceOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=sources\", null, function (data) {\n sourceOpen = true;\n $('#sources').html(data);\n\n turnOnEditDeleteButtons(\"sources\");\n\n if ($('#next_source_i').exists()) {\n sourceid = parseInt($('#next_source_i').text());\n }\n console.log(\"Next source ID: \" + sourceid);\n if ($('#btn_add_source').exists()){\n $('#btn_add_source').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#source_template').clone();\n var html = text.html().replace(/ZZ/g, sourceid);\n $('#add_source_div').after(html);\n turnOnButtons(\"source\", sourceid);\n turnOnTooltips(\"source\", sourceid);\n makeEditable(\"source\", sourceid);\n sourceid = sourceid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"sources\");\n });\n });\n }\n\n\tvar resourceRelationid = 1;\n var resourceRelationOpen = false;\n\tif ($('#resourceRelationstab').exists()){\n\t\t$('#resourceRelationstab').click(function(){\n // Don't open a second time\n if (resourceRelationOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=resourceRelations\", null, function (data) {\n resourceRelationOpen = true;\n $('#resourceRelations').html(data);\n\n turnOnEditDeleteButtons(\"resourceRelations\");\n\n if ($('#next_resourceRelation_i').exists()) {\n resourceRelationid = parseInt($('#next_resourceRelation_i').text());\n }\n console.log(\"Next resourceRelation ID: \" + resourceRelationid);\n if ($('#btn_create_resourceRelation').exists()){\n $('#btn_create_resourceRelation').click(function(){\n var rid = $('input[name=resourceChoice]:checked', '#resource_search_form').val();\n if (rid != null && resourceResults != null && rid != 'new') {\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#resourceRelation_template').clone();\n var html = text.html().replace(/ZZ/g, resourceRelationid);\n $('#add_resourceRelation_div').after(html);\n\n if (typeof resourceResults[rid].id !== 'undefined')\n $('#resourceRelation_resourceid_'+resourceRelationid).val(resourceResults[rid].id);\n if (typeof resourceResults[rid].version !== 'undefined')\n $('#resourceRelation_resourceversion_'+resourceRelationid).val(resourceResults[rid].version);\n\n if (typeof resourceResults[rid].link !== 'undefined')\n $('#resourceRelation_linkText_'+resourceRelationid).html(\"\"+resourceResults[rid].link+\"\" +\n \" View\");\n if (typeof resourceResults[rid].displayEntry !== 'undefined')\n $('#resourceRelation_displayEntryText_'+resourceRelationid).text(resourceResults[rid].displayEntry);\n if (typeof resourceResults[rid].title !== 'undefined') {\n $('#resourceRelation_titleText_'+resourceRelationid).text(resourceResults[rid].title);\n updatePictureTitle('resourceRelation', resourceRelationid, resourceResults[rid].title);\n }\n if (typeof resourceResults[rid].abstract !== 'undefined')\n $('#resourceRelation_abstractText_'+resourceRelationid).text(resourceResults[rid].abstract);\n if (typeof resourceResults[rid].extent !== 'undefined')\n $('#resourceRelation_extentText_'+resourceRelationid).text(resourceResults[rid].extent);\n // if (typeof resourceResults[rid].date !== 'undefined')\n // $('#resourceRelation_dateText_'+resourceRelationid).text(resourceResults[rid].date);\n if (typeof resourceResults[rid].documentType !== 'undefined' && typeof resourceResults[rid].documentType.term !== 'undefined')\n $('#resourceRelation_documentTypeText_'+resourceRelationid).text(resourceResults[rid].documentType.term);\n\n $('#resourceRelation_linkText_'+resourceRelationid).after(\"View in SNAC\");\n turnOnButtons(\"resourceRelation\", resourceRelationid);\n turnOnTooltips(\"resourceRelation\", resourceRelationid);\n makeEditable(\"resourceRelation\", resourceRelationid);\n resourceRelationid = resourceRelationid + 1;\n $(\"#resource-results-box\").html(\"\");\n return true;\n }\n return false;\n });\n }\n\n if ($('#btn_open_create_resource').exists()){\n $('#btn_open_create_resource').click(function(){\n // Close this modal and open the new modal\n $(\"#resourceSearchPane\").modal(\"hide\");\n\n // Set a 500ms timeout to give the hidden search pane time to fully close\n setTimeout(function() {$(\"#resourceCreatePane\").modal(\"show\");}, 500);\n\n // Grab the empty template and replace\n var text = $('#resource_template').clone();\n var html = text.html().replace(/ZZ/g, 0);\n $('#resource-create-box').html(html);\n var $resourceForm = $(\"#resource_create_form\");\n // Copy the search contents to title or href\n if ($(\"#resource-searchbox\").val().indexOf(\"http\") == -1)\n $resourceForm.find(\"#resource-title\").val($(\"#resource-searchbox\").val());\n else\n $resourceForm.find(\"#resource-url\").val($(\"#resource-searchbox\").val());\n\n $resourceForm.find('[data-toggle=\"popover\"]').popover({\n trigger: 'hover',\n container: 'body'\n });\n loadVocabSelectOptions($resourceForm.find(\"#resource-type-select\"), \"document_type\", \"Resource Type\");\n vocab_select_replace($resourceForm.find(\"#resource-repo\"), \"\", \"holding\", 3);\n $resourceForm.find(\"#new-resource-language-btn\").on(\"click\", newResourceLanguage);\n $resourceForm.find(\"#magic-resource-language-btn\").on(\"click\", magicNewResourceLanguage);\n\n $('#search-results-box').on(\"click\", \"a.list-group-item\", selectHoldingRepository);\n var timeoutID = null;\n $resourceForm.find('#searchbox').keyup(function() {\n clearTimeout(timeoutID);\n timeoutID = setTimeout(function() { setSearchPosition(0); searchAndUpdate(); }, 500);\n });\n\n // Remove the search results from the other modal\n $(\"#resource-results-box\").html(\"\");\n return false;\n });\n }\n\n if ($('#btn_create_resource').exists()){\n $('#resource_create_form').on(\"submit\", function(){\n // Remove leading and trailing whitespace\n if ($(\"#resource_create_form #resource-url\").val() == \"\") {\n if (!confirm('Are you sure you want to save without an HREF?')) {\n return;\n }\n }\n $(\"#resource_create_form input, textarea\").each(function() {\n $(this).val($.trim($(this).val()));\n });\n setDeletedResourceLanguageOperations($(\"#resource_create_form\"));\n\n $.post(snacUrl+\"/save_resource\", $(\"#resource_create_form\").serialize(), function (data) {\n if (typeof data.result !== 'undefined' && data.result !== 'false') {\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#resourceRelation_template').clone();\n var html = text.html().replace(/ZZ/g, resourceRelationid); // clones DOM, replaces zz with next ids\n $('#add_resourceRelation_div').after(html);\n\n if (typeof data.resource.id !== 'undefined')\n $('#resourceRelation_resourceid_'+resourceRelationid).val(data.resource.id);\n if (typeof data.resource.version !== 'undefined')\n $('#resourceRelation_resourceversion_'+resourceRelationid).val(data.resource.version);\n\n if (typeof data.resource.link !== 'undefined')\n $('#resourceRelation_linkText_'+resourceRelationid).html(\"\"+data.resource.link+\"\" +\n \" View\");\n if (typeof data.resource.displayEntry !== 'undefined')\n $('#resourceRelation_displayEntryText_'+resourceRelationid).text(data.resource.displayEntry);\n if (typeof data.resource.title !== 'undefined') {\n $('#resourceRelation_titleText_'+resourceRelationid).text(data.resource.title);\n updatePictureTitle('resourceRelation', resourceRelationid, data.resource.title);\n }\n if (typeof data.resource.abstract !== 'undefined')\n $('#resourceRelation_abstractText_'+resourceRelationid).text(data.resource.abstract);\n if (typeof data.resource.extent !== 'undefined')\n $('#resourceRelation_extentText_'+resourceRelationid).text(data.resource.extent);\n if (typeof data.resource.documentType !== 'undefined' && typeof data.resource.documentType.term !== 'undefined')\n $('#resourceRelation_documentTypeText_'+resourceRelationid).text(data.resource.documentType.term);\n\n $('#resourceRelation_linkText_'+resourceRelationid).after(\"View in SNAC\");\n turnOnButtons(\"resourceRelation\", resourceRelationid);\n turnOnTooltips(\"resourceRelation\", resourceRelationid);\n makeEditable(\"resourceRelation\", resourceRelationid);\n resourceRelationid = resourceRelationid + 1;\n $(\"#resourceCreatePane\").modal(\"hide\");\n $('#resource-create-box').html(\"\");\n return true;\n } else {\n console.log(data);\n return false;\n }\n });\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"resourceRelations\");\n });\n });\n }\n\n\n\tvar constellationRelationid = 1;\n var constellationRelationOpen = false;\n\tif ($('#constellationRelationstab').exists()){\n\t\t$('#constellationRelationstab').click(function(){\n // Don't open a second time\n if (constellationRelationOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=constellationRelations\", null, function (data) {\n constellationRelationOpen = true;\n $('#constellationRelations').html(data);\n\n turnOnEditDeleteButtons(\"constellationRelations\");\n\n if ($('#next_constellationRelation_i').exists()) {\n constellationRelationid = parseInt($('#next_constellationRelation_i').text());\n }\n console.log(\"Next constellationRelation ID: \" + constellationRelationid);\n if ($('#btn_create_constellationRelation').exists()){\n $('#btn_create_constellationRelation').click(function(){\n var cid = $('input[name=relationChoice]:checked', '#relation_search_form').val()\n if (cid != null) {\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#constellationRelation_template').clone();\n var html = text.html().replace(/ZZ/g, constellationRelationid);\n $('#add_constellationRelation_div').after(html);\n $('#constellationRelation_targetID_'+constellationRelationid).val(cid);\n $('#constellationRelation_content_'+constellationRelationid).val($('#relationChoice_nameEntry_'+cid).val());\n $('#constellationRelation_targetArkID_'+constellationRelationid).val($('#relationChoice_arkID_'+cid).val());\n $('#constellationRelation_targetEntityType_'+constellationRelationid).val($('#relationChoice_entityType_'+cid).val());\n\n updatePictureIcon('constellationRelation', constellationRelationid, $('#relationChoice_entityTypeText_'+cid).val());\n updatePictureTitle('constellationRelation', constellationRelationid, $('#relationChoice_nameEntry_'+cid).val());\n\n $('#constellationRelation_contentText_'+constellationRelationid).text($('#relationChoice_nameEntry_'+cid).val());\n $('#constellationRelation_targetArkIDText_'+constellationRelationid).text($('#relationChoice_arkID_'+cid).val());\n\n turnOnButtons(\"constellationRelation\", constellationRelationid);\n turnOnTooltips(\"constellationRelation\", constellationRelationid);\n makeEditable(\"constellationRelation\", constellationRelationid);\n\n constellationRelationid = constellationRelationid + 1;\n\n return true;\n\n }\n\n\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"constellationRelations\");\n });\n });\n }\n\n\tvar languageid = 1;\n var languageOpen = false;\n\tif ($('#languagesUsedtab').exists()){\n\t\t$('#languagesUsedtab').click(function(){\n // Don't open a second time\n if (languageOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=languagesUsed\", null, function (data) {\n languageOpen = true;\n $('#languagesUsed').html(data);\n\n turnOnEditDeleteButtons(\"languagesUsed\");\n\n if ($('#next_language_i').exists()) {\n languageid = parseInt($('#next_language_i').text());\n }\n console.log(\"Next language ID: \" + languageid);\n if ($('#btn_add_language').exists()){\n $('#btn_add_language').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#language_template').clone();\n var html = text.html().replace(/ZZ/g, languageid);\n $('#add_language_div').after(html);\n turnOnButtons(\"language\", languageid);\n turnOnTooltips(\"language\", languageid);\n makeEditable(\"language\", languageid);\n languageid = languageid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"languagesUsed\");\n });\n });\n }\n\n\tvar subjectid = 1;\n var subjectOpen = false;\n\tif ($('#subjectstab').exists()){\n\t\t$('#subjectstab').click(function(){\n // Don't open a second time\n if (subjectOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=subjects\", null, function (data) {\n subjectOpen = true;\n $('#subjects').html(data);\n\n turnOnEditDeleteButtons(\"subjects\");\n\n if ($('#next_subject_i').exists()) {\n subjectid = parseInt($('#next_subject_i').text());\n }\n console.log(\"Next subject ID: \" + subjectid);\n if ($('#btn_add_subject').exists()){\n $('#btn_add_subject').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#subject_template').clone();\n var html = text.html().replace(/ZZ/g, subjectid);\n $('#add_subject_div').after(html);\n turnOnButtons(\"subject\", subjectid);\n turnOnTooltips(\"subject\", subjectid);\n makeEditable(\"subject\", subjectid);\n subjectid = subjectid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"subjects\");\n });\n });\n }\n\n\tvar nationalityid = 1;\n var nationalityOpen = false;\n\tif ($('#nationalitiestab').exists()){\n\t\t$('#nationalitiestab').click(function(){\n // Don't open a second time\n if (nationalityOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=nationalities\", null, function (data) {\n nationalityOpen = true;\n $('#nationalities').html(data);\n\n turnOnEditDeleteButtons(\"nationalities\");\n\n if ($('#next_nationality_i').exists()) {\n nationalityid = parseInt($('#next_nationality_i').text());\n }\n console.log(\"Next nationality ID: \" + nationalityid);\n if ($('#btn_add_nationality').exists()){\n $('#btn_add_nationality').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#nationality_template').clone();\n var html = text.html().replace(/ZZ/g, nationalityid);\n $('#add_nationality_div').after(html);\n turnOnButtons(\"nationality\", nationalityid);\n turnOnTooltips(\"nationality\", nationalityid);\n makeEditable(\"nationality\", nationalityid);\n nationalityid = nationalityid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"nationalities\");\n });\n });\n }\n\n\tvar functionid = 1;\n var functionOpen = false;\n\tif ($('#functionstab').exists()){\n\t\t$('#functionstab').click(function(){\n // Don't open a second time\n if (functionOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=functions\", null, function (data) {\n functionOpen = true;\n $('#functions').html(data);\n\n turnOnEditDeleteButtons(\"functions\");\n\n if ($('#next_function_i').exists()) {\n functionid = parseInt($('#next_function_i').text());\n }\n console.log(\"Next function ID: \" + functionid);\n if ($('#btn_add_function').exists()){\n $('#btn_add_function').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#function_template').clone();\n var html = text.html().replace(/ZZ/g, functionid);\n $('#add_function_div').after(html);\n turnOnButtons(\"function\", functionid);\n turnOnTooltips(\"function\", functionid);\n makeEditable(\"function\", functionid);\n functionid = functionid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"functions\");\n });\n });\n }\n\n\tvar occupationid = 1;\n var occupationOpen = false;\n\tif ($('#occupationstab').exists()){\n\t\t$('#occupationstab').click(function(){\n // Don't open a second time\n if (occupationOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=occupations\", null, function (data) {\n occupationOpen = true;\n $('#occupations').html(data);\n\n turnOnEditDeleteButtons(\"occupations\");\n\n if ($('#next_occupation_i').exists()) {\n occupationid = parseInt($('#next_occupation_i').text());\n }\n console.log(\"Next occupation ID: \" + occupationid);\n if ($('#btn_add_occupation').exists()){\n $('#btn_add_occupation').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#occupation_template').clone();\n var html = text.html().replace(/ZZ/g, occupationid);\n $('#add_occupation_div').after(html);\n turnOnButtons(\"occupation\", occupationid);\n turnOnTooltips(\"occupation\", occupationid);\n makeEditable(\"occupation\", occupationid);\n occupationid = occupationid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"occupations\");\n });\n });\n }\n\n\tvar legalStatusid = 1;\n var legalStatusOpen = false;\n\tif ($('#legalStatusestab').exists()){\n\t\t$('#legalStatusestab').click(function(){\n // Don't open a second time\n if (legalStatusOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=legalStatuses\", null, function (data) {\n legalStatusOpen = true;\n $('#legalStatuses').html(data);\n\n turnOnEditDeleteButtons(\"legalStatuses\");\n\n if ($('#next_legalStatus_i').exists()) {\n legalStatusid = parseInt($('#next_legalStatus_i').text());\n }\n console.log(\"Next legalStatus ID: \" + legalStatusid);\n if ($('#btn_add_legalStatus').exists()){\n $('#btn_add_legalStatus').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#legalStatus_template').clone();\n var html = text.html().replace(/ZZ/g, legalStatusid);\n $('#add_legalStatus_div').after(html);\n turnOnButtons(\"legalStatus\", legalStatusid);\n turnOnTooltips(\"legalStatus\", legalStatusid);\n makeEditable(\"legalStatus\", legalStatusid);\n legalStatusid = legalStatusid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"legalStatuses\");\n });\n });\n }\n\n\tvar placeid = 1;\n var placeOpen = false;\n\tif ($('#placestab').exists()){\n\t\t$('#placestab').click(function(){\n // Don't open a second time\n if (placeOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=places\", null, function (data) {\n placeOpen = true;\n $('#places').html(data);\n\n // Load the place cache, if needed\n loadGeoPlaceResultCache();\n\n turnOnEditDeleteButtons(\"places\");\n\n if ($('#next_place_i').exists()) {\n placeid = parseInt($('#next_place_i').text());\n }\n console.log(\"Next place ID: \" + placeid);\n if ($('#btn_add_place').exists()){\n $('#btn_add_place').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#place_template').clone();\n var html = text.html().replace(/ZZ/g, placeid);\n $('#add_place_div').after(html);\n turnOnButtons(\"place\", placeid);\n turnOnTooltips(\"place\", placeid);\n makeEditable(\"place\", placeid);\n placeid = placeid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"places\");\n });\n });\n }\n\n\tvar conventionDeclarationid = 1;\n var conventionDeclarationOpen = false;\n\tif ($('#conventionDeclarationstab').exists()){\n\t\t$('#conventionDeclarationstab').click(function(){\n // Don't open a second time\n if (conventionDeclarationOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=conventionDeclarations\", null, function (data) {\n conventionDeclarationOpen = true;\n $('#conventionDeclarations').html(data);\n\n turnOnEditDeleteButtons(\"conventionDeclarations\");\n\n if ($('#next_conventionDeclaration_i').exists()) {\n conventionDeclarationid = parseInt($('#next_conventionDeclaration_i').text());\n }\n console.log(\"Next conventionDeclaration ID: \" + conventionDeclarationid);\n if ($('#btn_add_conventionDeclaration').exists()){\n $('#btn_add_conventionDeclaration').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#conventionDeclaration_template').clone();\n var html = text.html().replace(/ZZ/g, conventionDeclarationid);\n $('#add_conventionDeclaration_div').after(html);\n turnOnButtons(\"conventionDeclaration\", conventionDeclarationid);\n turnOnTooltips(\"conventionDeclaration\", conventionDeclarationid);\n makeEditable(\"conventionDeclaration\", conventionDeclarationid);\n conventionDeclarationid = conventionDeclarationid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"conventionDeclarations\");\n });\n });\n }\n\n\tvar generalContextid = 1;\n var generalContextOpen = false;\n\tif ($('#generalContextstab').exists()){\n\t\t$('#generalContextstab').click(function(){\n // Don't open a second time\n if (generalContextOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=generalContexts\", null, function (data) {\n generalContextOpen = true;\n $('#generalContexts').html(data);\n\n turnOnEditDeleteButtons(\"generalContexts\");\n\n if ($('#next_generalContext_i').exists()) {\n generalContextid = parseInt($('#next_generalContext_i').text());\n }\n console.log(\"Next generalContext ID: \" + generalContextid);\n if ($('#btn_add_generalContext').exists()){\n $('#btn_add_generalContext').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#generalContext_template').clone();\n var html = text.html().replace(/ZZ/g, generalContextid);\n $('#add_generalContext_div').after(html);\n turnOnButtons(\"generalContext\", generalContextid);\n turnOnTooltips(\"generalContext\", generalContextid);\n makeEditable(\"generalContext\", generalContextid);\n generalContextid = generalContextid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"generalContexts\");\n });\n });\n }\n\n\tvar structureOrGenealogyid = 1;\n var structureOrGenealogyOpen = false;\n\tif ($('#structureOrGenealogiestab').exists()){\n\t\t$('#structureOrGenealogiestab').click(function(){\n // Don't open a second time\n if (structureOrGenealogyOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=structureOrGenealogies\", null, function (data) {\n structureOrGenealogyOpen = true;\n $('#structureOrGenealogies').html(data);\n\n turnOnEditDeleteButtons(\"structureOrGenealogies\");\n\n if ($('#next_structureOrGenealogy_i').exists()) {\n structureOrGenealogyid = parseInt($('#next_structureOrGenealogy_i').text());\n }\n console.log(\"Next structureOrGenealogy ID: \" + structureOrGenealogyid);\n if ($('#btn_add_structureOrGenealogy').exists()){\n $('#btn_add_structureOrGenealogy').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#structureOrGenealogy_template').clone();\n var html = text.html().replace(/ZZ/g, structureOrGenealogyid);\n $('#add_structureOrGenealogy_div').after(html);\n turnOnButtons(\"structureOrGenealogy\", structureOrGenealogyid);\n turnOnTooltips(\"structureOrGenealogy\", structureOrGenealogyid);\n makeEditable(\"structureOrGenealogy\", structureOrGenealogyid);\n structureOrGenealogyid = structureOrGenealogyid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"structureOrGenealogies\");\n });\n });\n }\n\n\tvar mandateid = 1;\n var mandateOpen = false;\n\tif ($('#mandatestab').exists()){\n\t\t$('#mandatestab').click(function(){\n // Don't open a second time\n if (mandateOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=mandates\", null, function (data) {\n mandateOpen = true;\n $('#mandates').html(data);\n\n turnOnEditDeleteButtons(\"mandates\");\n\n if ($('#next_mandate_i').exists()) {\n mandateid = parseInt($('#next_mandate_i').text());\n }\n console.log(\"Next mandate ID: \" + mandateid);\n if ($('#btn_add_mandate').exists()){\n $('#btn_add_mandate').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#mandate_template').clone();\n var html = text.html().replace(/ZZ/g, mandateid);\n $('#add_mandate_div').after(html);\n turnOnButtons(\"mandate\", mandateid);\n turnOnTooltips(\"mandate\", mandateid);\n makeEditable(\"mandate\", mandateid);\n mandateid = mandateid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"mandates\");\n });\n });\n }\n\n\tvar biogHistid = 1;\n var biogHistOpen = false;\n\tif ($('#biogHiststab').exists()){\n\t\t$('#biogHiststab').click(function(){\n // Don't open a second time\n if (biogHistOpen)\n return;\n\n $.get(snacUrl+\"/edit_part/\"+$('#constellationid').val()+\"/\"+$('#version').val()+\"?part=biogHists\", null, function (data) {\n biogHistOpen = true;\n $('#biogHists').html(data);\n\n turnOnEditDeleteButtons(\"biogHists\");\n\n if ($('#next_biogHist_i').exists()) {\n biogHistid = parseInt($('#next_biogHist_i').text());\n }\n console.log(\"Next biogHist ID: \" + biogHistid);\n if ($('#btn_add_biogHist').exists()){\n $('#btn_add_biogHist').click(function(){\n setEditedFlag(true);\n //somethingHasBeenEdited = true;\n var text = $('#biogHist_template').clone();\n var html = text.html().replace(/ZZ/g, biogHistid);\n $('#add_biogHist_div').after(html);\n turnOnButtons(\"biogHist\", biogHistid);\n turnOnTooltips(\"biogHist\", biogHistid);\n makeEditable(\"biogHist\", biogHistid);\n biogHistid = biogHistid + 1;\n return false;\n });\n }\n\n turnOnTooltipsForTab(\"biogHists\");\n });\n });\n }\n\n turnOnTooltipsForTab();\n\n\n $(\"#info-dropdown\").click(function(e) {\n $(this).parent().toggleClass(\"open\");\n e.stopPropagation();\n });\n\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/resource_admin.js b/src/virtualhosts/www/javascript/resource_admin.js index 27a28e900..956ca2c30 100644 --- a/src/virtualhosts/www/javascript/resource_admin.js +++ b/src/virtualhosts/www/javascript/resource_admin.js @@ -1,3 +1,4 @@ +!function(e,n){for(var t in n)e[t]=n[t]}(window,function(e){var n={};function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var a in e)t.d(r,a,function(n){return e[n]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){"use strict"; /** * Resource Admin Actions * @@ -8,184 +9,5 @@ * @copyright 2015 the Rector and Visitors of the University of Virginia, and * the Regents of the University of California */ - -function saveResource(event) { - event.preventDefault(); - var $form = $(event.target); - - if ($form.find("#resource-url").val() == "") { - if (!confirm('Are you sure you want to save without an HREF?')) { - return; - } - } - $('#notification-message').slideDown().html("

    Saving Resource... Please wait.

    "); - - // Remove leading and trailing whitespace - $form.find("input, textarea").each(function() { - $(this).val($.trim($(this).val())); - }); - - setDeletedResourceLanguageOperations($form); - - $.post(snacUrl + "/save_resource", $form.serialize()) - .done(function(data) { - createdResource = data; - if (typeof(data.resource) === 'undefined') { - $('#error-message').slideDown(); - return false; - } - $('#notification-message').slideUp(); - $('#success-message').slideDown(); - setTimeout(function() { - window.location = (snacUrl + "/vocab_administrator/resources/" + data.resource.id); - }, 1000); - }) - .fail(function() { - $('#error-message').slideDown(); - }); - return false; -} - - -function setDeletedResourceLanguageOperations($form) { - // Set deleted new languages to null, set deleted existing languages to delete - var $deletedLanguages = $form.find("#resource-languages .component-deleted").has('input[id]'); - var $ignoredLanguages = $form.find("#resource-languages .component-deleted.new-language"); - setOperations($deletedLanguages, "delete"); - setOperations($ignoredLanguages, ""); -} - -function cancelResource() { - if (!confirm('Are you sure you want to cancel?')) { - return; - } - - $('#notification-message').html("

    Cancelling...

    "); - $('#notification-message').slideDown(); - setTimeout(function() { - window.location.href = snacUrl + "/vocab_administrator"; - }, 1000); - return false; -} - -/** - * New Resource Language - * Copies the resource template DIV on the page and attaches it correctly to the DOM. - * Tracks language index using $('#language-template').data('languageCount') - * - */ -function newResourceLanguage(event) { - event.preventDefault(); - var $newLanguage = $('#resource-language-template').find(".language").clone(); - var data = $('#resource-language-template').data(); - var newLanguageID = 'language_' + data.languageCount; - $newLanguage.attr('id', newLanguageID); - $newLanguage.find('.operation').val('insert'); - $newLanguage.addClass('new-language'); - - //update input names with new data.languageCount - $newLanguage.find('input, select').attr('name', function(i, name) { - return name.replace('YY', data.languageCount); - }); - - console.log('Adding new resource language with id: ', newLanguageID); - $newLanguage.toggle(); - // selects last to avoid conflict on multiple clones - $('.add-resource-language:last').before($newLanguage); - enableLanguageSelect($newLanguage); - - data.languageCount++; - return $newLanguage; -} - -/** - * Delete or Undo Language - * - * Toggles component-deleted class, and btn classes for delete and undo. - * Does not change operations. - * - */ -function deleteOrUndoLanguage(event) { - event.preventDefault(); - var $btn = $(event.currentTarget); - $btn.toggleClass('btn-danger btn-warning'); - $btn.find(':only-child').toggleClass('fa-minus-circle fa-undo'); - var $language = $btn.closest('.language'); - $language.toggleClass('alert-danger component-deleted'); -} - - -function setOperations($elements, operation) { - $elements.find('.operation').each(function() { - $(this).val(operation); - }); -} - -/** - * Mark Edited Resource Fields - * - * Adds edited-field class to altered inputs. Sets altered resource language to update. - * @param jqueryObject $resourceForm jQuery object to modify - * - */ -function markEditedResourceFields($resourceForm) { - $resourceForm.find("input, select, textarea").on("change", function(e) { - $(e.target).addClass('edited-field'); - - if ($(e.target).closest('.language').length) { - setOperations($(e.target).closest('.language'), "update"); - } - }); -} - -function enableVocabularySelect(selectItem, type) { - selectItem.select2({ - ajax: { - url: snacUrl + "/vocabulary?type=" + type, - dataType: 'json', - delay: 250, - data: function(params) { - return { - q: params.term, - page: params.page - }; - }, - processResults: function(data, page) { - return { - results: data.results - }; - }, - cache: true - }, - width: '100%', - minimumInputLength: 0, - allowClear: true, - theme: 'bootstrap', - placeholder: 'Select' - }); -} - -function enableLanguageSelect($language) { - enableVocabularySelect($language.find("select:first"), 'language_code'); - enableVocabularySelect($language.find("select:last"), 'script_code'); -} - - -function magicNewResourceLanguage(event) { - var $newLanguage = newResourceLanguage(event); - var defaultLanguage = new Option(defaults.language.term, defaults.language.id, false, true); - var defaultScript = new Option(defaults.script.term, defaults.script.id, false, true); - $newLanguage.find("select:first").append(defaultLanguage).trigger('change'); - $newLanguage.find("select:last").append(defaultScript).trigger('change'); -} - -function selectHoldingRepository(event) { - event.preventDefault(); - var name = event.target.innerHTML; - var id = event.target.href.split('/').pop(); - var selectedRepo = new Option(name, id, false, true); - $(".resource-repo:last").append(selectedRepo).trigger('change'); - $("#search_form").slideToggle(); - $("#search-results-box").html(""); - $("#searchbox").val(""); -} +function r(e){e.preventDefault();var n=$(e.target);if(""!=n.find("#resource-url").val()||confirm("Are you sure you want to save without an HREF?"))return $("#notification-message").slideDown().html("

    Saving Resource... Please wait.

    "),n.find("input, textarea").each((function(){$(this).val($.trim($(this).val()))})),a(n),$.post(snacUrl+"/save_resource",n.serialize()).done((function(e){if(createdResource=e,void 0===e.resource)return $("#error-message").slideDown(),!1;$("#notification-message").slideUp(),$("#success-message").slideDown(),setTimeout((function(){window.location=snacUrl+"/vocab_administrator/resources/"+e.resource.id}),1e3)})).fail((function(){$("#error-message").slideDown()})),!1}function a(e){var n=e.find("#resource-languages .component-deleted").has("input[id]"),t=e.find("#resource-languages .component-deleted.new-language");l(n,"delete"),l(t,"")}function o(){if(confirm("Are you sure you want to cancel?"))return $("#notification-message").html("

    Cancelling...

    "),$("#notification-message").slideDown(),setTimeout((function(){window.location.href=snacUrl+"/vocab_administrator"}),1e3),!1}function u(e){e.preventDefault();var n=$("#resource-language-template").find(".language").clone(),t=$("#resource-language-template").data(),r="language_"+t.languageCount;return n.attr("id",r),n.find(".operation").val("insert"),n.addClass("new-language"),n.find("input, select").attr("name",(function(e,n){return n.replace("YY",t.languageCount)})),console.log("Adding new resource language with id: ",r),n.toggle(),$(".add-resource-language:last").before(n),d(n),t.languageCount++,n}function i(e){e.preventDefault();var n=$(e.currentTarget);n.toggleClass("btn-danger btn-warning"),n.find(":only-child").toggleClass("fa-minus-circle fa-undo"),n.closest(".language").toggleClass("alert-danger component-deleted")}function l(e,n){e.find(".operation").each((function(){$(this).val(n)}))}function s(e){e.find("input, select, textarea").on("change",(function(e){$(e.target).addClass("edited-field"),$(e.target).closest(".language").length&&l($(e.target).closest(".language"),"update")}))}function c(e,n){e.select2({ajax:{url:snacUrl+"/vocabulary?type="+n,dataType:"json",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e,n){return{results:e.results}},cache:!0},width:"100%",minimumInputLength:0,allowClear:!0,theme:"bootstrap",placeholder:"Select"})}function d(e){c(e.find("select:first"),"language_code"),c(e.find("select:last"),"script_code")}function g(e){var n=u(e),t=new Option(defaults.language.term,defaults.language.id,!1,!0),r=new Option(defaults.script.term,defaults.script.id,!1,!0);n.find("select:first").append(t).trigger("change"),n.find("select:last").append(r).trigger("change")}function f(e){e.preventDefault();var n=e.target.innerHTML,t=e.target.href.split("/").pop(),r=new Option(n,t,!1,!0);$(".resource-repo:last").append(r).trigger("change"),$("#search_form").slideToggle(),$("#search-results-box").html(""),$("#searchbox").val("")}t.r(n),t.d(n,"saveResource",(function(){return r})),t.d(n,"setDeletedResourceLanguageOperations",(function(){return a})),t.d(n,"cancelResource",(function(){return o})),t.d(n,"newResourceLanguage",(function(){return u})),t.d(n,"deleteOrUndoLanguage",(function(){return i})),t.d(n,"markEditedResourceFields",(function(){return s})),t.d(n,"enableLanguageSelect",(function(){return d})),t.d(n,"magicNewResourceLanguage",(function(){return g})),t.d(n,"selectHoldingRepository",(function(){return f}))}])); +//# sourceMappingURL=resource_admin.js.map \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/resource_admin.js.map b/src/virtualhosts/www/javascript/resource_admin.js.map new file mode 100644 index 000000000..08bf80aa8 --- /dev/null +++ b/src/virtualhosts/www/javascript/resource_admin.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/virtualhosts/www/javascript/src/resource_admin.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","saveResource","event","preventDefault","$form","$","target","find","val","confirm","slideDown","html","each","this","trim","setDeletedResourceLanguageOperations","post","snacUrl","serialize","done","data","createdResource","resource","slideUp","setTimeout","window","location","id","fail","$deletedLanguages","has","$ignoredLanguages","setOperations","cancelResource","href","newResourceLanguage","$newLanguage","clone","newLanguageID","languageCount","attr","addClass","replace","console","log","toggle","before","enableLanguageSelect","deleteOrUndoLanguage","$btn","currentTarget","toggleClass","closest","$elements","operation","markEditedResourceFields","$resourceForm","on","e","length","enableVocabularySelect","selectItem","type","select2","ajax","url","dataType","delay","params","q","term","page","processResults","results","cache","width","minimumInputLength","allowClear","theme","placeholder","$language","magicNewResourceLanguage","defaultLanguage","Option","defaults","language","defaultScript","script","append","trigger","selectHoldingRepository","innerHTML","split","pop","selectedRepo","slideToggle"],"mappings":"4DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAo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Q,UAClErD,EAAa7B,KAAK,eAAeiF,OAAOF,GAAeG,QAAQ,UAG5D,SAASC,EAAwBxF,GACpCA,EAAMC,iBACN,IAAI3B,EAAO0B,EAAMI,OAAOqF,UACpBhE,EAAKzB,EAAMI,OAAO4B,KAAK0D,MAAM,KAAKC,MAClCC,EAAe,IAAIX,OAAO3G,EAAMmD,GAAI,GAAO,GAC/CtB,EAAE,uBAAuBmF,OAAOM,GAAcL,QAAQ,UACtDpF,EAAE,gBAAgB0F,cAClB1F,EAAE,uBAAuBM,KAAK,IAC9BN,EAAE,cAAcG,IAAI,IA7LxB","file":"resource_admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Resource Admin Actions\n *\n * Contains code that handles Resource creation and editing\n *\n * @author Joseph Glass\n * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause\n * @copyright 2015 the Rector and Visitors of the University of Virginia, and\n * the Regents of the University of California\n */\n\nexport function saveResource(event) {\n event.preventDefault();\n var $form = $(event.target);\n\n if ($form.find(\"#resource-url\").val() == \"\") {\n if (!confirm('Are you sure you want to save without an HREF?')) {\n return;\n }\n }\n $('#notification-message').slideDown().html(\"

    Saving Resource... Please wait.

    \");\n\n // Remove leading and trailing whitespace\n $form.find(\"input, textarea\").each(function() {\n $(this).val($.trim($(this).val()));\n });\n\n setDeletedResourceLanguageOperations($form);\n\n $.post(snacUrl + \"/save_resource\", $form.serialize())\n .done(function(data) {\n createdResource = data;\n if (typeof(data.resource) === 'undefined') {\n $('#error-message').slideDown();\n return false;\n }\n $('#notification-message').slideUp();\n $('#success-message').slideDown();\n setTimeout(function() {\n window.location = (snacUrl + \"/vocab_administrator/resources/\" + data.resource.id);\n }, 1000);\n })\n .fail(function() {\n $('#error-message').slideDown();\n });\n return false;\n}\n\n\nexport function setDeletedResourceLanguageOperations($form) {\n // Set deleted new languages to null, set deleted existing languages to delete\n var $deletedLanguages = $form.find(\"#resource-languages .component-deleted\").has('input[id]');\n var $ignoredLanguages = $form.find(\"#resource-languages .component-deleted.new-language\");\n setOperations($deletedLanguages, \"delete\");\n setOperations($ignoredLanguages, \"\");\n}\n\nexport function cancelResource() {\n if (!confirm('Are you sure you want to cancel?')) {\n return;\n }\n\n $('#notification-message').html(\"

    Cancelling...

    \");\n $('#notification-message').slideDown();\n setTimeout(function() {\n window.location.href = snacUrl + \"/vocab_administrator\";\n }, 1000);\n return false;\n}\n\n/**\n * New Resource Language\n * Copies the resource template DIV on the page and attaches it correctly to the DOM.\n * Tracks language index using $('#language-template').data('languageCount')\n *\n */\nexport function newResourceLanguage(event) {\n event.preventDefault();\n var $newLanguage = $('#resource-language-template').find(\".language\").clone();\n var data = $('#resource-language-template').data();\n var newLanguageID = 'language_' + data.languageCount;\n $newLanguage.attr('id', newLanguageID);\n $newLanguage.find('.operation').val('insert');\n $newLanguage.addClass('new-language');\n\n //update input names with new data.languageCount\n $newLanguage.find('input, select').attr('name', function(i, name) {\n return name.replace('YY', data.languageCount);\n });\n\n console.log('Adding new resource language with id: ', newLanguageID);\n $newLanguage.toggle();\n // selects last to avoid conflict on multiple clones\n $('.add-resource-language:last').before($newLanguage);\n enableLanguageSelect($newLanguage);\n\n data.languageCount++;\n return $newLanguage;\n}\n\n/**\n * Delete or Undo Language\n *\n * Toggles component-deleted class, and btn classes for delete and undo.\n * Does not change operations.\n *\n */\nexport function deleteOrUndoLanguage(event) {\n event.preventDefault();\n var $btn = $(event.currentTarget);\n $btn.toggleClass('btn-danger btn-warning');\n $btn.find(':only-child').toggleClass('fa-minus-circle fa-undo');\n var $language = $btn.closest('.language');\n $language.toggleClass('alert-danger component-deleted');\n}\n\n\nfunction setOperations($elements, operation) {\n $elements.find('.operation').each(function() {\n $(this).val(operation);\n });\n}\n\n/**\n * Mark Edited Resource Fields\n *\n * Adds edited-field class to altered inputs. Sets altered resource language to update.\n * @param jqueryObject $resourceForm jQuery object to modify\n *\n */\nexport function markEditedResourceFields($resourceForm) {\n $resourceForm.find(\"input, select, textarea\").on(\"change\", function(e) {\n $(e.target).addClass('edited-field');\n\n if ($(e.target).closest('.language').length) {\n setOperations($(e.target).closest('.language'), \"update\");\n }\n });\n}\n\nfunction enableVocabularySelect(selectItem, type) {\n selectItem.select2({\n ajax: {\n url: snacUrl + \"/vocabulary?type=\" + type,\n dataType: 'json',\n delay: 250,\n data: function(params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function(data, page) {\n return {\n results: data.results\n };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 0,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n}\n\nexport function enableLanguageSelect($language) {\n enableVocabularySelect($language.find(\"select:first\"), 'language_code');\n enableVocabularySelect($language.find(\"select:last\"), 'script_code');\n}\n\n\nexport function magicNewResourceLanguage(event) {\n var $newLanguage = newResourceLanguage(event);\n var defaultLanguage = new Option(defaults.language.term, defaults.language.id, false, true);\n var defaultScript = new Option(defaults.script.term, defaults.script.id, false, true);\n $newLanguage.find(\"select:first\").append(defaultLanguage).trigger('change');\n $newLanguage.find(\"select:last\").append(defaultScript).trigger('change');\n}\n\nexport function selectHoldingRepository(event) {\n event.preventDefault();\n var name = event.target.innerHTML;\n var id = event.target.href.split('/').pop();\n var selectedRepo = new Option(name, id, false, true);\n $(\".resource-repo:last\").append(selectedRepo).trigger('change');\n $(\"#search_form\").slideToggle();\n $(\"#search-results-box\").html(\"\");\n $(\"#searchbox\").val(\"\");\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/select_loaders.js b/src/virtualhosts/www/javascript/select_loaders.js index e01199529..2ee3b9da2 100644 --- a/src/virtualhosts/www/javascript/select_loaders.js +++ b/src/virtualhosts/www/javascript/select_loaders.js @@ -1,3 +1,4 @@ +!function(e,t){for(var r in t)e[r]=t[r]}(window,function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([,function(e,t,r){"use strict"; /** * Select Box Loaders * @@ -9,326 +10,5 @@ * @copyright 2015 the Rector and Visitors of the University of Virginia, and * the Regents of the University of California */ - -/** - * Replace a select that is linked to a Vocabulary search - * - * Replaces the select with a select2 object capable of making AJAX queries - * - * @param JQuery selectItem The JQuery item to replace - * @param string idMatch ID string for the object on the page - * @param string type The type of the vocabulary term - * @param int minLength The minimum required length of the autocomplete search - */ -function vocab_select_replace(selectItem, idMatch, type, minLength) { - if (minLength === undefined) { - minLength = 2; - } - - if(selectItem.attr('id').endsWith(idMatch) - && !selectItem.attr('id').endsWith("ZZ")) { - selectItem.select2({ - ajax: { - url: function() { - var query = snacUrl + "/vocabulary?type="+type+"&id="; - query += $("#constellationid").val()+"&version="+$("#version").val(); - query += "&entity_type="+$("#entityType").val(); - return query; - }, - dataType: 'json', - delay: 250, - data: function (params) { - return { - q: params.term, - page: params.page - }; - }, - processResults: function (data, page) { - return { results: data.results }; - }, - cache: true - }, - width: '100%', - minimumInputLength: minLength, - allowClear: true, - theme: 'bootstrap', - placeholder: 'Select' - }); - } -} - -var geoPlaceSearchResults = null; - -function geovocab_select_replace(selectItem, idMatch) { - var minLength = 2; - - if(selectItem.attr('id').endsWith(idMatch) - && !selectItem.attr('id').endsWith("ZZ")) { - selectItem.select2({ - ajax: { - url: function() { - var query = snacUrl+"/vocabulary?type=geo_place&format=term"; - query += "&entity_type="+$("#entityType").val(); - return query; - }, - dataType: 'json', - delay: 250, - data: function (params) { - return { - q: params.term, - page: params.page - }; - }, - processResults: function (data, page) { - if (data.results) { - geoPlaceSearchResults = data.results; - var selectResults = new Array(); - data.results.forEach(function(result) { - selectResults.push({ - id: result.id, - text: result.name + " (" + result.administrationCode + ", " + result.countryCode+ ")" - }) - }); - return {results: selectResults}; - } - return { results: null }; - }, - cache: true - }, - width: '100%', - minimumInputLength: minLength, - allowClear: true, - theme: 'bootstrap', - placeholder: 'Select' - }); - } -} - -var lastSourceSearchResults = null; - -/** - * Add
    helper script - * - * Adds
    to strings so that they can be shown to the user in HTML - * after being input into a text-only field. - */ -function addbr(str) { - if (typeof str !== 'undefined' && str !== null) { - return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, '
    ' + '$1'); - } - return ''; -} - -/** - * Replace a select that is linked to a Constellation Source search - * - * Replaces the select with a select2 object capable of making AJAX queries - * - * @param JQuery selectItem The JQuery item to replace - * @param string idMatch ID string for the object on the page - */ -function scm_source_select_replace(selectItem, idMatch) { - if(selectItem.attr('id').endsWith(idMatch) - && !selectItem.attr('id').endsWith("ZZ")) { - selectItem.select2({ - ajax: { - url: function() { - var query = snacUrl+"/vocabulary?type=ic_sources&id="; - query += $("#constellationid").val()+"&version="+$("#version").val(); - query += "&entity_type="+$("#entityType").val(); - return query; - }, - dataType: 'json', - delay: 250, - data: function (params) { - return { - q: params.term, - page: params.page - }; - }, - processResults: function (data, page) { - // Modify the results to be in the format we want - lastSourceSearchResults = data.results; - // need id, text - var results = new Array(); - data.results.forEach(function(res) { - results.push({id: res.id, text: res.displayName}); - }); - return { results: results }; - }, - cache: true - }, - width: '100%', - minimumInputLength: 0, - allowClear: true, - theme: 'bootstrap', - placeholder: 'Select' - }); - - selectItem.on('change', function (evt) { - // TODO: Get the current selected value and update the well in the page to reflect it! - // Note: all the selections are available in the global lastSourceSearchResults variable. - var sourceID = $(this).val(); - var inPageID = $(this).attr("id"); - var idArray = inPageID.split("_"); - if (idArray.length >= 6) { - var i = idArray[5]; - var j = idArray[4]; - var shortName = idArray[1]; - lastSourceSearchResults.forEach(function(source) { - if (source.id == sourceID) { - // Update the text of the source - if (typeof source.text !== 'undefined') { - $("#scm_" + shortName + "_source_text_" + j + "_" + i).html(addbr(source.text)).removeClass('hidden'); - $("#scm_" + shortName + "_source_text_" + j + "_" + i).closest(".panel-body").removeClass('hidden'); - } else { - $("#scm_" + shortName + "_source_text_" + j + "_" + i).text("").addClass('hidden'); - $("#scm_" + shortName + "_source_text_" + j + "_" + i).closest(".panel-body").addClass('hidden'); - - } - // Update the URI of the source - if (typeof source.uri !== 'undefined') - $("#scm_" + shortName + "_source_uri_" + j + "_" + i).html(''+source.uri+''); - else - $("#scm_" + shortName + "_source_uri_" + j + "_" + i).html(''); - // Update the URI of the source - if (typeof source.citation !== 'undefined') - $("#scm_" + shortName + "_source_citation_" + j + "_" + i).html(source.citation).removeClass('hidden'); - else - $("#scm_" + shortName + "_source_citation_" + j + "_" + i).html('').addClass('hidden'); - } - }); - } - }); - - } -} - -/** - * Replace a select that is linked to an affiliation search - * - * Replaces the select with a select2 object capable of making AJAX queries - * - * @param JQuery selectItem The JQuery item to replace - */ -function affiliation_select_replace(selectItem) { - $.get(snacUrl + "/vocabulary?type=affiliation").done(function(data) { - var options = data.results; - selectItem.select2({ - data: options, - allowClear: true, - theme: "bootstrap", - placeholder: "Select Affiliation" - }); - }); -} - -function reviewer_select_replace(selectItem) { - if(selectItem != null) { - selectItem.select2({ - placeholder: "Reviewer Name or Email...", - ajax: { - url: function() { - var query = snacUrl+"/user_search?role=Reviewer"; - return query; - }, - dataType: 'json', - delay: 250, - data: function (params) { - return { - q: params.term, - page: params.page - }; - }, - processResults: function (data, page) { - return { results: data.results }; - }, - cache: true - }, - width: '100%', - minimumInputLength: 1, - allowClear: false, - theme: 'bootstrap' - }); - } -} - -function select_replace(selectItem, idMatch) { - if(selectItem.attr('id').endsWith(idMatch) - && !selectItem.attr('id').endsWith("ZZ")) { - selectItem.select2({ - allowClear: true, - theme: 'bootstrap' - }); - } -} - -function select_replace_simple(selectItem) { - selectItem.select2({ - width: '100%', - allowClear: true, - theme: 'bootstrap' - }); -} - - - -/** - * Load Vocab Select Options - * - * Replaces the select with a select2 object preloaded with an array of options - * - * @param JQuery selectItem The JQuery item to replace - * @param string type The type of the vocabulary term - * @param string type Text placeholder for select - */ -function loadVocabSelectOptions(selectItem, type, placeholder) { - return $.get(snacUrl + "/vocabulary?type=" + type) - .done(function(data) { - var options = data.results; - selectItem.select2({ - data: options, - allowClear: false, - theme: 'bootstrap', - placeholder: placeholder - }); - }); -} - -/** - * Replace all the selects that exist on the page when the page has finished loading - */ -$(document).ready(function() { - - // Use select2 to display the select dropdowns - // rather than the HTML default - $("select").each(function() { - if (typeof $(this).attr('id') !== typeof undefined && $(this).attr('id') !== false) { - // Replace the subject selects - vocab_select_replace($(this), "language_language_", "language_code", 1); - - // Replace the subject selects - vocab_select_replace($(this), "language_script_", "script_code", 1); - - // Replace the subject selects - vocab_select_replace($(this), "subject_", "subject", 4); - - // Replace the function selects - vocab_select_replace($(this), "function_", "function", 4); - - // Replace the occupation selects - vocab_select_replace($(this), "occupation_", "occupation", 4); - - // Replace the entityType select - vocab_select_replace($(this), "entityType", "entity_type", 0); - } - }); - - // Replace the Affiliation dropdowns, if one exists - if ($("#affiliationid").exists()) - affiliation_select_replace($("#affiliationid")); - - // Replace the User search dropdown, if one exists - if ($("#reviewersearchbox").exists()) - reviewer_select_replace($("#reviewersearchbox")); -}); +function n(e,t,r,n){void 0===n&&(n=2),e.attr("id").endsWith(t)&&!e.attr("id").endsWith("ZZ")&&e.select2({ajax:{url:function(){var e=snacUrl+"/vocabulary?type="+r+"&id=";return e+=$("#constellationid").val()+"&version="+$("#version").val(),e+="&entity_type="+$("#entityType").val()},dataType:"json",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e,t){return{results:e.results}},cache:!0},width:"100%",minimumInputLength:n,allowClear:!0,theme:"bootstrap",placeholder:"Select"})}r.r(t),r.d(t,"vocab_select_replace",(function(){return n})),r.d(t,"geoPlaceSearchResults",(function(){return a})),r.d(t,"geovocab_select_replace",(function(){return i})),r.d(t,"scm_source_select_replace",(function(){return l})),r.d(t,"select_replace_simple",(function(){return s})),r.d(t,"loadVocabSelectOptions",(function(){return c}));var a=null;function i(e,t){e.attr("id").endsWith(t)&&!e.attr("id").endsWith("ZZ")&&e.select2({ajax:{url:function(){var e=snacUrl+"/vocabulary?type=geo_place&format=term";return e+="&entity_type="+$("#entityType").val()},dataType:"json",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e,t){if(e.results){a=e.results;var r=new Array;return e.results.forEach((function(e){r.push({id:e.id,text:e.name+" ("+e.administrationCode+", "+e.countryCode+")"})})),{results:r}}return{results:null}},cache:!0},width:"100%",minimumInputLength:2,allowClear:!0,theme:"bootstrap",placeholder:"Select"})}var o=null;function l(e,t){e.attr("id").endsWith(t)&&!e.attr("id").endsWith("ZZ")&&(e.select2({ajax:{url:function(){var e=snacUrl+"/vocabulary?type=ic_sources&id=";return e+=$("#constellationid").val()+"&version="+$("#version").val(),e+="&entity_type="+$("#entityType").val()},dataType:"json",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e,t){o=e.results;var r=new Array;return e.results.forEach((function(e){r.push({id:e.id,text:e.displayName})})),{results:r}},cache:!0},width:"100%",minimumInputLength:0,allowClear:!0,theme:"bootstrap",placeholder:"Select"}),e.on("change",(function(e){var t=$(this).val(),r=$(this).attr("id").split("_");if(r.length>=6){var n=r[5],a=r[4],i=r[1];o.forEach((function(e){var r;e.id==t&&(void 0!==e.text?($("#scm_"+i+"_source_text_"+a+"_"+n).html((r=e.text,null!=r?(r+"").replace(/(\r\n|\n\r|\r|\n)/g,"
    $1"):"")).removeClass("hidden"),$("#scm_"+i+"_source_text_"+a+"_"+n).closest(".panel-body").removeClass("hidden")):($("#scm_"+i+"_source_text_"+a+"_"+n).text("").addClass("hidden"),$("#scm_"+i+"_source_text_"+a+"_"+n).closest(".panel-body").addClass("hidden")),void 0!==e.uri?$("#scm_"+i+"_source_uri_"+a+"_"+n).html(''+e.uri+""):$("#scm_"+i+"_source_uri_"+a+"_"+n).html(""),void 0!==e.citation?$("#scm_"+i+"_source_citation_"+a+"_"+n).html(e.citation).removeClass("hidden"):$("#scm_"+i+"_source_citation_"+a+"_"+n).html("").addClass("hidden"))}))}})))}function s(e){e.select2({width:"100%",allowClear:!0,theme:"bootstrap"})}function c(e,t,r){return $.get(snacUrl+"/vocabulary?type="+t).done((function(t){var n=t.results;e.select2({data:n,allowClear:!1,theme:"bootstrap",placeholder:r})}))}$(document).ready((function(){var e;$("select").each((function(){void 0!==$(this).attr("id")&&!1!==$(this).attr("id")&&(n($(this),"language_language_","language_code",1),n($(this),"language_script_","script_code",1),n($(this),"subject_","subject",4),n($(this),"function_","function",4),n($(this),"occupation_","occupation",4),n($(this),"entityType","entity_type",0))})),$("#affiliationid").exists()&&(e=$("#affiliationid"),$.get(snacUrl+"/vocabulary?type=affiliation").done((function(t){var r=t.results;e.select2({data:r,allowClear:!0,theme:"bootstrap",placeholder:"Select Affiliation"})}))),$("#reviewersearchbox").exists()&&function(e){null!=e&&e.select2({placeholder:"Reviewer Name or Email...",ajax:{url:function(){return snacUrl+"/user_search?role=Reviewer"},dataType:"json",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e,t){return{results:e.results}},cache:!0},width:"100%",minimumInputLength:1,allowClear:!1,theme:"bootstrap"})}($("#reviewersearchbox"))}))}])); +//# sourceMappingURL=select_loaders.js.map \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/select_loaders.js.map b/src/virtualhosts/www/javascript/select_loaders.js.map new file mode 100644 index 000000000..8343a13d2 --- /dev/null +++ b/src/virtualhosts/www/javascript/select_loaders.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/virtualhosts/www/javascript/src/select_loaders.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","vocab_select_replace","selectItem","idMatch","type","minLength","undefined","attr","endsWith","select2","ajax","url","query","snacUrl","$","val","dataType","delay","data","params","q","term","page","processResults","results","cache","width","minimumInputLength","allowClear","theme","placeholder","geoPlaceSearchResults","geovocab_select_replace","selectResults","Array","forEach","result","push","id","text","administrationCode","countryCode","lastSourceSearchResults","scm_source_select_replace","res","displayName","on","evt","sourceID","this","idArray","split","length","j","shortName","source","str","html","replace","removeClass","closest","addClass","uri","citation","select_replace_simple","loadVocabSelectOptions","done","options","document","ready","each","exists","reviewer_select_replace"],"mappings":"4DACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAA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AAqBa,EAAEmC,MAAO,aAAc,cAAe,OAK/DnC,EAAE,kBAAkByD,WA/GQrE,EAgHDY,EAAE,kBA/GjCA,EAAEhC,IAAI+B,QAAU,gCAAgCqD,MAAK,SAAShD,GAC1D,IAAIiD,EAAUjD,EAAKM,QACnBtB,EAAWO,QAAQ,CACfS,KAAMiD,EACNvC,YAAY,EACZC,MAAO,YACPC,YAAa,2BA4GjBhB,EAAE,sBAAsByD,UAvGhC,SAAiCrE,GACR,MAAdA,GACKA,EAAWO,QAAQ,CACfqB,YAAa,4BACbpB,KAAM,CACFC,IAAK,WAEG,OADQE,QAAQ,8BAGxBG,SAAU,OACVC,MAAO,IACPC,KAAM,SAAUC,GACZ,MAAO,CACHC,EAAGD,EAAOE,KACVC,KAAMH,EAAOG,OAGrBC,eAAgB,SAAUL,EAAMI,GAC5B,MAAO,CAAEE,QAASN,EAAKM,UAE3BC,OAAO,GAEXC,MAAO,OACPC,mBAAoB,EACpBC,YAAY,EACZC,MAAO,cA+EnB2C,CAAwB1D,EAAE","file":"select_loaders.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/**\n * Select Box Loaders\n *\n * Functions that can be used to replace select boxes on the edit page with\n * pretty-formatted versions using JQuery and Select2\n *\n * @author Robbie Hott\n * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause\n * @copyright 2015 the Rector and Visitors of the University of Virginia, and\n * the Regents of the University of California\n */\n\n/**\n * Replace a select that is linked to a Vocabulary search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string idMatch ID string for the object on the page\n * @param string type The type of the vocabulary term\n * @param int minLength The minimum required length of the autocomplete search\n */\nexport function vocab_select_replace(selectItem, idMatch, type, minLength) {\n if (minLength === undefined) {\n minLength = 2;\n }\n\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl + \"/vocabulary?type=\"+type+\"&id=\";\n query += $(\"#constellationid\").val()+\"&version=\"+$(\"#version\").val();\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n return { results: data.results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: minLength,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n }\n}\n\nexport var geoPlaceSearchResults = null;\n\nexport function geovocab_select_replace(selectItem, idMatch) {\n var minLength = 2;\n\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl+\"/vocabulary?type=geo_place&format=term\";\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n if (data.results) {\n geoPlaceSearchResults = data.results;\n var selectResults = new Array();\n data.results.forEach(function(result) {\n selectResults.push({\n id: result.id,\n text: result.name + \" (\" + result.administrationCode + \", \" + result.countryCode+ \")\"\n })\n });\n return {results: selectResults};\n }\n return { results: null };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: minLength,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n }\n}\n\nvar lastSourceSearchResults = null;\n\n/**\n * Add
    helper script\n *\n * Adds
    to strings so that they can be shown to the user in HTML\n * after being input into a text-only field.\n */\nfunction addbr(str) {\n if (typeof str !== 'undefined' && str !== null) {\n return (str + '').replace(/(\\r\\n|\\n\\r|\\r|\\n)/g, '
    ' + '$1');\n }\n return '';\n}\n\n/**\n * Replace a select that is linked to a Constellation Source search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string idMatch ID string for the object on the page\n */\nexport function scm_source_select_replace(selectItem, idMatch) {\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n ajax: {\n url: function() {\n var query = snacUrl+\"/vocabulary?type=ic_sources&id=\";\n query += $(\"#constellationid\").val()+\"&version=\"+$(\"#version\").val();\n query += \"&entity_type=\"+$(\"#entityType\").val();\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n // Modify the results to be in the format we want\n lastSourceSearchResults = data.results;\n // need id, text\n var results = new Array();\n data.results.forEach(function(res) {\n results.push({id: res.id, text: res.displayName});\n });\n return { results: results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 0,\n allowClear: true,\n theme: 'bootstrap',\n placeholder: 'Select'\n });\n\n selectItem.on('change', function (evt) {\n // TODO: Get the current selected value and update the well in the page to reflect it!\n // Note: all the selections are available in the global lastSourceSearchResults variable.\n var sourceID = $(this).val();\n var inPageID = $(this).attr(\"id\");\n var idArray = inPageID.split(\"_\");\n if (idArray.length >= 6) {\n var i = idArray[5];\n var j = idArray[4];\n var shortName = idArray[1];\n lastSourceSearchResults.forEach(function(source) {\n if (source.id == sourceID) {\n // Update the text of the source\n if (typeof source.text !== 'undefined') {\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).html(addbr(source.text)).removeClass('hidden');\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).closest(\".panel-body\").removeClass('hidden');\n } else {\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).text(\"\").addClass('hidden');\n $(\"#scm_\" + shortName + \"_source_text_\" + j + \"_\" + i).closest(\".panel-body\").addClass('hidden');\n\n }\n // Update the URI of the source\n if (typeof source.uri !== 'undefined')\n $(\"#scm_\" + shortName + \"_source_uri_\" + j + \"_\" + i).html(''+source.uri+'');\n else\n $(\"#scm_\" + shortName + \"_source_uri_\" + j + \"_\" + i).html('');\n // Update the URI of the source\n if (typeof source.citation !== 'undefined')\n $(\"#scm_\" + shortName + \"_source_citation_\" + j + \"_\" + i).html(source.citation).removeClass('hidden');\n else\n $(\"#scm_\" + shortName + \"_source_citation_\" + j + \"_\" + i).html('').addClass('hidden');\n }\n });\n }\n });\n\n }\n}\n\n/**\n * Replace a select that is linked to an affiliation search\n *\n * Replaces the select with a select2 object capable of making AJAX queries\n *\n * @param JQuery selectItem The JQuery item to replace\n */\nfunction affiliation_select_replace(selectItem) {\n $.get(snacUrl + \"/vocabulary?type=affiliation\").done(function(data) {\n var options = data.results;\n selectItem.select2({\n data: options,\n allowClear: true,\n theme: \"bootstrap\",\n placeholder: \"Select Affiliation\"\n });\n });\n}\n\nfunction reviewer_select_replace(selectItem) {\n if(selectItem != null) {\n selectItem.select2({\n placeholder: \"Reviewer Name or Email...\",\n ajax: {\n url: function() {\n var query = snacUrl+\"/user_search?role=Reviewer\";\n return query;\n },\n dataType: 'json',\n delay: 250,\n data: function (params) {\n return {\n q: params.term,\n page: params.page\n };\n },\n processResults: function (data, page) {\n return { results: data.results };\n },\n cache: true\n },\n width: '100%',\n minimumInputLength: 1,\n allowClear: false,\n theme: 'bootstrap'\n });\n }\n}\n\nfunction select_replace(selectItem, idMatch) {\n if(selectItem.attr('id').endsWith(idMatch)\n && !selectItem.attr('id').endsWith(\"ZZ\")) {\n selectItem.select2({\n allowClear: true,\n theme: 'bootstrap'\n });\n }\n}\n\nexport function select_replace_simple(selectItem) {\n selectItem.select2({\n width: '100%',\n allowClear: true,\n theme: 'bootstrap'\n });\n}\n\n/**\n * Load Vocab Select Options\n *\n * Replaces the select with a select2 object preloaded with an array of options\n *\n * @param JQuery selectItem The JQuery item to replace\n * @param string type The type of the vocabulary term\n * @param string type Text placeholder for select\n */\nexport function loadVocabSelectOptions(selectItem, type, placeholder) {\n return $.get(snacUrl + \"/vocabulary?type=\" + type)\n .done(function(data) {\n var options = data.results;\n selectItem.select2({\n data: options,\n allowClear: false,\n theme: 'bootstrap',\n placeholder: placeholder\n });\n });\n}\n\n/**\n * Replace all the selects that exist on the page when the page has finished loading\n */\n$(document).ready(function() {\n // Use select2 to display the select dropdowns\n // rather than the HTML default\n $(\"select\").each(function() {\n if (typeof $(this).attr('id') !== typeof undefined && $(this).attr('id') !== false) {\n // Replace the subject selects\n vocab_select_replace($(this), \"language_language_\", \"language_code\", 1);\n\n // Replace the subject selects\n vocab_select_replace($(this), \"language_script_\", \"script_code\", 1);\n\n // Replace the subject selects\n vocab_select_replace($(this), \"subject_\", \"subject\", 4);\n\n // Replace the function selects\n vocab_select_replace($(this), \"function_\", \"function\", 4);\n\n // Replace the occupation selects\n vocab_select_replace($(this), \"occupation_\", \"occupation\", 4);\n\n // Replace the entityType select\n vocab_select_replace($(this), \"entityType\", \"entity_type\", 0);\n }\n });\n\n // Replace the Affiliation dropdowns, if one exists\n if ($(\"#affiliationid\").exists())\n affiliation_select_replace($(\"#affiliationid\"));\n\n // Replace the User search dropdown, if one exists\n if ($(\"#reviewersearchbox\").exists())\n reviewer_select_replace($(\"#reviewersearchbox\"));\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/virtualhosts/www/javascript/src/edit_scripts.js b/src/virtualhosts/www/javascript/src/edit_scripts.js new file mode 100644 index 000000000..70d59acf0 --- /dev/null +++ b/src/virtualhosts/www/javascript/src/edit_scripts.js @@ -0,0 +1,2850 @@ +/** + * Edit Scripts + * + * Scripts used in the edit page + * + * @author Robbie Hott + * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * @copyright 2015 the Rector and Visitors of the University of Virginia, and + * the Regents of the University of California + */ + +var biogHistEditor = null; + +// Has anything been edited on this page? +export var somethingHasBeenEdited = false; + +export function setEditedFlag(val) { + if (val == true) { + $("#save_and_continue").addClass("save-active"); + } else { + $("#save_and_continue").removeClass("save-active"); + } + somethingHasBeenEdited = val; +} + + +// Global Undo Set +export var undoSet = new Array(); + +export var defaults = { + language: { + id: 130, + term: "eng" + }, + script: { + id: 586, + term: "Latn" + } +}; + + + +/** + * Display Error message + * + * Displays the error message box to the user with the given error message + * + * @param string|object err The error message (string) or error object containing a message and type string + */ +export function displayErrorMessage(err, data) { + var errorMsg = ""; + if (typeof err === 'undefined') + errorMsg = "an unknown problem occurred"; + else if ((typeof err) == "string") + errorMsg = err; + else if (err.message) + errorMsg = err.message; + else if (err.type) + errorMsg = err.type; + else + errorMsg = "an unknown problem occurred"; + + $('#error-message').html("

    Oops

    "+errorMsg+"

    " + +"

    " + +" " + +""+ + "Go to Dashboard" + +"" + +"

    "); + setTimeout(function(){ + $('#error-message').slideDown(); + }, 500); + + // For reference, put the server response in the console + console.log(data); +} + +/** + * Add sub-Date GUI object + * + * Adds a Date GUI object to the Date modal for the given "short" type of data indexed by i + * + * @param string short The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index of the object to add a date object to. + * @returns boolean false to keep the browser from redrawing the page + */ +export function addDateEntry(short, i){ + //next_date_{{short}}_{{i}}_j + var j = parseInt($('#next_date_'+short+'_'+i+'_j').text()); + var id = j + "_" + i; + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#sub_date_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short); + $('#add_date_'+short+'_'+i+'_div').after(html); + $('#next_date_'+short+'_'+i+'_j').text(j + 1); + turnOnButtons(short+"_date"+j, i); + turnOnTooltips(short+"_date_"+j, i); + makeEditable(short + "_date_"+j, i); + return false; +} + +/** + * Add sub-Date GUI object + * + * Adds a Date GUI object to the Date modal for the given "short" type of data indexed by i + * + * @param string short The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index of the object to add a date object to. + * @returns boolean false to keep the browser from redrawing the page + */ +export function addDateRangeEntry(short, i){ + //next_date_{{short}}_{{i}}_j + var j = parseInt($('#next_date_'+short+'_'+i+'_j').text()); + var id = j + "_" + i; + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#sub_dateRange_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/XX/g, j).replace(/SHORT/g, short); + $('#add_date_'+short+'_'+i+'_div').after(html); + $('#next_date_'+short+'_'+i+'_j').text(j + 1); + turnOnButtons(short+"_date"+j, i); + turnOnTooltips(short+"_date_"+j, i); + makeEditable(short + "_date_"+j, i); + return false; +} + +/** + * Add SCM GUI object + * + * Adds a GUI SCM object to the SCM modal for the given "short" type of data indexed by i + * + * @param string short The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index of the object to add an SCM object to. + * @returns boolean false to keep the browser from redrawing the page + */ +export function addSCMEntry(short, i){ + //next_scm_{{short}}_{{i}}_j + var j = parseInt($('#next_scm_'+short+'_'+i+'_j').text()); + var id = j + "_" + i; + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#scm_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/YY/g, j).replace(/SHORT/g, short); + $('#add_scm_'+short+'_'+i+'_div').after(html); + $('#next_scm_'+short+'_'+i+'_j').text(j + 1); + turnOnSCMButtons(short, i, j); + turnOnTooltips("scm_"+short, id); + makeSCMEditable(short, i, j); + return false; +} + +/** + * Undo Edit + * + * Returns the html for the (short, i) panel back to its original state, i.e. removes + * the edit. Before doing this, to clean up the page, it first makes the edited version + * uneditable. + * + * @param string short The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + */ +function undoEdit(short, i) { + makeUneditable(short, i); + + // restore the old content + $("#" + short + "_datapart_" + i).replaceWith(undoSet[short+"-"+i]); + turnOnTooltips(short,i); + $("#" + short + "_datapart_" + i + " input[type='checkbox']").each(function() { + var obj = $(this); + obj.bootstrapToggle(); + }); +} + +/** + * Undo SCM Edit + * + * Takes an SCM GUI object (j) for a data object (short, i) and returns it back to its + * original state (removing the edit). Before doing this, to clean up the page and JS, it first + * makes the edited version uneditable, then replaces the HTML. + * + * @param string short The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @param string|int j The index within the data object SCM list on the edit page of the SCM object. + */ +function undoSCMEdit(short, i, j) { + var id = j + "_" + i; + makeSCMUneditable(short, i, j); + + // restore the old content + $("#scm_" + short + "_datapart_" + id).replaceWith(undoSet["scm_"+short+"-"+id]); + turnOnTooltips("scm_"+short, id); +} + +/** + * Change vocabulary input divs to selects + * + * Changes all div's with id "select_" for a given data object (shortName, idStr) from a list of + * inputs defining the parameters to a select (view mode) to a select box (edit mode). It then + * calls the select2 function to replace the select with an AJAX-compatible select. + * + * This function handles VOCABULARY select boxes ONLY. + * + * Note: idStr must not have the "_" pre-appended + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int idStr The index within the edit page of the object. + */ +function textToSelect(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='select_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("select_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); + var term = $("#"+shortName+"_"+name+"_term_"+idStr).val(); + var vocabtype = $("#"+shortName+"_"+name+"_vocabtype_"+idStr).val(); + var minlength = $("#"+shortName+"_"+name+"_minlength_"+idStr).val(); + var placeholder = "Select"; + if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { + placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); + } + var options = ""; + if ($("#"+shortName+"_"+name+"_defaultOptions_"+idStr).exists()) { + options = $("#"+shortName+"_"+name+"_defaultOptions_"+idStr).val(); + } + + cont.html(""+ + "" + + ""); + + if (name == "citation") + scm_source_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr); + else + vocab_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr, vocabtype, minlength); + + } + }); +} + +function textToCheckbox(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='checkbox_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^checkbox_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + var placeholderOn = ""; + if ($("#"+shortName+"_"+name+"_placeholderOn_"+idStr).exists()) { + placeholderOn = $("#"+shortName+"_"+name+"_placeholderOn_"+idStr).val(); + } + var placeholderOff = ""; + if ($("#"+shortName+"_"+name+"_placeholderOff_"+idStr).exists()) { + placeholderOff = $("#"+shortName+"_"+name+"_placeholderOff_"+idStr).val(); + } + + var html = ""; + } + if (placeholderOff != "") { + html += ""; + } + + cont.html(html); + $("#"+shortName+"_"+name+"_"+idStr).bootstrapToggle(); + } + }); + + +} + + +function checkboxToText(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='checkbox_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^checkbox_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + var checked = $("#"+shortName+"_"+name+"_"+idStr).prop('checked'); + var placeholderOn = ""; + if ($("#"+shortName+"_"+name+"_placeholderOn_"+idStr).exists()) { + placeholderOn = $("#"+shortName+"_"+name+"_placeholderOn_"+idStr).val(); + } + var placeholderOff = ""; + if ($("#"+shortName+"_"+name+"_placeholderOff_"+idStr).exists()) { + placeholderOff = $("#"+shortName+"_"+name+"_placeholderOff_"+idStr).val(); + } + + + var html = ""; + + html += "

    "; + if (checked) { + if (placeholderOn != "") + html += placeholderOn; + else + html += value; + } else { + if (placeholderOff != "") + html += placeholderOff; + } + html += "

    "; + if (placeholderOn != "") { + html += ""; + } + if (placeholderOff != "") { + html += ""; + } + + $("#"+shortName+"_"+name+"_"+idStr).bootstrapToggle("destroy"); + cont.html(html); + } + }); + + +} + +function textToInput(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='text_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^text_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + var size = 0; + var sizeStr = ""; + if ($("#"+shortName+"_"+name+"_size_"+idStr).exists()) { + size = parseInt($("#"+shortName+"_"+name+"_size_"+idStr).val()); + sizeStr = " size='" + size +"' "; + } + var placeholder = ""; + if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { + placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); + } + + var onKeyUp = ""; + if ($("#"+shortName+"_"+name+"_onKeyUp_"+idStr).exists()) { + onKeyUp = $("#"+shortName+"_"+name+"_onKeyUp_"+idStr).val(); + } + var onKeyUpStr = ""; + if (onKeyUp != "") { + onKeyUpStr = " onKeyUp='"+onKeyUp+"' "; + } + + var html = ""; + if (size != 0) { + html += ""; + } + if (placeholder != "") { + html += ""; + } + if (onKeyUp != "") { + html += ""; + } + + cont.html(html); + } + }); + + +} + + +function inputToText(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='text_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^text_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + var size = 0; + if ($("#"+shortName+"_"+name+"_size_"+idStr).exists()) { + size = parseInt($("#"+shortName+"_"+name+"_size_"+idStr).val()); + } + var placeholder = ""; + if ($("#"+shortName+"_"+name+"_placeholder_"+idStr).exists()) { + placeholder = $("#"+shortName+"_"+name+"_placeholder_"+idStr).val(); + } + var onKeyUp = ""; + if ($("#"+shortName+"_"+name+"_onKeyUp_"+idStr).exists()) { + onKeyUp = $("#"+shortName+"_"+name+"_onKeyUp_"+idStr).val(); + } + + var html = ""; + html += "

    " + value + "

    "; + if (size != 0) { + html += ""; + } + if (placeholder != "") { + html += ""; + } + if (onKeyUp != "") { + html += ""; + } + + cont.html(html); + } + }); + + +} + + + +function textToTextArea(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='textarea_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^textarea_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + + var html = ""; + + cont.html(html); + } + }); +} + + +function textAreaToText(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='textarea_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace(/^textarea_/, "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var value = $("#"+shortName+"_"+name+"_"+idStr).val(); + + //var html = ""; + var html = ""; + html += "
    " + value + "
    "; + + cont.html(html); + } + }); +} + +/** + * Change vocabulary selects to divs of inputs + * + * Changes all div's with id "select_" for a given data object (shortName, idStr) from a select + * box (edit mode) to a list of inputs defining the parameters to a select (view mode). + * + * This function handles VOCABULARY select boxes ONLY. + * + * Note: idStr must not have the "_" pre-appended + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int idStr The index within the edit page of the object. + */ +function selectToText(shortName, idStr) { + $("div[id^='select_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("select_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); + var term = $("#"+shortName+"_"+name+"_id_"+idStr+ " option:selected").text(); + var vocabtype = $("#"+shortName+"_"+name+"_vocabtype_"+idStr).val(); + var minlength = $("#"+shortName+"_"+name+"_minlength_"+idStr).val(); + + var additionalStyle = ""; + var postText = ""; + if (vocabtype == "name_component") { + additionalStyle = "name-component-type"; + postText = " :"; + } + + cont.html("" + + "" + + "" + + "" + + "

    "+term+postText+"

    "); + + } + }); +} + + +var geoPlaceLoadResults = null; + +function textToGeoPlaceSelect(shortName, idStr) { + $("#"+shortName+"_datapart_" + idStr + " div[id^='selectGeo_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("selectGeo_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); + var term = $("#"+shortName+"_"+name+"_term_"+idStr).val(); + var placeholder = "Select Geo Place Term"; + + var confirmed = $("#"+shortName+"_confirmed_" + idStr).val() == "true" ? true : false; + var firstOptionSelect = ""; + var secondOptionSelect = " selected"; + if (!confirmed) { + firstOptionSelect = " selected"; + secondOptionSelect = ""; + } + + cont.html(""); + + geovocab_select_replace($("#"+shortName+"_"+name+"_id_"+idStr), "_"+idStr); + + } + }); +} + +function geoPlaceSelectToText(shortName, idStr) { + $("div[id^='selectGeo_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("selectGeo_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var id = $("#"+shortName+"_"+name+"_id_"+idStr).val(); + var term = $("#"+shortName+"_"+name+"_id_"+idStr+ " option:selected").text(); + + cont.html("" + + ""); + + } + }); +} + +/** + * Make a data object editable + * + * Make the GUI pane for a given constellation object (short, i) editable. Sets up the edit and delete + * buttons for first-order data objects. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @return boolean False to play nice with the browser + */ +export function makeEditable(short, i) { + // No editing if it's already in edit mode + if ($("#" + short + "_operation_" + i).val() == "update") + return false; + // If it's deleted, then you better undelete it first + if ($("#" + short + "_operation_" + i).val() == "delete") + setDeleted(short, i); + + $("#" + short + "_editbutton_" + i).removeClass("list-group-item-info").addClass("list-group-item-warning"); + $("#" + short + "_editbutton_" + i).html("
    Undo"); + $("#" + short + "_editbutton_" + i).off('click').on("click", function() { + undoEdit(short, i); + }); + $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-danger").addClass("disabled"); + $("#" + short + "_deletebutton_" + i).off('click').on("click", function() { + return false; + }); + + $("#" + short + "_panel_" + i).removeClass("panel-default").addClass("alert-info").addClass("edited-component"); + + return subMakeEditable(short, i); +} + +/** + * Make a data object editable + * + * Make the GUI pane for a given constellation object (short, i) editable. Handles removing the read-only + * statuses and changing divs into selects. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @return boolean False to play nice with the browser + */ +function subMakeEditable(short, i) { + // No editing if it's already in edit mode + if ($("#" + short + "_operation_" + i).val() == "update") + return false; + + // Add to the undo set + undoSet[short + "-" + i] = $("#"+short+"_datapart_" + i).clone(); + + + textToInput(short, i); + textToTextArea(short, i); + textToCheckbox(short, i); + + var idstr = "_" + i; + + // Enable buttons + $("#"+short+"_datapart_" + i + " button[id^='"+short+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + obj.removeAttr("disabled").removeClass("snac-hidden"); + } + }); + // Enable buttons + $("#"+short+"_datapart_" + i + " a.label").each(function() { + $(this).removeClass("snac-hidden"); + }); + + // Enable checkboxes + $("#"+short+"_datapart_" + i + " input[type='checkbox']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + obj.bootstrapToggle('enable'); + } + }); + + // Turn on CodeMirror Editors + $("#"+short+"_datapart_" + i + " textarea[id^='"+short+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) + && !obj.attr('id').endsWith("ZZ")) { + // remove the short name from the string we're parsing + var idStr = obj.attr('id').replace(short, ""); + if (idStr.indexOf('_text_') != -1 || idStr.indexOf('_source_') != -1) { + obj.get(0).CodeMirror = CodeMirror.fromTextArea(obj.get(0), { + lineNumbers: true, + lineWrapping: true, + viewportMargin: Infinity, + mode: {name: "xml"} + }); + } + } + }); + var sawSelect = false; + $("#"+short+"_datapart_" + i + " select[id^='"+short+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + sawSelect = true; + } + }); + + if (!sawSelect) { + textToSelect(short, i); + textToGeoPlaceSelect(short, i); + textToDate(short, i); + } + + // Make things re-orderable if something exists + // $( "#nameEntry_component_ui_0" ).sortable({ // id of the container containing sortable things + // items : '.name_component' // class of the things that are sortable. They MUST have ids + // }); + $("#"+short+"_datapart_" + i + " span.move-handle").each(function() { + $(this).removeClass("snac-hidden"); + }); + $( "#"+short+"_reorderable_"+i ).sortable({ + items : '.reorderable', + opacity : 0.5, + update : function( event, ui ) { + var neworder = $( "#"+short+"_reorderable_"+i ).sortable("toArray"); + console.log(neworder); + neworder.forEach(function(orderedID, index) { + $("#"+orderedID + " input.order-index").val(index); + }); + if (short == "nameEntry") + updateNameEntryHeading(i); + } + }); + + // Make the relation pictures update appropriately + if (short == 'constellationRelation') { + // make the role dropdown affect the picture + $('#'+short+'_type_id_'+i).change(function() { + updatePictureArrow(short, i, + $('#'+short+'_type_id_'+i+' option:selected').text()); + }); + + } + if (short == 'resourceRelation') { + // make the role dropdown affect the picture + $('#'+short+'_role_id_'+i).change(function() { + updatePictureArrow(short, i, + $('#'+short+'_role_id_'+i+' option:selected').text()); + }); + } + // Places should update the place heading + if (short == 'place') { + // If there is a value pre-set, then automatically confirm and update + if ($('#'+short+'_geoplace_id_'+i).val() != null && $('#'+short+'_geoplace_id_'+i).val() != "") { + updatePlaceHeading(short, i, $('#'+short+'_geoplace_id_'+i).val()); + } + // make the role dropdown affect the picture + $('#'+short+'_geoplace_id_'+i).change(function() { + updatePlaceHeading(short, i, + $('#'+short+'_geoplace_id_'+i).val()); + }); + } + + // add parser btn if nameEntry is a computed name, entity is person, and if no btn or extra name components already exist + if (short === 'nameEntry' && ($("#entityType").val() === "700") && + ($("#nameEntry_component_0_panel_" + i).find('select:first').text() === "Name") && + (!$("#nameEntry_panel_" + i).find('.name-parser').length && + $("#nameEntry_component_1_panel_" + i).length === 0)) { + $('#nameEntry_component_add_' + i).after(''); + } + + // Set this data's operation value appropriately + if ($("#" + short + "_id_" + i).val() != "") + $("#" + short + "_operation_" + i).val("update"); + else + $("#" + short + "_operation_" + i).val("insert"); + + // Asked to edit something, so make it globally known + setEditedFlag(true); + //somethingHasBeenEdited = true; + + return false; +} + +/** + * Make a data object uneditable + * + * Make each object in the GUI page for the given piece uneditable by turning them back to text. Also + * takes the color away from the pane and removes the operation flag. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @return boolean False to play nice with the browser + */ +function subMakeUneditable(shortName, i) { + + // Make inputs read-only + var idstr = "_" + i; + + + // Turn off the reordering js + $("#"+shortName+"_datapart_" + i + " span.move-handle").each(function() { + $(this).addClass("snac-hidden"); + }); + if ($( "#"+shortName+"_reorderable_"+i ).hasClass("ui-sortable")) + $( "#"+shortName+"_reorderable_"+i ).sortable("destroy"); + + // Remove CodeMirror editors + $("#"+shortName+"_datapart_" + i + " textarea[id^='"+shortName+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) + && !obj.attr('id').endsWith("ZZ") + && (obj.attr('id').indexOf('_text_') != -1 || obj.attr('id').indexOf('_source_') != -1)) { + + if (obj.get(0).CodeMirror) { + obj.get(0).CodeMirror.toTextArea(); + } + //(document.getElementById(obj.attr('id'))).CodeMirror.toTextArea(); + //obj.get(0).CodeMirror.toTextArea(); + } + }); + // Disable buttons + $("#"+shortName+"_datapart_" + i + " button[id^='"+shortName+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + obj.attr("disabled", "true").addClass("snac-hidden"); + } + }); + + // Disable buttons + $("#"+shortName+"_datapart_" + i + " a.label").each(function() { + $(this).addClass("snac-hidden"); + }); + + // Disable checkboxes + $("#"+shortName+"_datapart_" + i + " input[type='checkbox']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + obj.bootstrapToggle("disable"); + } + }); + + inputToText(shortName, i); + textAreaToText(shortName, i); + checkboxToText(shortName, i); + // Check for a select box + var sawSelect = false; + $("#"+shortName+"_datapart_" + i + " select[id^='"+shortName+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith(idstr) && !obj.attr('id').endsWith("ZZ")) { + sawSelect = true; + } + }); + // If a select box was seen, undo it + if (sawSelect) { + selectToText(shortName, i); + geoPlaceSelectToText(shortName, i); + dateToText(shortName,i); + } + + + // Clear the operation flags + //$("#" + shortName + "_operation_" + i).val(""); + $("#"+shortName+"_datapart_" + i + " input[id^='"+shortName+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith("_operation" + idstr) && !obj.attr('id').endsWith("ZZ")) { + obj.val(""); + } + }); + + $("#" + shortName + "_panel_" + i).addClass("panel-default").removeClass("alert-info").removeClass("edited-component"); + + + +} + +/** + * Make a data object uneditable + * + * Make the GUI pane for a given constellation object (short, i) un-editable. Sets up the edit and delete + * buttons for first-order data objects, and calls the function to turn the elements back to text. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @return boolean False to play nice with the browser + */ +export function makeUneditable(shortName, i) { + // Make inputs read-only + var idstr = "_" + i; + + subMakeUneditable(shortName, i); + + // restore the edit button + $("#" + shortName + "_editbutton_" + i).addClass("list-group-item-info").removeClass("list-group-item-warning"); + $("#" + shortName + "_editbutton_" + i).html("
    Edit"); + $("#" + shortName + "_editbutton_" + i).off('click').on("click", function() { + makeEditable(shortName, i); + }); + + // restore the delete button + $("#" + shortName + "_deletebutton_" + i).addClass("list-group-item-danger").removeClass("disabled"); + $("#" + shortName + "_deletebutton_" + i).off('click').on("click", function() { + setDeleted(shortName, i); + }); + + return false; +} + +/** + * Make an SCM data object editable + * + * Make the GUI pane for an SCM (j) of a given constellation object (short, i) editable. Sets up the edit and delete + * buttons for first-order data objects. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @param string|int j The index within the data object SCM list on the edit page of the SCM object. + * @return boolean False to play nice with the browser + */ +function makeSCMEditable(shortName, i, j) { + var id = j + "_" + i; + var scmShortName = "scm_" + shortName; + + // No editing if it's already in edit mode + if ($("#" + scmShortName + "_operation_" + id).val() == "update") + return false; + // If it's deleted, then you better undelete it first + if ($("#" + scmShortName + "_operation_" + id).val() == "delete") + setSCMDeleted(shortName, i, j); + + $("#" + scmShortName + "_editbutton_" + id).removeClass("list-group-item-info").addClass("list-group-item-warning"); + $("#" + scmShortName + "_editbutton_" + id).html(""); + $("#" + scmShortName + "_editbutton_" + id).off('click').on("click", function() { + undoSCMEdit(shortName, i, j); + }); + $("#" + scmShortName + "_deletebutton_" + id).removeClass("list-group-item-danger").addClass("disabled"); + $("#" + scmShortName + "_deletebutton_" + id).off('click').on("click", function() { + return false; + }); + + $("#" + scmShortName + "_panel_" + id).removeClass("panel-default").addClass("alert-info").addClass("edited-component"); + + return subMakeEditable(scmShortName, id); +} + +/** + * Make an SCM data object un-editable + * + * Make the GUI pane for an SCM object (j) for a given constellation object (short, i) un-editable. Sets up the edit and delete + * buttons for SCM data objects. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @param string|int j The index within the data object SCM list on the edit page of the SCM object. + * @return boolean False to play nice with the browser + */ +export function makeSCMUneditable(shortName, i, j) { + + // Make inputs read-only + var idstr = j + "_" + i; + + subMakeUneditable('scm_'+shortName, idstr); + + // restore the edit button + $("#scm_" + shortName + "_editbutton_" + idstr).addClass("list-group-item-info").removeClass("list-group-item-warning"); + $("#scm_" + shortName + "_editbutton_" + idstr).html(""); + $("#scm_" + shortName + "_editbutton_" + idstr).off('click').on("click", function() { + makeSCMEditable(shortName, i, j); + }); + + // restore the delete button + $("#scm_" + shortName + "_deletebutton_" + idstr).addClass("list-group-item-danger").removeClass("disabled"); + $("#scm_" + shortName + "_deletebutton_" + idstr).off('click').on("click", function() { + setSCMDeleted(shortName, i, j); + }); + + return false; +} + +/** + * Set a Contributor Object as deleted + * + * Sets the contributor object (shortName, i) as deleted or undeleted and makes the appropriate changes. + * + * @param string shortName The short name of the contributor object. + * @param string|int i The index within the edit page of the object. + */ +export function setRepeatedDataDeleted(shortName, i) { + if ($("#" + shortName + "_operation_" + i).val() != "delete") { + $("#" + shortName + "_remove_" + i).removeClass("btn-danger").addClass("btn-warning"); + $("#" + shortName + "_remove_" + i).html(""); + } else { + $("#" + shortName + "_remove_" + i).removeClass("btn-warning").addClass("btn-danger"); + $("#" + shortName + "_remove_" + i).html(""); + } + + return subSetDeleted(shortName, i); +} + +/** + * Set a first-order data object as deleted + * + * Sets a first-order data object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + */ +function setDeleted(short, i) { + if ($("#" + short + "_operation_" + i).val() != "delete") { + // set deleted + $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-danger").addClass("list-group-item-warning"); + $("#" + short + "_deletebutton_" + i).html("
    Undo"); + + // disable edit button + $("#" + short + "_editbutton_" + i).removeClass("list-group-item-info").addClass("disabled"); + $("#" + short + "_editbutton_" + i).off('click').on("click", function() { + return false; + }); + + // disable the Date button + $("#" + short + "_datebutton_" + i).removeClass("list-group-item-success").addClass("disabled").prop('disabled', true); + + // disable the SCM button + $("#" + short + "_scmbutton_" + i).removeClass("list-group-item-success").addClass("disabled").prop('disabled', true); + + } else { + // set undelete + $("#" + short + "_deletebutton_" + i).removeClass("list-group-item-warning").addClass("list-group-item-danger"); + $("#" + short + "_deletebutton_" + i).html("
    Trash"); + + // restore edit button + $("#" + short + "_editbutton_" + i).addClass("list-group-item-info").removeClass("disabled"); + $("#" + short + "_editbutton_" + i).off('click').on("click", function() { + makeEditable(short, i); + }); + + // restore the Date button + $("#" + short + "_datebutton_" + i).addClass("list-group-item-success").removeClass("disabled").prop('disabled', false); + + // restore the SCM button + $("#" + short + "_scmbutton_" + i).addClass("list-group-item-success").removeClass("disabled").prop('disabled', false); + + } + + return subSetDeleted(short, i); +} + +/** + * Make the delete/undelete happen + * + * Actually performs the changes to the object, affecting the operation and panel color. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @return boolean False to play nice with the browser + */ +function subSetDeleted(short, i) { + if ($("#" + short + "_operation_" + i).val() != "delete") { + // set deleted + $("#" + short + "_panel_" + i).removeClass("panel-default").addClass("alert-danger").addClass("deleted-component"); + + $("#" + short + "_operation_" + i).val("delete"); + } else { + // set undelete + $("#" + short + "_panel_" + i).removeClass("alert-danger").addClass("panel-default").removeClass("deleted-component"); + + // If this thing was deleted but is supposed to be an update, then return it back to update status + var sawSelect = false; + $("select[id^='"+short+"_']").each(function() { + var obj = $(this); + if(obj.attr('id').endsWith("_" + i) && !obj.attr('id').endsWith("ZZ")) { + sawSelect = true; + } + }); + if (sawSelect) { + if ($("#" + short + "_id_" + i).val() != "") + $("#" + short + "_operation_" + i).val("update"); + else + $("#" + short + "_operation_" + i).val("insert"); + } else { + $("#" + short + "_operation_" + i).val(""); + } + + } + + // Asked to delete something, so make it globally known + setEditedFlag(true); + //somethingHasBeenEdited = true; + + return false; +} + +/** + * Set an SCM data object as deleted + * + * Sets an SCM object (j) for a constellation object (short, i) as deleted or undeleted and makes the appropriate changes throughout the page. + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @param string|int j The index within the data object SCM list on the edit page of the SCM object. + */ +function setSCMDeleted(short, i, j) { + var id = j + '_' + i; + if ($("#scm_" + short + "_operation_" + id).val() != "delete") { + // set deleted + $("#scm_" + short + "_deletebutton_" + id).removeClass("list-group-item-danger").addClass("list-group-item-warning"); + $("#scm_" + short + "_deletebutton_" + id).html(""); + + // disable edit button + $("#scm_" + short + "_editbutton_" + id).removeClass("list-group-item-info").addClass("disabled"); + $("#scm_" + short + "_editbutton_" + id).off('click').on("click", function() { + return false; + }); + + } else { + // set undelete + $("#scm_" + short + "_deletebutton_" + id).removeClass("list-group-item-warning").addClass("list-group-item-danger"); + $("#scm_" + short + "_deletebutton_" + id).html(""); + + // restore edit button + $("#scm_" + short + "_editbutton_" + id).addClass("list-group-item-info").removeClass("disabled"); + $("#scm_" + short + "_editbutton_" + id).off('click').on("click", function() { + makeSCMEditable(short, i, j); + }); + + } + + return subSetDeleted("scm_"+short, id); +} + +/** + * Turn on the Edit/Delete buttons for an object + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + */ +function turnOnButtons(shortName, i) { + + // Turn on the edit button + $("#"+shortName+"_editbutton_"+i).on("click", function() { + makeEditable(shortName, i); + }); + + // Turn on the delete buttons + $("#"+shortName+"_deletebutton_"+i).on("click", function() { + setDeleted(shortName, i); + }); +} + +function turnOnTooltips(shortName, i) { + // Load tooltips + $(function () { + $('#'+shortName+'_panel_'+ i +' [data-toggle="tooltip"]').tooltip() + }) + + // Load popovers + $(function () { + $('#'+shortName+'_panel_'+ i +' [data-toggle="popover"]').popover({ + trigger: 'hover', + container: 'body' + }) + }) + + +} + +/** + * Turn on the Edit/Delete buttons for an SCM object + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int i The index within the edit page of the object. + * @param string|int j The index within the data object SCM list on the edit page of the SCM object. + */ +function turnOnSCMButtons(shortName, i, j) { + + // Turn on the edit button + $("#scm_"+shortName+"_editbutton_"+j+"_"+i).on("click", function() { + makeSCMEditable(shortName, i, j); + }); + + // Turn on the delete buttons + $("#scm_"+shortName+"_deletebutton_"+j+"_"+i).on("click", function() { + setSCMDeleted(shortName, i, j); + }); +} + +/** + * Create a new Address Line object on page + * + * Puts a new Place Address Line object DIV on the page and attaches it correctly to the DOM and javascript. + * + * @param int i The index on the page of the place to add this component to + * @return boolean false to play nice with the browser. + */ +export function newAddressLine(i) { + var nextid = 1; + if ($('#place_address_next_j_'+i).exists()) { + nextid = parseInt($('#place_address_next_j_'+i).text()); + } + console.log("Creating new address line for place " + i + " with id: " + nextid); + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#addressline_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); + $('#place_address_add_div_'+i).before(html); + + $('#place_address_' + nextid + '_operation_' + 1).val("insert"); + subMakeEditable("place_address_" + nextid, i); + + vocab_select_replace($("#place_address_"+nextid+"_type_id_"+i), "_"+i, 'address_part', 0); + + // Put the updated version number back in the DOM + $('#place_address_next_j_'+i).text(++nextid); + + return false; +} + +/** + * Create a new Resource Relation Origination Name object on page + * + * Puts a new Resource Relation Origination Name object DIV on the page and attaches it correctly to the DOM and javascript. + * + * @param int i The index on the page of the Resource Relation to add this Origination Name to + * @return boolean false to play nice with the browser. + */ +function newOriginationName(i) { + var nextid = 1; + if ($('#resource_originationName_next_j_'+i).exists()) { + nextid = parseInt($('#resource_originationName_next_j_'+i).text()); + } + console.log("Creating new origination name for resource " + i + " with id: " + nextid); + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#originationName_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); + $('#resource_originationName_add_div_'+i).before(html); + + $('#resource_originationName_' + nextid + '_operation_' + 1).val("insert"); + subMakeEditable("resource_originationName_" + nextid, i); + + // Put the updated version number back in the DOM + $('#resource_originationName_next_j_'+i).text(++nextid); + + return false; +} + + +/** + * Create a new Name Entry Component object on page + * + * Puts a new Name Entry component object DIV on the page and attaches it correctly to the DOM and javascript. + * + * @param int i The index on the page of the nameEntry to add this component to + * @return boolean false to play nice with the browser. + */ +export function newNameEntryComponent(i) { + removeParserButton(i); + var nextid = 1; + if ($('#nameEntry_component_next_j_'+i).exists()) { + nextid = parseInt($('#nameEntry_component_next_j_'+i).text()); + } + console.log("Creating new name entry component for nameEntry " + i + " with id: " + nextid); + + // add parser btn if entity is person, and if no btn or other name components already exist + if (($("#entityType").val() === "700") && (nextid == 0) && + (!$("#nameEntry_panel_" + i).find('.name-parser').length && + $("#nameEntry_component_1_panel_" + i).length === 0)) { + $('#nameEntry_component_add_' + i).after(''); + } + + setEditedFlag(true); + //somethingHasBeenEdited = true; + + var text = $('#component_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); + $('#nameEntry_component_add_div_'+i).before(html); + + $('#nameEntry_component_' + nextid + '_operation_' + 1).val("insert"); + subMakeEditable("nameEntry_component_" + nextid, i); + + vocab_select_replace($("#nameEntry_component_"+nextid+"_type_id_"+i), "_"+i, 'name_component', 0); + + // Put the updated version number back in the DOM + $('#nameEntry_component_next_j_'+i).text(++nextid); + + return false; +} + +export function updateNameEntryHeading(i) { + var text = ""; + var components = []; + + $("#nameEntry_panel_"+i+" div[id^='nameEntry_component_']").each(function() { + var obj = $(this); + if (!obj.hasClass("deleted-component") && obj.attr('id').endsWith("_panel_" + i) + && !obj.attr('id').endsWith("ZZ")) { + var j = obj.attr('id').replace("nameEntry_component_", "").replace("_panel_"+i, ""); + var type = $("#nameEntry_component_"+j+"_type_id_"+i+" option:selected").text(); + var partText = $("#nameEntry_component_"+j+"_text_"+i).val(); + + components.push([type, partText]); + } + }); + + var entityType = $("#entityType option:selected").text(); + text = combineNameHeading(components, entityType); + + + $("#nameEntry_heading_"+i).text(text.trim()); + $("#nameEntry_original_"+i).val(text.trim()); +} + + +/** + * Create a new Name Entry Rules object on page + * + * Puts a new Name Entry rule object DIV on the page and attaches it correctly to the DOM and javascript. + * + * @param int i The index on the page of the nameEntry to add this rule to + * @return boolean false to play nice with the browser. + */ +export function newNameEntryRule(i) { + var nextid = 1; + if ($('#nameEntry_rule_next_j_'+i).exists()) { + nextid = parseInt($('#nameEntry_rule_next_j_'+i).text()); + } + console.log("Creating new name entry rule for nameEntry " + i + " with id: " + nextid); + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#rule_template').clone(); + var html = text.html().replace(/ZZ/g, i).replace(/YY/g, nextid); + $('#nameEntry_rule_add_div_'+i).before(html); + + $('#nameEntry_rule_' + nextid + '_operation_' + 1).val("insert"); + turnOnTooltips("nameEntry_rule_" + nextid, i); + subMakeEditable("nameEntry_rule_" + nextid, i); + + // Put the updated version number back in the DOM + $('#nameEntry_rule_next_j_'+i).text(++nextid); + + return false; +} + +/** + * Parse a date string into parts + */ +function parseDate(dateString) { + var pieces = dateString.split("-"); + if (pieces.length == 3) + return { + year : parseInt(pieces[0]), + month : parseInt(pieces[1]), + day : parseInt(pieces[2]) + }; + else if (pieces.length == 2) + return { + year : parseInt(pieces[0]), + month : parseInt(pieces[1]), + day : '' + }; + else if (pieces.length == 1 && pieces[0] != '') + return { + year : parseInt(pieces[0]), + month : '', + day : '' + }; + else return { + year : '', month : '', day : '' + } +} + +/** + * Change date input divs to select and boxes + * + * Changes all div's with id "date_" for a given data object (shortName, idStr) from a list of + * inputs defining the parameters (view mode) to a inputs and a select (edit mode). It then + * calls the select2 function to replace the select with one matching the rest of the page. + * + * Note: idStr must not have the "_" pre-appended + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int idStr The index within the edit page of the object. + */ +function textToDate(shortName, idStr) { + $("div[id^='date_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + var dateStr = $("#"+shortName+"_"+name+"_"+idStr).val(); + + var dateParts = parseDate(dateStr); + + var html = ""; + html += " - "; + html += " "; + html += " - "; + html += " "; + html += ""; + cont.html(html); + + $("#"+shortName+"_"+name+"_month_"+idStr).select2({ + width: '57%', + allowClear: true, + theme: 'bootstrap', + placeholder: 'Month' + }); + + } + }); +} + +/** + * Pad an integer + * + * This is a helper function to pad an integer with 0s for display. This is useful to pad + * a month or day with a leading 0. + * + * @param int|string num The number to pad + * @param int size The total width of the desired output + * @return string A string containing a size-wide integer representation, 0-padded + */ +function pad(num, size) { + var s = num+""; + while (s.length < size) s = "0" + s; + return s; +} + +/** + * Updates the standard date input field + * + * If the date for the data object (shortName, idStr) has been turned into a 3-field edit + * area, then this function will update the hidden standard date (YYYY-MM-DD) field with the + * newest values from the human-enterable field. + * + * Note: idStr must not have the "_" pre-appended + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int idStr The index within the edit page of the object. + */ +export function updateDate(shortName, idStr) { + $("div[id^='date_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + + if ($("#"+shortName+"_"+name+"_year_"+idStr).exists()) { + var year = $("#"+shortName+"_"+name+"_year_"+idStr).val(); + var day = $("#"+shortName+"_"+name+"_day_"+idStr).val(); + var month = $("#"+shortName+"_"+name+"_month_"+idStr+ " option:selected").val(); + + var dateStr = ""; + if (year != "") { + dateStr += pad(year, 4); + if (month != "") { + dateStr += "-" + pad(month,2); + if (day != "") { + dateStr += "-" + pad(day,2); + } + } + } + + $("#"+shortName+"_"+name+"_"+idStr).val(dateStr); + } + + } + }); +} + +/** + * Return editable date area back to text + * + * If the date for the data object (shortName, idStr) has been turned into a 3-field edit + * area, then this function will return the editable area back to the view mode text, replacing + * the edit boxes with a paragraph containing the computed standard date string (YYYY-MM-DD). + * + * Note: idStr must not have the "_" pre-appended + * + * @param string shortName The short name of the data object, such as "nameEntry" or "occupation" + * @param string|int idStr The index within the edit page of the object. + */ +function dateToText(shortName, idStr) { + $("div[id^='date_"+shortName+"']").each(function() { + var cont = $(this); + if(cont.attr('id').endsWith("_"+idStr) && !cont.attr('id').endsWith("ZZ")) { + // remove the short name and "select_" from the string we're parsing + var divStr = cont.attr('id').replace("date_", "").replace(shortName + "_", ""); + // remove the idstr to receive the name of this element + var regex = new RegExp("\_"+idStr+"$", "g"); + var name = divStr.replace(regex, ""); + + updateDate(shortName, idStr); + + + var dateStr = $("#"+shortName+"_"+name+"_"+idStr).val(); + + var html = "

    "+dateStr+"

    "; + html += ""; + cont.html(html); + + } + }); +} + + +// TODO: If we want to show a DIV of edited and deleted components, we should use the following two functions +// to get copies of the edited/deleted components from the page. We can then insert those copies onto a modal +// dialog box with a "Save" or "Continue" button at the top and bottom. +// +// All the pieces shown in the dialog should be disabled. One way to do this would be using the following +// method to place a semi-transparent div on top of the editable pieces, making them appear to be grayed out +// and with the not permitted cursor. +// +// .append('
    '); +// +// Note: this modal should NOT be inside the constellation form so that we don't submit the values twice. + +/** + * Get all the edited components + */ +function getEdited() { + var html = ""; + + $("#constellation_form div.edited-component").each(function() { + var cont = $(this); + console.log(cont.attr('id')); + var pieces = cont.attr('id').split("_panel_"); + if (pieces.length == 2) { + html += "
    " + $("#"+pieces[0] + "_datapart_" + pieces[1]).html() + "
    "; + } + }); + + return html; +} + +/** + * Get all the deleted components + */ +function getDeleted() { + var html = ""; + + $("#constellation_form div.deleted-component").each(function() { + var cont = $(this); + console.log(cont.attr('id')); + var pieces = cont.attr('id').split("_panel_"); + if (pieces.length == 2) { + html += "
    " + $("#"+pieces[0] + "_datapart_" + pieces[1]).html() + "
    "; + } + }); + + return html; +} + +function turnOnEditDeleteButtons(part='') { + var divID = ''; + if (part != '') + divID = "#" + part + " "; + // Turn on the edit buttons + $(divID + "a[id*='editbutton']").each(function() { + var obj = $(this); + var pieces = obj.attr('id').split("_"); + + if (pieces.length == 3) { + var short = pieces[0]; + var i = pieces[2]; + obj.on("click", function() { + makeEditable(short, i); + }); + } else if (pieces.length == 5 && pieces[0] == "scm") { + var short = pieces[1]; + var i = pieces[4]; + var j = pieces[3]; + obj.on("click", function() { + makeSCMEditable(short, i, j); + }); + } else if (pieces.length == 5) { + var short = pieces[0] + "_" + pieces[1] + "_" + pieces[2]; + var i = pieces[4]; + obj.on("click", function() { + makeEditable(short, i); + }); + } + }); + + // Turn on the delete buttons + $(divID + "a[id*='deletebutton']").each(function() { + var obj = $(this); + var pieces = obj.attr('id').split("_"); + + if (pieces.length == 3) { + var short = pieces[0]; + var i = pieces[2]; + obj.on("click", function() { + setDeleted(short, i); + }); + } else if (pieces.length == 5 && pieces[0] == "scm") { + var short = pieces[1]; + var i = pieces[4]; + var j = pieces[3]; + obj.on("click", function() { + setSCMDeleted(short, i, j); + }); + } else if (pieces.length == 5) { + var short = pieces[0] + "_" + pieces[1] + "_" + pieces[2]; + var i = pieces[4]; + obj.on("click", function() { + setDeleted(short, i); + }); + } + }); +} + +function turnOnTooltipsForTab(part='') { + var divID = ''; + if (part != '') + divID = "#" + part + " "; + // Load tooltips + $(function () { + $(divID + '[data-toggle="tooltip"]').tooltip() + }) + + // Load popovers + $(function () { + $(divID + '[data-toggle="popover"]').popover({ + trigger: 'hover', + container: 'body' + }) + }) + +} + +function updatePictureArrow(shortName, i, newValue) { + $('#'+shortName+'_relationPictureArrow_'+i).text(newValue); +} + +function updatePictureTitle(shortName, i, newValue) { + $('#'+shortName+'_relationPictureTitle_'+i).text(newValue); +} + +function updatePictureIcon(shortName, i, entityType) { + var html = ""; + if (entityType == 'person') + html = '
    '; + else if (entityType == 'corporateBody') + html = '
    '; + else if (entityType == 'family') + html = '
    '; + $('#'+shortName+'_relationPictureIcon_'+i).html(html); +} + + +var geoPlaceLoadResults = null; + +function loadGeoPlaceResultCache() { + $("input[id^='place_geoplace_id_']").each(function() { + var obj = $(this); + // Query for term by ajax + if (obj.val() != null && obj.val() != "") { + $.get(snacUrl+"/vocabulary/read?type=geoPlace&id="+obj.val(), null, function (data) { + // Check the return value from the ajax. If success, then go to dashboard + if (data.term) { + if (!geoPlaceLoadResults) + geoPlaceLoadResults = new Array(); + geoPlaceLoadResults.push(data.term); + } + }); + } + }); +} + +export function chooseSuggestedGeoPlace(selectID, idStr, value) { + // idStr == id number on the page + var obj = $("#"+selectID); + obj.select2('destroy'); + obj.val(value); + geovocab_select_replace(obj, "_"+idStr); + updatePlaceHeading("place", idStr, value); +} + +function updatePlaceHeading(shortName, i, newValue) { + var place = null; + if (!geoPlaceSearchResults && !geoPlaceLoadResults) { + $('#'+shortName+'_confirmed_'+i).val("false"); + $('#'+shortName+'_geoterm_text_'+i).html("Unconfirmed"); + $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); + $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); + if ($('#'+shortName+'_original_'+i).val() != "") + $('#'+shortName+'_geoterm_caption_'+i).text("Recorded as: " + $('#'+shortName+'_original_'+i).val()); + else + $('#'+shortName+'_geoterm_caption_'+i).text(); + return; + } + + if (geoPlaceSearchResults) { + geoPlaceSearchResults.forEach(function(result) { + if (result.id == newValue) + place = result; + }); + } + + if (!place && geoPlaceLoadResults) { + geoPlaceLoadResults.forEach(function(result) { + if (result.id == newValue) + place = result; + }); + } + + if (!place) { + $('#'+shortName+'_confirmed_'+i).val("false"); + $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); + $('#'+shortName+"_geoterm_maplink_"+i).off("click"); + if ($('#'+shortName+'_original_'+i).val() != "") { + $('#'+shortName+'_geoterm_text_'+i).html("Unconfirmed"); + $('#'+shortName+'_geoterm_caption_'+i).text("Recorded as: " + $('#'+shortName+'_original_'+i).val()); + } else { + $('#'+shortName+'_geoterm_text_'+i).text("--"); + $('#'+shortName+'_geoterm_caption_'+i).text("GeoPlace term not specified"); + } + return; + } + $('#'+shortName+'_confirmed_'+i).val("true"); + $('#'+shortName+'_geoterm_text_'+i).text(place.name); + $('#'+shortName+'_geoterm_caption_'+i).text(place.administrationCode + ", " + place.countryCode); + if (place.latitude && place.longitude) { + $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); + $('#'+shortName+"_geoterm_maplink_"+i).on("click", function() {openGeoPlaceViewer(place.id); return false;}); + $('#'+shortName+"_geoterm_maplink_"+i).removeClass("disabled"); + } else { + $('#'+shortName+"_geoterm_maplink_"+i).addClass("disabled"); + $('#'+shortName+"_geoterm_maplink_"+i).prop('onclick',null).off("click"); + } + + +} + +export function magicDefaultFill(selectID, vocabType) { + if (typeof(defaults[vocabType]) !== undefined) { + + var data = { + id: defaults[vocabType].id, + text: defaults[vocabType].term + }; + + // If the selected item exists, then select it. Else, add a new option + // and select it. + if ($('#'+selectID).find("option[value='" + data.id + "']").length) { + $('#'+selectID).val(data.id).trigger('change'); + } else { + var newOption = new Option(data.text, data.id, false, true); + $('#'+selectID).append(newOption).trigger('change'); + } + } + +} + +function capitalize(word) { + return word[0].toUpperCase() + word.slice(1); +} + +function parseName(e) { + $('#name-parser-options').text(''); + var $nameComponents = $(e.target).closest('.name-components'); + + var $partType = $nameComponents.find("select:last"); + var $textbox = $nameComponents.find('input[type="text"]:last'); + + var name = $textbox.val(); + + var entityType = $('#entityType').text().trim(); + $('#name-parser-type').text(capitalize(entityType)); + $('#name-parser-original').text(name); + + var parser = new NameParser(); + var guesses = parser.guessPerson(name); + + var parsedOption = ''; + + var counter = 0; + guesses.forEach(function(guess) { + // attach name data object to radio + for (var key in guess) { + if (guess[key] && guess[key].length != 0) { + parsedOption += "
  • " + key + ": " + guess[key] + "
  • "; + } + } + + $('#name-parser-options').append("
    " + + "
    "); + + + $('#name-parser-options').find("input[type='radio']:last").data("parsed-name", guess); + + parsedOption = ''; + counter++; + }) + + $('#name-parser-options').find("input[type='radio']:first").prop('checked', true) + + + $('#parser-accept-btn').unbind('click') + $('#parser-accept-btn').on('click', function() { + var selectedName = $('#name-parser input[type="radio"]:checked').data('parsed-name') + $.get( snacUrl + "/vocabulary/?type=name_component&entity_type=700") + .done(function(data) { + acceptParsedName(selectedName, $nameComponents, name, data.results) + }) + }) +} + +function acceptParsedName(selectedName, $nameComponents, name, nameComponentIDs) { + var i = $nameComponents.attr('id').split('_')[2]; + var $nameComponent = $nameComponents.find('.reorderable'); /// + $nameComponent.replaceWith('
    Name: ' + name + '
    '); + + var nameComponentMap = {}; + + for (var k = 0; k < nameComponentIDs.length; k++) { + nameComponentMap[nameComponentIDs[k].text] = nameComponentIDs[k].id + } + // var nameComponentMap = { + // 'Surname': 400223, + // 'Forename': 400224, + // 'NameAddition': 400236, + // 'Date': 400237, + // 'NameExpansion': 400226, + // 'Numeration': 400225 + // }; + + for (var key in selectedName) { + if (key == 'NameAdditions') { + key = 'NameAddition'; + for (var j = 0; j < selectedName['NameAdditions'].length; j++) { + newNameEntryComponent(i); + var option = new Option(key, nameComponentMap[key], false, true); + $partType = $nameComponents.find("select:last"); + $partType.append(option).trigger('change'); + $textbox = $nameComponents.find("input[type='text']:last"); + $textbox.val(selectedName["NameAdditions"][j]); + + $partType.append(option).trigger('change'); + } + } else if (selectedName[key] && nameComponentMap[key]) { + newNameEntryComponent(i); + var option = new Option(key, nameComponentMap[key], false, true); + $partType = $nameComponents.find("select:last"); + $partType.append(option).trigger('change'); + $textbox = $nameComponents.find("input[type='text']:last"); + $textbox.val(selectedName[key]); + + $partType.append(option).trigger('change'); + } + } + + $("#nameEntry_datapart_" + i).find(".name-parser").remove(); + updateNameEntryHeading(i); +} + +function removeParserButton(i) { + $('#nameEntry_datapart_' + i).find('.name-parser').remove(); +} + +/** + * Things to do when the page finishes loading + */ +$(document).ready(function() { + // Load the place cache, if needed + loadGeoPlaceResultCache(); + + // listen for name-parsing + $('#nameEntries').on('click', '.name-parser', function(event) { + event.preventDefault(); + parseName(event); + $("#name-parser").modal('toggle'); + }); + + $('#name-parser').on('shown.bs.modal', function () { + $('#parser-accept-btn').focus(); + }) + + // If the constellation is in "insert" mode, then we should automatically set "somethingHasBeenEdited" + // to be true... + if ($('#operation').val() == 'insert') + setEditedFlag(true); + //somethingHasBeenEdited = true; + + turnOnEditDeleteButtons(); + + // Attach functions to the entityType select + if ($('#entityType').exists()) { + $('#entityType').change(function() { + setEditedFlag(true); + //somethingHasBeenEdited = true; + // If there is an ID, then we need to set this to update + // Else, the main-level operation should be and remain insert + if ($('#constellationid').val() != null && + $('#constellationid').val() != "") { + $('#operation').val("update"); + } + }); + } + + // Name Entry doesn't get any AJAX, since it is pre-loaded + var nameEntryid = 1; + if ($('#next_nameEntry_i').exists()) { + nameEntryid = parseInt($('#next_nameEntry_i').text()); + } + console.log("Next NameEntry ID: " + nameEntryid); + if ($('#btn_add_nameEntry').exists()){ + $('#btn_add_nameEntry').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#nameEntry_template').clone(); + var html = text.html().replace(/ZZ/g, nameEntryid); + $('#add_nameEntry_div').after(html); + turnOnButtons("nameEntry", nameEntryid); + turnOnTooltips("nameEntry", nameEntryid); + makeEditable("nameEntry", nameEntryid); + nameEntryid = nameEntryid + 1; + return false; + }); + } + + + // Attach functions to each of the "+ Add New _______" buttons + + // Code to handle adding new genders to the page + var genderid = 1; + var genderOpen = false; + if ($('#genderstab').exists()){ + $('#genderstab').click(function(){ + // Don't open a second time + if (genderOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=genders", null, function (data) { + genderOpen = true; + $('#genders').html(data); + + turnOnEditDeleteButtons("genders"); + + if ($('#next_gender_i').exists()) { + genderid = parseInt($('#next_gender_i').text()); + } + console.log("Next Gender ID: " + genderid); + if ($('#btn_add_gender').exists()){ + $('#btn_add_gender').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#gender_template').clone(); + var html = text.html().replace(/ZZ/g, genderid); + $('#add_gender_div').after(html); + turnOnButtons("gender", genderid); + turnOnTooltips("gender", genderid); + makeEditable("gender", genderid); + genderid = genderid + 1; + return false; + }); + } + + turnOnTooltipsForTab("genders"); + }); + }); + } + + // Code to handle adding new genders to the page + var existid = 1; + var existOpen = false; + if ($('#existstab').exists()){ + $('#existstab').click(function(){ + // Don't open a second time + if (existOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=dates", null, function (data) { + existOpen = true; + $('#dates').html(data); + + turnOnEditDeleteButtons("dates"); + + if ($('#next_exist_i').exists()) { + existid = parseInt($('#next_exist_i').text()); + } + console.log("Next Exist Date ID: " + existid); + if ($('#btn_add_exist_date').exists()){ + $('#btn_add_exist_date').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#exist_date_template').clone(); + var html = text.html().replace(/ZZ/g, existid); + $('#add_exist_div').after(html); + turnOnButtons("exist", existid); + turnOnTooltips("exist", existid); + makeEditable("exist", existid); + existid = existid + 1; + return false; + }); + } + if ($('#btn_add_exist_dateRange').exists()){ + $('#btn_add_exist_dateRange').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#exist_dateRange_template').clone(); + var html = text.html().replace(/ZZ/g, existid); + $('#add_exist_div').after(html); + turnOnButtons("exist", existid); + turnOnTooltips("exist", existid); + makeEditable("exist", existid); + existid = existid + 1; + return false; + }); + } + + turnOnTooltipsForTab("dates"); + }); + }); + } + + var sameAsid = 1; + var sameAsOpen = false; + if ($('#sameAstab').exists()){ + $('#sameAstab').click(function(){ + // Don't open a second time + if (sameAsOpen) + return; + //set sameAs vocab type id + $.get(snacUrl+"/vocabulary?type=record_type&q=SameAs", null, function(data) { + sameAsTermId = data.results[0].id; + $("#sameAs_type_id_ZZ").val(sameAsTermId); + }); + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=sameAs", null, function (data) { + sameAsOpen = true; + $('#sameAs').html(data); + + turnOnEditDeleteButtons("sameAs"); + + if ($('#next_sameAs_i').exists()) { + sameAsid = parseInt($('#next_sameAs_i').text()); + } + console.log("Next sameAs ID: " + sameAsid); + if ($('#btn_add_sameAs').exists()){ + $('#btn_add_sameAs').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#sameAs_template').clone(); + var html = text.html().replace(/ZZ/g, sameAsid); + $('#add_sameAs_div').after(html); + turnOnButtons("sameAs", sameAsid); + turnOnTooltips("sameAs", sameAsid); + makeEditable("sameAs", sameAsid); + sameAsid = sameAsid + 1; + return false; + }); + } + + turnOnTooltipsForTab("sameAs"); + }); + }); + } + + + var entityIDid = 1; + var entityIDOpen = false; + if ($('#entityIDtab').exists()){ + $('#entityIDtab').click(function(){ + // Don't open a second time + if (entityIDOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=entityID", null, function (data) { + entityIDOpen = true; + $('#entityID').html(data); + + turnOnEditDeleteButtons("entityID"); + + if ($('#next_entityID_i').exists()) { + entityIDid = parseInt($('#next_entityID_i').text()); + } + console.log("Next entityID ID: " + entityIDid); + if ($('#btn_add_entityID').exists()){ + $('#btn_add_entityID').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#entityID_template').clone(); + var html = text.html().replace(/ZZ/g, entityIDid); + $('#add_entityID_div').after(html); + turnOnButtons("entityID", entityIDid); + turnOnTooltips("entityID", entityIDid); + makeEditable("entityID", entityIDid); + entityIDid = entityIDid + 1; + return false; + }); + } + + turnOnTooltipsForTab("entityID"); + }); + }); + } + + var sourceid = 1; + var sourceOpen = false; + if ($('#sourcestab').exists()){ + $('#sourcestab').click(function(){ + // Don't open a second time + if (sourceOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=sources", null, function (data) { + sourceOpen = true; + $('#sources').html(data); + + turnOnEditDeleteButtons("sources"); + + if ($('#next_source_i').exists()) { + sourceid = parseInt($('#next_source_i').text()); + } + console.log("Next source ID: " + sourceid); + if ($('#btn_add_source').exists()){ + $('#btn_add_source').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#source_template').clone(); + var html = text.html().replace(/ZZ/g, sourceid); + $('#add_source_div').after(html); + turnOnButtons("source", sourceid); + turnOnTooltips("source", sourceid); + makeEditable("source", sourceid); + sourceid = sourceid + 1; + return false; + }); + } + + turnOnTooltipsForTab("sources"); + }); + }); + } + + var resourceRelationid = 1; + var resourceRelationOpen = false; + if ($('#resourceRelationstab').exists()){ + $('#resourceRelationstab').click(function(){ + // Don't open a second time + if (resourceRelationOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=resourceRelations", null, function (data) { + resourceRelationOpen = true; + $('#resourceRelations').html(data); + + turnOnEditDeleteButtons("resourceRelations"); + + if ($('#next_resourceRelation_i').exists()) { + resourceRelationid = parseInt($('#next_resourceRelation_i').text()); + } + console.log("Next resourceRelation ID: " + resourceRelationid); + if ($('#btn_create_resourceRelation').exists()){ + $('#btn_create_resourceRelation').click(function(){ + var rid = $('input[name=resourceChoice]:checked', '#resource_search_form').val(); + if (rid != null && resourceResults != null && rid != 'new') { + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#resourceRelation_template').clone(); + var html = text.html().replace(/ZZ/g, resourceRelationid); + $('#add_resourceRelation_div').after(html); + + if (typeof resourceResults[rid].id !== 'undefined') + $('#resourceRelation_resourceid_'+resourceRelationid).val(resourceResults[rid].id); + if (typeof resourceResults[rid].version !== 'undefined') + $('#resourceRelation_resourceversion_'+resourceRelationid).val(resourceResults[rid].version); + + if (typeof resourceResults[rid].link !== 'undefined') + $('#resourceRelation_linkText_'+resourceRelationid).html(""+resourceResults[rid].link+"" + + " View"); + if (typeof resourceResults[rid].displayEntry !== 'undefined') + $('#resourceRelation_displayEntryText_'+resourceRelationid).text(resourceResults[rid].displayEntry); + if (typeof resourceResults[rid].title !== 'undefined') { + $('#resourceRelation_titleText_'+resourceRelationid).text(resourceResults[rid].title); + updatePictureTitle('resourceRelation', resourceRelationid, resourceResults[rid].title); + } + if (typeof resourceResults[rid].abstract !== 'undefined') + $('#resourceRelation_abstractText_'+resourceRelationid).text(resourceResults[rid].abstract); + if (typeof resourceResults[rid].extent !== 'undefined') + $('#resourceRelation_extentText_'+resourceRelationid).text(resourceResults[rid].extent); + // if (typeof resourceResults[rid].date !== 'undefined') + // $('#resourceRelation_dateText_'+resourceRelationid).text(resourceResults[rid].date); + if (typeof resourceResults[rid].documentType !== 'undefined' && typeof resourceResults[rid].documentType.term !== 'undefined') + $('#resourceRelation_documentTypeText_'+resourceRelationid).text(resourceResults[rid].documentType.term); + + $('#resourceRelation_linkText_'+resourceRelationid).after("View in SNAC"); + turnOnButtons("resourceRelation", resourceRelationid); + turnOnTooltips("resourceRelation", resourceRelationid); + makeEditable("resourceRelation", resourceRelationid); + resourceRelationid = resourceRelationid + 1; + $("#resource-results-box").html(""); + return true; + } + return false; + }); + } + + if ($('#btn_open_create_resource').exists()){ + $('#btn_open_create_resource').click(function(){ + // Close this modal and open the new modal + $("#resourceSearchPane").modal("hide"); + + // Set a 500ms timeout to give the hidden search pane time to fully close + setTimeout(function() {$("#resourceCreatePane").modal("show");}, 500); + + // Grab the empty template and replace + var text = $('#resource_template').clone(); + var html = text.html().replace(/ZZ/g, 0); + $('#resource-create-box').html(html); + var $resourceForm = $("#resource_create_form"); + // Copy the search contents to title or href + if ($("#resource-searchbox").val().indexOf("http") == -1) + $resourceForm.find("#resource-title").val($("#resource-searchbox").val()); + else + $resourceForm.find("#resource-url").val($("#resource-searchbox").val()); + + $resourceForm.find('[data-toggle="popover"]').popover({ + trigger: 'hover', + container: 'body' + }); + loadVocabSelectOptions($resourceForm.find("#resource-type-select"), "document_type", "Resource Type"); + vocab_select_replace($resourceForm.find("#resource-repo"), "", "holding", 3); + $resourceForm.find("#new-resource-language-btn").on("click", newResourceLanguage); + $resourceForm.find("#magic-resource-language-btn").on("click", magicNewResourceLanguage); + + $('#search-results-box').on("click", "a.list-group-item", selectHoldingRepository); + var timeoutID = null; + $resourceForm.find('#searchbox').keyup(function() { + clearTimeout(timeoutID); + timeoutID = setTimeout(function() { setSearchPosition(0); searchAndUpdate(); }, 500); + }); + + // Remove the search results from the other modal + $("#resource-results-box").html(""); + return false; + }); + } + + if ($('#btn_create_resource').exists()){ + $('#resource_create_form').on("submit", function(){ + // Remove leading and trailing whitespace + if ($("#resource_create_form #resource-url").val() == "") { + if (!confirm('Are you sure you want to save without an HREF?')) { + return; + } + } + $("#resource_create_form input, textarea").each(function() { + $(this).val($.trim($(this).val())); + }); + setDeletedResourceLanguageOperations($("#resource_create_form")); + + $.post(snacUrl+"/save_resource", $("#resource_create_form").serialize(), function (data) { + if (typeof data.result !== 'undefined' && data.result !== 'false') { + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#resourceRelation_template').clone(); + var html = text.html().replace(/ZZ/g, resourceRelationid); // clones DOM, replaces zz with next ids + $('#add_resourceRelation_div').after(html); + + if (typeof data.resource.id !== 'undefined') + $('#resourceRelation_resourceid_'+resourceRelationid).val(data.resource.id); + if (typeof data.resource.version !== 'undefined') + $('#resourceRelation_resourceversion_'+resourceRelationid).val(data.resource.version); + + if (typeof data.resource.link !== 'undefined') + $('#resourceRelation_linkText_'+resourceRelationid).html(""+data.resource.link+"" + + " View"); + if (typeof data.resource.displayEntry !== 'undefined') + $('#resourceRelation_displayEntryText_'+resourceRelationid).text(data.resource.displayEntry); + if (typeof data.resource.title !== 'undefined') { + $('#resourceRelation_titleText_'+resourceRelationid).text(data.resource.title); + updatePictureTitle('resourceRelation', resourceRelationid, data.resource.title); + } + if (typeof data.resource.abstract !== 'undefined') + $('#resourceRelation_abstractText_'+resourceRelationid).text(data.resource.abstract); + if (typeof data.resource.extent !== 'undefined') + $('#resourceRelation_extentText_'+resourceRelationid).text(data.resource.extent); + if (typeof data.resource.documentType !== 'undefined' && typeof data.resource.documentType.term !== 'undefined') + $('#resourceRelation_documentTypeText_'+resourceRelationid).text(data.resource.documentType.term); + + $('#resourceRelation_linkText_'+resourceRelationid).after("View in SNAC"); + turnOnButtons("resourceRelation", resourceRelationid); + turnOnTooltips("resourceRelation", resourceRelationid); + makeEditable("resourceRelation", resourceRelationid); + resourceRelationid = resourceRelationid + 1; + $("#resourceCreatePane").modal("hide"); + $('#resource-create-box').html(""); + return true; + } else { + console.log(data); + return false; + } + }); + return false; + }); + } + + turnOnTooltipsForTab("resourceRelations"); + }); + }); + } + + + var constellationRelationid = 1; + var constellationRelationOpen = false; + if ($('#constellationRelationstab').exists()){ + $('#constellationRelationstab').click(function(){ + // Don't open a second time + if (constellationRelationOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=constellationRelations", null, function (data) { + constellationRelationOpen = true; + $('#constellationRelations').html(data); + + turnOnEditDeleteButtons("constellationRelations"); + + if ($('#next_constellationRelation_i').exists()) { + constellationRelationid = parseInt($('#next_constellationRelation_i').text()); + } + console.log("Next constellationRelation ID: " + constellationRelationid); + if ($('#btn_create_constellationRelation').exists()){ + $('#btn_create_constellationRelation').click(function(){ + var cid = $('input[name=relationChoice]:checked', '#relation_search_form').val() + if (cid != null) { + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#constellationRelation_template').clone(); + var html = text.html().replace(/ZZ/g, constellationRelationid); + $('#add_constellationRelation_div').after(html); + $('#constellationRelation_targetID_'+constellationRelationid).val(cid); + $('#constellationRelation_content_'+constellationRelationid).val($('#relationChoice_nameEntry_'+cid).val()); + $('#constellationRelation_targetArkID_'+constellationRelationid).val($('#relationChoice_arkID_'+cid).val()); + $('#constellationRelation_targetEntityType_'+constellationRelationid).val($('#relationChoice_entityType_'+cid).val()); + + updatePictureIcon('constellationRelation', constellationRelationid, $('#relationChoice_entityTypeText_'+cid).val()); + updatePictureTitle('constellationRelation', constellationRelationid, $('#relationChoice_nameEntry_'+cid).val()); + + $('#constellationRelation_contentText_'+constellationRelationid).text($('#relationChoice_nameEntry_'+cid).val()); + $('#constellationRelation_targetArkIDText_'+constellationRelationid).text($('#relationChoice_arkID_'+cid).val()); + + turnOnButtons("constellationRelation", constellationRelationid); + turnOnTooltips("constellationRelation", constellationRelationid); + makeEditable("constellationRelation", constellationRelationid); + + constellationRelationid = constellationRelationid + 1; + + return true; + + } + + + return false; + }); + } + + turnOnTooltipsForTab("constellationRelations"); + }); + }); + } + + var languageid = 1; + var languageOpen = false; + if ($('#languagesUsedtab').exists()){ + $('#languagesUsedtab').click(function(){ + // Don't open a second time + if (languageOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=languagesUsed", null, function (data) { + languageOpen = true; + $('#languagesUsed').html(data); + + turnOnEditDeleteButtons("languagesUsed"); + + if ($('#next_language_i').exists()) { + languageid = parseInt($('#next_language_i').text()); + } + console.log("Next language ID: " + languageid); + if ($('#btn_add_language').exists()){ + $('#btn_add_language').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#language_template').clone(); + var html = text.html().replace(/ZZ/g, languageid); + $('#add_language_div').after(html); + turnOnButtons("language", languageid); + turnOnTooltips("language", languageid); + makeEditable("language", languageid); + languageid = languageid + 1; + return false; + }); + } + + turnOnTooltipsForTab("languagesUsed"); + }); + }); + } + + var subjectid = 1; + var subjectOpen = false; + if ($('#subjectstab').exists()){ + $('#subjectstab').click(function(){ + // Don't open a second time + if (subjectOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=subjects", null, function (data) { + subjectOpen = true; + $('#subjects').html(data); + + turnOnEditDeleteButtons("subjects"); + + if ($('#next_subject_i').exists()) { + subjectid = parseInt($('#next_subject_i').text()); + } + console.log("Next subject ID: " + subjectid); + if ($('#btn_add_subject').exists()){ + $('#btn_add_subject').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#subject_template').clone(); + var html = text.html().replace(/ZZ/g, subjectid); + $('#add_subject_div').after(html); + turnOnButtons("subject", subjectid); + turnOnTooltips("subject", subjectid); + makeEditable("subject", subjectid); + subjectid = subjectid + 1; + return false; + }); + } + + turnOnTooltipsForTab("subjects"); + }); + }); + } + + var nationalityid = 1; + var nationalityOpen = false; + if ($('#nationalitiestab').exists()){ + $('#nationalitiestab').click(function(){ + // Don't open a second time + if (nationalityOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=nationalities", null, function (data) { + nationalityOpen = true; + $('#nationalities').html(data); + + turnOnEditDeleteButtons("nationalities"); + + if ($('#next_nationality_i').exists()) { + nationalityid = parseInt($('#next_nationality_i').text()); + } + console.log("Next nationality ID: " + nationalityid); + if ($('#btn_add_nationality').exists()){ + $('#btn_add_nationality').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#nationality_template').clone(); + var html = text.html().replace(/ZZ/g, nationalityid); + $('#add_nationality_div').after(html); + turnOnButtons("nationality", nationalityid); + turnOnTooltips("nationality", nationalityid); + makeEditable("nationality", nationalityid); + nationalityid = nationalityid + 1; + return false; + }); + } + + turnOnTooltipsForTab("nationalities"); + }); + }); + } + + var functionid = 1; + var functionOpen = false; + if ($('#functionstab').exists()){ + $('#functionstab').click(function(){ + // Don't open a second time + if (functionOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=functions", null, function (data) { + functionOpen = true; + $('#functions').html(data); + + turnOnEditDeleteButtons("functions"); + + if ($('#next_function_i').exists()) { + functionid = parseInt($('#next_function_i').text()); + } + console.log("Next function ID: " + functionid); + if ($('#btn_add_function').exists()){ + $('#btn_add_function').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#function_template').clone(); + var html = text.html().replace(/ZZ/g, functionid); + $('#add_function_div').after(html); + turnOnButtons("function", functionid); + turnOnTooltips("function", functionid); + makeEditable("function", functionid); + functionid = functionid + 1; + return false; + }); + } + + turnOnTooltipsForTab("functions"); + }); + }); + } + + var occupationid = 1; + var occupationOpen = false; + if ($('#occupationstab').exists()){ + $('#occupationstab').click(function(){ + // Don't open a second time + if (occupationOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=occupations", null, function (data) { + occupationOpen = true; + $('#occupations').html(data); + + turnOnEditDeleteButtons("occupations"); + + if ($('#next_occupation_i').exists()) { + occupationid = parseInt($('#next_occupation_i').text()); + } + console.log("Next occupation ID: " + occupationid); + if ($('#btn_add_occupation').exists()){ + $('#btn_add_occupation').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#occupation_template').clone(); + var html = text.html().replace(/ZZ/g, occupationid); + $('#add_occupation_div').after(html); + turnOnButtons("occupation", occupationid); + turnOnTooltips("occupation", occupationid); + makeEditable("occupation", occupationid); + occupationid = occupationid + 1; + return false; + }); + } + + turnOnTooltipsForTab("occupations"); + }); + }); + } + + var legalStatusid = 1; + var legalStatusOpen = false; + if ($('#legalStatusestab').exists()){ + $('#legalStatusestab').click(function(){ + // Don't open a second time + if (legalStatusOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=legalStatuses", null, function (data) { + legalStatusOpen = true; + $('#legalStatuses').html(data); + + turnOnEditDeleteButtons("legalStatuses"); + + if ($('#next_legalStatus_i').exists()) { + legalStatusid = parseInt($('#next_legalStatus_i').text()); + } + console.log("Next legalStatus ID: " + legalStatusid); + if ($('#btn_add_legalStatus').exists()){ + $('#btn_add_legalStatus').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#legalStatus_template').clone(); + var html = text.html().replace(/ZZ/g, legalStatusid); + $('#add_legalStatus_div').after(html); + turnOnButtons("legalStatus", legalStatusid); + turnOnTooltips("legalStatus", legalStatusid); + makeEditable("legalStatus", legalStatusid); + legalStatusid = legalStatusid + 1; + return false; + }); + } + + turnOnTooltipsForTab("legalStatuses"); + }); + }); + } + + var placeid = 1; + var placeOpen = false; + if ($('#placestab').exists()){ + $('#placestab').click(function(){ + // Don't open a second time + if (placeOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=places", null, function (data) { + placeOpen = true; + $('#places').html(data); + + // Load the place cache, if needed + loadGeoPlaceResultCache(); + + turnOnEditDeleteButtons("places"); + + if ($('#next_place_i').exists()) { + placeid = parseInt($('#next_place_i').text()); + } + console.log("Next place ID: " + placeid); + if ($('#btn_add_place').exists()){ + $('#btn_add_place').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#place_template').clone(); + var html = text.html().replace(/ZZ/g, placeid); + $('#add_place_div').after(html); + turnOnButtons("place", placeid); + turnOnTooltips("place", placeid); + makeEditable("place", placeid); + placeid = placeid + 1; + return false; + }); + } + + turnOnTooltipsForTab("places"); + }); + }); + } + + var conventionDeclarationid = 1; + var conventionDeclarationOpen = false; + if ($('#conventionDeclarationstab').exists()){ + $('#conventionDeclarationstab').click(function(){ + // Don't open a second time + if (conventionDeclarationOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=conventionDeclarations", null, function (data) { + conventionDeclarationOpen = true; + $('#conventionDeclarations').html(data); + + turnOnEditDeleteButtons("conventionDeclarations"); + + if ($('#next_conventionDeclaration_i').exists()) { + conventionDeclarationid = parseInt($('#next_conventionDeclaration_i').text()); + } + console.log("Next conventionDeclaration ID: " + conventionDeclarationid); + if ($('#btn_add_conventionDeclaration').exists()){ + $('#btn_add_conventionDeclaration').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#conventionDeclaration_template').clone(); + var html = text.html().replace(/ZZ/g, conventionDeclarationid); + $('#add_conventionDeclaration_div').after(html); + turnOnButtons("conventionDeclaration", conventionDeclarationid); + turnOnTooltips("conventionDeclaration", conventionDeclarationid); + makeEditable("conventionDeclaration", conventionDeclarationid); + conventionDeclarationid = conventionDeclarationid + 1; + return false; + }); + } + + turnOnTooltipsForTab("conventionDeclarations"); + }); + }); + } + + var generalContextid = 1; + var generalContextOpen = false; + if ($('#generalContextstab').exists()){ + $('#generalContextstab').click(function(){ + // Don't open a second time + if (generalContextOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=generalContexts", null, function (data) { + generalContextOpen = true; + $('#generalContexts').html(data); + + turnOnEditDeleteButtons("generalContexts"); + + if ($('#next_generalContext_i').exists()) { + generalContextid = parseInt($('#next_generalContext_i').text()); + } + console.log("Next generalContext ID: " + generalContextid); + if ($('#btn_add_generalContext').exists()){ + $('#btn_add_generalContext').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#generalContext_template').clone(); + var html = text.html().replace(/ZZ/g, generalContextid); + $('#add_generalContext_div').after(html); + turnOnButtons("generalContext", generalContextid); + turnOnTooltips("generalContext", generalContextid); + makeEditable("generalContext", generalContextid); + generalContextid = generalContextid + 1; + return false; + }); + } + + turnOnTooltipsForTab("generalContexts"); + }); + }); + } + + var structureOrGenealogyid = 1; + var structureOrGenealogyOpen = false; + if ($('#structureOrGenealogiestab').exists()){ + $('#structureOrGenealogiestab').click(function(){ + // Don't open a second time + if (structureOrGenealogyOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=structureOrGenealogies", null, function (data) { + structureOrGenealogyOpen = true; + $('#structureOrGenealogies').html(data); + + turnOnEditDeleteButtons("structureOrGenealogies"); + + if ($('#next_structureOrGenealogy_i').exists()) { + structureOrGenealogyid = parseInt($('#next_structureOrGenealogy_i').text()); + } + console.log("Next structureOrGenealogy ID: " + structureOrGenealogyid); + if ($('#btn_add_structureOrGenealogy').exists()){ + $('#btn_add_structureOrGenealogy').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#structureOrGenealogy_template').clone(); + var html = text.html().replace(/ZZ/g, structureOrGenealogyid); + $('#add_structureOrGenealogy_div').after(html); + turnOnButtons("structureOrGenealogy", structureOrGenealogyid); + turnOnTooltips("structureOrGenealogy", structureOrGenealogyid); + makeEditable("structureOrGenealogy", structureOrGenealogyid); + structureOrGenealogyid = structureOrGenealogyid + 1; + return false; + }); + } + + turnOnTooltipsForTab("structureOrGenealogies"); + }); + }); + } + + var mandateid = 1; + var mandateOpen = false; + if ($('#mandatestab').exists()){ + $('#mandatestab').click(function(){ + // Don't open a second time + if (mandateOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=mandates", null, function (data) { + mandateOpen = true; + $('#mandates').html(data); + + turnOnEditDeleteButtons("mandates"); + + if ($('#next_mandate_i').exists()) { + mandateid = parseInt($('#next_mandate_i').text()); + } + console.log("Next mandate ID: " + mandateid); + if ($('#btn_add_mandate').exists()){ + $('#btn_add_mandate').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#mandate_template').clone(); + var html = text.html().replace(/ZZ/g, mandateid); + $('#add_mandate_div').after(html); + turnOnButtons("mandate", mandateid); + turnOnTooltips("mandate", mandateid); + makeEditable("mandate", mandateid); + mandateid = mandateid + 1; + return false; + }); + } + + turnOnTooltipsForTab("mandates"); + }); + }); + } + + var biogHistid = 1; + var biogHistOpen = false; + if ($('#biogHiststab').exists()){ + $('#biogHiststab').click(function(){ + // Don't open a second time + if (biogHistOpen) + return; + + $.get(snacUrl+"/edit_part/"+$('#constellationid').val()+"/"+$('#version').val()+"?part=biogHists", null, function (data) { + biogHistOpen = true; + $('#biogHists').html(data); + + turnOnEditDeleteButtons("biogHists"); + + if ($('#next_biogHist_i').exists()) { + biogHistid = parseInt($('#next_biogHist_i').text()); + } + console.log("Next biogHist ID: " + biogHistid); + if ($('#btn_add_biogHist').exists()){ + $('#btn_add_biogHist').click(function(){ + setEditedFlag(true); + //somethingHasBeenEdited = true; + var text = $('#biogHist_template').clone(); + var html = text.html().replace(/ZZ/g, biogHistid); + $('#add_biogHist_div').after(html); + turnOnButtons("biogHist", biogHistid); + turnOnTooltips("biogHist", biogHistid); + makeEditable("biogHist", biogHistid); + biogHistid = biogHistid + 1; + return false; + }); + } + + turnOnTooltipsForTab("biogHists"); + }); + }); + } + + turnOnTooltipsForTab(); + + + $("#info-dropdown").click(function(e) { + $(this).parent().toggleClass("open"); + e.stopPropagation(); + }); + +}); diff --git a/src/virtualhosts/www/javascript/src/main.js b/src/virtualhosts/www/javascript/src/main.js new file mode 100644 index 000000000..3443931fd --- /dev/null +++ b/src/virtualhosts/www/javascript/src/main.js @@ -0,0 +1,12 @@ +import { loadVocabSelectOptions, vocab_select_replace } from "./select_loaders.js"; +import { enableLanguageSelect, markEditedResourceFields, newResourceLanguage, cancelResource, saveResource, selectHoldingRepository, magicNewResourceLanguage } from "./resource_admin.js"; + +window.loadVocabSelectOptions = loadVocabSelectOptions; +window.vocab_select_replace = vocab_select_replace; +window.enableLanguageSelect = enableLanguageSelect; +window.markEditedResourceFields = markEditedResourceFields; +window.newResourceLanguage = newResourceLanguage; +window.cancelResource = cancelResource; +window.saveResource = saveResource; +window.selectHoldingRepository = selectHoldingRepository; +window.magicNewResourceLanguage = magicNewResourceLanguage; diff --git a/src/virtualhosts/www/javascript/src/resource_admin.js b/src/virtualhosts/www/javascript/src/resource_admin.js new file mode 100644 index 000000000..7537722d4 --- /dev/null +++ b/src/virtualhosts/www/javascript/src/resource_admin.js @@ -0,0 +1,191 @@ +/** + * Resource Admin Actions + * + * Contains code that handles Resource creation and editing + * + * @author Joseph Glass + * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * @copyright 2015 the Rector and Visitors of the University of Virginia, and + * the Regents of the University of California + */ + +export function saveResource(event) { + event.preventDefault(); + var $form = $(event.target); + + if ($form.find("#resource-url").val() == "") { + if (!confirm('Are you sure you want to save without an HREF?')) { + return; + } + } + $('#notification-message').slideDown().html("

    Saving Resource... Please wait.

    "); + + // Remove leading and trailing whitespace + $form.find("input, textarea").each(function() { + $(this).val($.trim($(this).val())); + }); + + setDeletedResourceLanguageOperations($form); + + $.post(snacUrl + "/save_resource", $form.serialize()) + .done(function(data) { + createdResource = data; + if (typeof(data.resource) === 'undefined') { + $('#error-message').slideDown(); + return false; + } + $('#notification-message').slideUp(); + $('#success-message').slideDown(); + setTimeout(function() { + window.location = (snacUrl + "/vocab_administrator/resources/" + data.resource.id); + }, 1000); + }) + .fail(function() { + $('#error-message').slideDown(); + }); + return false; +} + + +export function setDeletedResourceLanguageOperations($form) { + // Set deleted new languages to null, set deleted existing languages to delete + var $deletedLanguages = $form.find("#resource-languages .component-deleted").has('input[id]'); + var $ignoredLanguages = $form.find("#resource-languages .component-deleted.new-language"); + setOperations($deletedLanguages, "delete"); + setOperations($ignoredLanguages, ""); +} + +export function cancelResource() { + if (!confirm('Are you sure you want to cancel?')) { + return; + } + + $('#notification-message').html("

    Cancelling...

    "); + $('#notification-message').slideDown(); + setTimeout(function() { + window.location.href = snacUrl + "/vocab_administrator"; + }, 1000); + return false; +} + +/** + * New Resource Language + * Copies the resource template DIV on the page and attaches it correctly to the DOM. + * Tracks language index using $('#language-template').data('languageCount') + * + */ +export function newResourceLanguage(event) { + event.preventDefault(); + var $newLanguage = $('#resource-language-template').find(".language").clone(); + var data = $('#resource-language-template').data(); + var newLanguageID = 'language_' + data.languageCount; + $newLanguage.attr('id', newLanguageID); + $newLanguage.find('.operation').val('insert'); + $newLanguage.addClass('new-language'); + + //update input names with new data.languageCount + $newLanguage.find('input, select').attr('name', function(i, name) { + return name.replace('YY', data.languageCount); + }); + + console.log('Adding new resource language with id: ', newLanguageID); + $newLanguage.toggle(); + // selects last to avoid conflict on multiple clones + $('.add-resource-language:last').before($newLanguage); + enableLanguageSelect($newLanguage); + + data.languageCount++; + return $newLanguage; +} + +/** + * Delete or Undo Language + * + * Toggles component-deleted class, and btn classes for delete and undo. + * Does not change operations. + * + */ +export function deleteOrUndoLanguage(event) { + event.preventDefault(); + var $btn = $(event.currentTarget); + $btn.toggleClass('btn-danger btn-warning'); + $btn.find(':only-child').toggleClass('fa-minus-circle fa-undo'); + var $language = $btn.closest('.language'); + $language.toggleClass('alert-danger component-deleted'); +} + + +function setOperations($elements, operation) { + $elements.find('.operation').each(function() { + $(this).val(operation); + }); +} + +/** + * Mark Edited Resource Fields + * + * Adds edited-field class to altered inputs. Sets altered resource language to update. + * @param jqueryObject $resourceForm jQuery object to modify + * + */ +export function markEditedResourceFields($resourceForm) { + $resourceForm.find("input, select, textarea").on("change", function(e) { + $(e.target).addClass('edited-field'); + + if ($(e.target).closest('.language').length) { + setOperations($(e.target).closest('.language'), "update"); + } + }); +} + +function enableVocabularySelect(selectItem, type) { + selectItem.select2({ + ajax: { + url: snacUrl + "/vocabulary?type=" + type, + dataType: 'json', + delay: 250, + data: function(params) { + return { + q: params.term, + page: params.page + }; + }, + processResults: function(data, page) { + return { + results: data.results + }; + }, + cache: true + }, + width: '100%', + minimumInputLength: 0, + allowClear: true, + theme: 'bootstrap', + placeholder: 'Select' + }); +} + +export function enableLanguageSelect($language) { + enableVocabularySelect($language.find("select:first"), 'language_code'); + enableVocabularySelect($language.find("select:last"), 'script_code'); +} + + +export function magicNewResourceLanguage(event) { + var $newLanguage = newResourceLanguage(event); + var defaultLanguage = new Option(defaults.language.term, defaults.language.id, false, true); + var defaultScript = new Option(defaults.script.term, defaults.script.id, false, true); + $newLanguage.find("select:first").append(defaultLanguage).trigger('change'); + $newLanguage.find("select:last").append(defaultScript).trigger('change'); +} + +export function selectHoldingRepository(event) { + event.preventDefault(); + var name = event.target.innerHTML; + var id = event.target.href.split('/').pop(); + var selectedRepo = new Option(name, id, false, true); + $(".resource-repo:last").append(selectedRepo).trigger('change'); + $("#search_form").slideToggle(); + $("#search-results-box").html(""); + $("#searchbox").val(""); +} diff --git a/src/virtualhosts/www/javascript/src/select_loaders.js b/src/virtualhosts/www/javascript/src/select_loaders.js new file mode 100644 index 000000000..cb8dbed48 --- /dev/null +++ b/src/virtualhosts/www/javascript/src/select_loaders.js @@ -0,0 +1,331 @@ +/** + * Select Box Loaders + * + * Functions that can be used to replace select boxes on the edit page with + * pretty-formatted versions using JQuery and Select2 + * + * @author Robbie Hott + * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * @copyright 2015 the Rector and Visitors of the University of Virginia, and + * the Regents of the University of California + */ + +/** + * Replace a select that is linked to a Vocabulary search + * + * Replaces the select with a select2 object capable of making AJAX queries + * + * @param JQuery selectItem The JQuery item to replace + * @param string idMatch ID string for the object on the page + * @param string type The type of the vocabulary term + * @param int minLength The minimum required length of the autocomplete search + */ +export function vocab_select_replace(selectItem, idMatch, type, minLength) { + if (minLength === undefined) { + minLength = 2; + } + + if(selectItem.attr('id').endsWith(idMatch) + && !selectItem.attr('id').endsWith("ZZ")) { + selectItem.select2({ + ajax: { + url: function() { + var query = snacUrl + "/vocabulary?type="+type+"&id="; + query += $("#constellationid").val()+"&version="+$("#version").val(); + query += "&entity_type="+$("#entityType").val(); + return query; + }, + dataType: 'json', + delay: 250, + data: function (params) { + return { + q: params.term, + page: params.page + }; + }, + processResults: function (data, page) { + return { results: data.results }; + }, + cache: true + }, + width: '100%', + minimumInputLength: minLength, + allowClear: true, + theme: 'bootstrap', + placeholder: 'Select' + }); + } +} + +export var geoPlaceSearchResults = null; + +export function geovocab_select_replace(selectItem, idMatch) { + var minLength = 2; + + if(selectItem.attr('id').endsWith(idMatch) + && !selectItem.attr('id').endsWith("ZZ")) { + selectItem.select2({ + ajax: { + url: function() { + var query = snacUrl+"/vocabulary?type=geo_place&format=term"; + query += "&entity_type="+$("#entityType").val(); + return query; + }, + dataType: 'json', + delay: 250, + data: function (params) { + return { + q: params.term, + page: params.page + }; + }, + processResults: function (data, page) { + if (data.results) { + geoPlaceSearchResults = data.results; + var selectResults = new Array(); + data.results.forEach(function(result) { + selectResults.push({ + id: result.id, + text: result.name + " (" + result.administrationCode + ", " + result.countryCode+ ")" + }) + }); + return {results: selectResults}; + } + return { results: null }; + }, + cache: true + }, + width: '100%', + minimumInputLength: minLength, + allowClear: true, + theme: 'bootstrap', + placeholder: 'Select' + }); + } +} + +var lastSourceSearchResults = null; + +/** + * Add
    helper script + * + * Adds
    to strings so that they can be shown to the user in HTML + * after being input into a text-only field. + */ +function addbr(str) { + if (typeof str !== 'undefined' && str !== null) { + return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, '
    ' + '$1'); + } + return ''; +} + +/** + * Replace a select that is linked to a Constellation Source search + * + * Replaces the select with a select2 object capable of making AJAX queries + * + * @param JQuery selectItem The JQuery item to replace + * @param string idMatch ID string for the object on the page + */ +export function scm_source_select_replace(selectItem, idMatch) { + if(selectItem.attr('id').endsWith(idMatch) + && !selectItem.attr('id').endsWith("ZZ")) { + selectItem.select2({ + ajax: { + url: function() { + var query = snacUrl+"/vocabulary?type=ic_sources&id="; + query += $("#constellationid").val()+"&version="+$("#version").val(); + query += "&entity_type="+$("#entityType").val(); + return query; + }, + dataType: 'json', + delay: 250, + data: function (params) { + return { + q: params.term, + page: params.page + }; + }, + processResults: function (data, page) { + // Modify the results to be in the format we want + lastSourceSearchResults = data.results; + // need id, text + var results = new Array(); + data.results.forEach(function(res) { + results.push({id: res.id, text: res.displayName}); + }); + return { results: results }; + }, + cache: true + }, + width: '100%', + minimumInputLength: 0, + allowClear: true, + theme: 'bootstrap', + placeholder: 'Select' + }); + + selectItem.on('change', function (evt) { + // TODO: Get the current selected value and update the well in the page to reflect it! + // Note: all the selections are available in the global lastSourceSearchResults variable. + var sourceID = $(this).val(); + var inPageID = $(this).attr("id"); + var idArray = inPageID.split("_"); + if (idArray.length >= 6) { + var i = idArray[5]; + var j = idArray[4]; + var shortName = idArray[1]; + lastSourceSearchResults.forEach(function(source) { + if (source.id == sourceID) { + // Update the text of the source + if (typeof source.text !== 'undefined') { + $("#scm_" + shortName + "_source_text_" + j + "_" + i).html(addbr(source.text)).removeClass('hidden'); + $("#scm_" + shortName + "_source_text_" + j + "_" + i).closest(".panel-body").removeClass('hidden'); + } else { + $("#scm_" + shortName + "_source_text_" + j + "_" + i).text("").addClass('hidden'); + $("#scm_" + shortName + "_source_text_" + j + "_" + i).closest(".panel-body").addClass('hidden'); + + } + // Update the URI of the source + if (typeof source.uri !== 'undefined') + $("#scm_" + shortName + "_source_uri_" + j + "_" + i).html(''+source.uri+''); + else + $("#scm_" + shortName + "_source_uri_" + j + "_" + i).html(''); + // Update the URI of the source + if (typeof source.citation !== 'undefined') + $("#scm_" + shortName + "_source_citation_" + j + "_" + i).html(source.citation).removeClass('hidden'); + else + $("#scm_" + shortName + "_source_citation_" + j + "_" + i).html('').addClass('hidden'); + } + }); + } + }); + + } +} + +/** + * Replace a select that is linked to an affiliation search + * + * Replaces the select with a select2 object capable of making AJAX queries + * + * @param JQuery selectItem The JQuery item to replace + */ +function affiliation_select_replace(selectItem) { + $.get(snacUrl + "/vocabulary?type=affiliation").done(function(data) { + var options = data.results; + selectItem.select2({ + data: options, + allowClear: true, + theme: "bootstrap", + placeholder: "Select Affiliation" + }); + }); +} + +function reviewer_select_replace(selectItem) { + if(selectItem != null) { + selectItem.select2({ + placeholder: "Reviewer Name or Email...", + ajax: { + url: function() { + var query = snacUrl+"/user_search?role=Reviewer"; + return query; + }, + dataType: 'json', + delay: 250, + data: function (params) { + return { + q: params.term, + page: params.page + }; + }, + processResults: function (data, page) { + return { results: data.results }; + }, + cache: true + }, + width: '100%', + minimumInputLength: 1, + allowClear: false, + theme: 'bootstrap' + }); + } +} + +function select_replace(selectItem, idMatch) { + if(selectItem.attr('id').endsWith(idMatch) + && !selectItem.attr('id').endsWith("ZZ")) { + selectItem.select2({ + allowClear: true, + theme: 'bootstrap' + }); + } +} + +export function select_replace_simple(selectItem) { + selectItem.select2({ + width: '100%', + allowClear: true, + theme: 'bootstrap' + }); +} + +/** + * Load Vocab Select Options + * + * Replaces the select with a select2 object preloaded with an array of options + * + * @param JQuery selectItem The JQuery item to replace + * @param string type The type of the vocabulary term + * @param string type Text placeholder for select + */ +export function loadVocabSelectOptions(selectItem, type, placeholder) { + return $.get(snacUrl + "/vocabulary?type=" + type) + .done(function(data) { + var options = data.results; + selectItem.select2({ + data: options, + allowClear: false, + theme: 'bootstrap', + placeholder: placeholder + }); + }); +} + +/** + * Replace all the selects that exist on the page when the page has finished loading + */ +$(document).ready(function() { + // Use select2 to display the select dropdowns + // rather than the HTML default + $("select").each(function() { + if (typeof $(this).attr('id') !== typeof undefined && $(this).attr('id') !== false) { + // Replace the subject selects + vocab_select_replace($(this), "language_language_", "language_code", 1); + + // Replace the subject selects + vocab_select_replace($(this), "language_script_", "script_code", 1); + + // Replace the subject selects + vocab_select_replace($(this), "subject_", "subject", 4); + + // Replace the function selects + vocab_select_replace($(this), "function_", "function", 4); + + // Replace the occupation selects + vocab_select_replace($(this), "occupation_", "occupation", 4); + + // Replace the entityType select + vocab_select_replace($(this), "entityType", "entity_type", 0); + } + }); + + // Replace the Affiliation dropdowns, if one exists + if ($("#affiliationid").exists()) + affiliation_select_replace($("#affiliationid")); + + // Replace the User search dropdown, if one exists + if ($("#reviewersearchbox").exists()) + reviewer_select_replace($("#reviewersearchbox")); +}); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..725e8fe6f --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,29 @@ +const path = require('path'); +const js_path = path.join(__dirname, "src/virtualhosts/www/javascript") + +module.exports = (env) => { + const isProduction = env === 'production'; + return { + mode: isProduction ? 'production' : 'development', + entry: { + bundle: path.join(js_path, "src", "main.js"), + resource_admin: path.join(js_path, "src", "resource_admin.js"), + edit_scripts: path.join(js_path, "src", "edit_scripts.js"), + select_loaders: path.join(js_path, "src", "select_loaders.js"), + }, + output: { + path: js_path, + filename: "[name].js", + libraryTarget: "window" + }, + devtool: isProduction ? 'source-map' : "cheap-module-eval-source-map", + watch: !isProduction, + module: { + rules: [{ + loader: "babel-loader", + test: /\.js$/, + exclude: /node_modules/ + }] + }, + }; +}; diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..b7e21396b --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3037 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@webassemblyjs/ast@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" + integrity sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA== + dependencies: + "@webassemblyjs/helper-module-context" "1.9.0" + "@webassemblyjs/helper-wasm-bytecode" "1.9.0" + "@webassemblyjs/wast-parser" "1.9.0" + +"@webassemblyjs/floating-point-hex-parser@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz#3c3d3b271bddfc84deb00f71344438311d52ffb4" + integrity sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA== + +"@webassemblyjs/helper-api-error@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz#203f676e333b96c9da2eeab3ccef33c45928b6a2" + integrity sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw== + +"@webassemblyjs/helper-buffer@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz#a1442d269c5feb23fcbc9ef759dac3547f29de00" + integrity sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA== + +"@webassemblyjs/helper-code-frame@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz#647f8892cd2043a82ac0c8c5e75c36f1d9159f27" + integrity sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA== + dependencies: + "@webassemblyjs/wast-printer" "1.9.0" + +"@webassemblyjs/helper-fsm@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz#c05256b71244214671f4b08ec108ad63b70eddb8" + integrity sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw== + +"@webassemblyjs/helper-module-context@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz#25d8884b76839871a08a6c6f806c3979ef712f07" + integrity sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g== + dependencies: + "@webassemblyjs/ast" "1.9.0" + +"@webassemblyjs/helper-wasm-bytecode@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz#4fed8beac9b8c14f8c58b70d124d549dd1fe5790" + integrity sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw== + +"@webassemblyjs/helper-wasm-section@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz#5a4138d5a6292ba18b04c5ae49717e4167965346" + integrity sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-buffer" "1.9.0" + "@webassemblyjs/helper-wasm-bytecode" "1.9.0" + "@webassemblyjs/wasm-gen" "1.9.0" + +"@webassemblyjs/ieee754@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz#15c7a0fbaae83fb26143bbacf6d6df1702ad39e4" + integrity sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz#f19ca0b76a6dc55623a09cffa769e838fa1e1c95" + integrity sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz#04d33b636f78e6a6813227e82402f7637b6229ab" + integrity sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w== + +"@webassemblyjs/wasm-edit@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz#3fe6d79d3f0f922183aa86002c42dd256cfee9cf" + integrity sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-buffer" "1.9.0" + "@webassemblyjs/helper-wasm-bytecode" "1.9.0" + "@webassemblyjs/helper-wasm-section" "1.9.0" + "@webassemblyjs/wasm-gen" "1.9.0" + "@webassemblyjs/wasm-opt" "1.9.0" + "@webassemblyjs/wasm-parser" "1.9.0" + "@webassemblyjs/wast-printer" "1.9.0" + +"@webassemblyjs/wasm-gen@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz#50bc70ec68ded8e2763b01a1418bf43491a7a49c" + integrity sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-wasm-bytecode" "1.9.0" + "@webassemblyjs/ieee754" "1.9.0" + "@webassemblyjs/leb128" "1.9.0" + "@webassemblyjs/utf8" "1.9.0" + +"@webassemblyjs/wasm-opt@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz#2211181e5b31326443cc8112eb9f0b9028721a61" + integrity sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-buffer" "1.9.0" + "@webassemblyjs/wasm-gen" "1.9.0" + "@webassemblyjs/wasm-parser" "1.9.0" + +"@webassemblyjs/wasm-parser@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz#9d48e44826df4a6598294aa6c87469d642fff65e" + integrity sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-api-error" "1.9.0" + "@webassemblyjs/helper-wasm-bytecode" "1.9.0" + "@webassemblyjs/ieee754" "1.9.0" + "@webassemblyjs/leb128" "1.9.0" + "@webassemblyjs/utf8" "1.9.0" + +"@webassemblyjs/wast-parser@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz#3031115d79ac5bd261556cecc3fa90a3ef451914" + integrity sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/floating-point-hex-parser" "1.9.0" + "@webassemblyjs/helper-api-error" "1.9.0" + "@webassemblyjs/helper-code-frame" "1.9.0" + "@webassemblyjs/helper-fsm" "1.9.0" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/wast-printer@1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz#4935d54c85fef637b00ce9f52377451d00d47899" + integrity sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/wast-parser" "1.9.0" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn@^6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" + integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== + +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== + +ajv-keywords@^3.1.0, ajv-keywords@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" + integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== + +ajv@^6.1.0, ajv@^6.10.2: + version "6.12.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" + integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +assert@^1.1.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0, babel-core@^6.26.3: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-loader@7: + version "7.1.5" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.5.tgz#e3ee0cd7394aa557e013b02d3e492bfd07aa6d68" + integrity sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw== + dependencies: + find-cache-dir "^1.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-js@^1.0.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" + integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bluebird@^3.5.5: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + +bn.js@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.1.tgz#48efc4031a9c4041b9c99c6941d903463ab62eb5" + integrity sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.1.0.tgz#4fe971b379a5aeb4925e06779f9fa1f41d249d70" + integrity sha512-VYxo7cDCeYUoBZ0ZCy4UyEUCP3smyBd4DRQM5nrFS1jJjPJjX7rP3oLRpPoWfkhQfyJ0I9ZbHbKafrFD/SGlrg== + dependencies: + bn.js "^5.1.1" + browserify-rsa "^4.0.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.5.2" + inherits "^2.0.4" + parse-asn1 "^5.1.5" + readable-stream "^3.6.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@^4.3.0: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + +cacache@^12.0.2: + version "12.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" + integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ== + dependencies: + bluebird "^3.5.5" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.4" + graceful-fs "^4.1.15" + infer-owner "^1.0.3" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.3" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +chalk@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chokidar@^2.1.8: + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +chrome-trace-event@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" + integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== + dependencies: + tslib "^1.9.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.5.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-browserify@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" + integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@6.0.5, cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +cyclist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" + integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +des.js@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +elliptic@^6.0.0, elliptic@^6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" + integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= + +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enhanced-resolve@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +enhanced-resolve@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz#2937e2b8066cd0fe7ce0990a98f0d71a35189f66" + integrity sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.5.0" + tapable "^1.0.0" + +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.1.0, estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +events@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59" + integrity sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + dependencies: + homedir-polyfill "^1.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fast-deep-equal@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +figgy-pudding@^3.5.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" + integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-cache-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + integrity sha1-kojj6ePMN0hxfTnq3hfPcfww7m8= + dependencies: + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^2.0.0" + +find-cache-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== + dependencies: + commondir "^1.0.1" + make-dir "^2.0.0" + pkg-dir "^3.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +findup-sync@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" + integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== + dependencies: + detect-file "^1.0.0" + is-glob "^4.0.0" + micromatch "^3.0.4" + resolve-dir "^1.0.1" + +flush-write-stream@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.7: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.1.3, glob@^7.1.4: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +homedir-polyfill@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== + dependencies: + parse-passwd "^1.0.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= + +import-local@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +infer-owner@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" + integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@^1.3.4, ini@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +interpret@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-windows@^1.0.1, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + +loader-runner@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== + +loader-utils@1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + +loader-utils@^1.0.2, loader-utils@^1.2.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^1.0.1" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash@^4.17.4: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== + dependencies: + pify "^3.0.0" + +make-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +memory-fs@^0.4.0, memory-fs@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +memory-fs@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c" + integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA== + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.1, mkdirp@^0.5.3: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +nan@^2.12.1: + version "2.14.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" + integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +neo-async@^2.5.0, neo-async@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-libs-browser@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" + integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^3.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.1" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.11.0" + vm-browserify "^1.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +pako@~1.0.5: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + +parallel-transform@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" + integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== + dependencies: + cyclist "^1.0.1" + inherits "^2.0.3" + readable-stream "^2.1.5" + +parse-asn1@^5.0.0, parse-asn1@^5.1.5: + version "5.1.5" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" + integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" + integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@^1.2.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@^2.5.4, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= + dependencies: + aproba "^1.1.1" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" + +semver@^5.5.0, semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +serialize-javascript@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" + integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + +source-map-support@~0.5.12: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +ssri@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + dependencies: + figgy-pudding "^3.5.1" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stream-browserify@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" + integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@^1.0.0, string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +supports-color@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +tapable@^1.0.0, tapable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== + +terser-webpack-plugin@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c" + integrity sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA== + dependencies: + cacache "^12.0.2" + find-cache-dir "^2.1.0" + is-wsl "^1.1.0" + schema-utils "^1.0.0" + serialize-javascript "^2.1.2" + source-map "^0.6.1" + terser "^4.1.2" + webpack-sources "^1.4.0" + worker-farm "^1.7.0" + +terser@^4.1.2: + version "4.6.13" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.13.tgz#e879a7364a5e0db52ba4891ecde007422c56a916" + integrity sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +timers-browserify@^2.0.4: + version "2.0.11" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.11.tgz#800b1f3eee272e5bc53ee465a04d0e804c31211f" + integrity sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ== + dependencies: + setimmediate "^1.0.4" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tslib@^1.9.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.2.tgz#9c79d83272c9a7aaf166f73915c9667ecdde3cc9" + integrity sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg== + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unique-filename@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" + integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== + dependencies: + imurmurhash "^0.1.4" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" + integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== + dependencies: + inherits "2.0.3" + +v8-compile-cache@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" + integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== + +vm-browserify@^1.0.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" + integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== + +watchpack@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.1.tgz#280da0a8718592174010c078c7585a74cd8cd0e2" + integrity sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA== + dependencies: + chokidar "^2.1.8" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +webpack-cli@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.11.tgz#3bf21889bf597b5d82c38f215135a411edfdc631" + integrity sha512-dXlfuml7xvAFwYUPsrtQAA9e4DOe58gnzSxhgrO/ZM/gyXTBowrsYeubyN4mqGhYdpXMFNyQ6emjJS9M7OBd4g== + dependencies: + chalk "2.4.2" + cross-spawn "6.0.5" + enhanced-resolve "4.1.0" + findup-sync "3.0.0" + global-modules "2.0.0" + import-local "2.0.0" + interpret "1.2.0" + loader-utils "1.2.3" + supports-color "6.1.0" + v8-compile-cache "2.0.3" + yargs "13.2.4" + +webpack-sources@^1.4.0, webpack-sources@^1.4.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" + integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@^4.43.0: + version "4.43.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.43.0.tgz#c48547b11d563224c561dad1172c8aa0b8a678e6" + integrity sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g== + dependencies: + "@webassemblyjs/ast" "1.9.0" + "@webassemblyjs/helper-module-context" "1.9.0" + "@webassemblyjs/wasm-edit" "1.9.0" + "@webassemblyjs/wasm-parser" "1.9.0" + acorn "^6.4.1" + ajv "^6.10.2" + ajv-keywords "^3.4.1" + chrome-trace-event "^1.0.2" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.3" + json-parse-better-errors "^1.0.2" + loader-runner "^2.4.0" + loader-utils "^1.2.3" + memory-fs "^0.4.1" + micromatch "^3.1.10" + mkdirp "^0.5.3" + neo-async "^2.6.1" + node-libs-browser "^2.2.1" + schema-utils "^1.0.0" + tapable "^1.1.3" + terser-webpack-plugin "^1.4.3" + watchpack "^1.6.1" + webpack-sources "^1.4.1" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.14, which@^1.2.9, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +worker-farm@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" + integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== + dependencies: + errno "~0.1.7" + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yargs-parser@^13.1.0: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@13.2.4: + version "13.2.4" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" + integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.0"