{"version":3,"sources":["webpack:///./packages/jquery-scroll-to-visible/index.js","webpack:///./packages/deparam/index.js","webpack:///./packages/obj-unflatten/index.js","webpack:///./public/javascripts/translations/lib.text_helper.js","webpack:///./ui/shims/dummyI18nResource.js?24a1","webpack:///./ui/shared/util/TextHelper.coffee","webpack:///./public/javascripts/translations/instructure_misc_plugins.js","webpack:///./ui/shims/dummyI18nResource.js?726f","webpack:///./ui/shared/jquery/jquery.instructure_misc_plugins.js"],"names":["fn","scrollToVisible","obj","options","$obj","length","innerOffset","offset","width","outerWidth","height","outerHeight","top","bottom","left","right","currentTop","this","selector","windowScrollTop","scrollTop","currentLeft","scrollLeft","currentHeight","currentWidth","outerOffset","each","e","tagName","window","coerceTypes","true","false","null","deparam","params","coerce","currentQueryString","location","search","arguments","replace","split","forEach","param","key","val","decodeURIComponent","isNaN","undefined","unflatten","reduce","newObj","keys","lastKey","test","shift","concat","i","cur","isArray","push","Object","create","mergeI18nTranslations","JSON","parse","scoped","AUTO_LINKIFY_PLACEHOLDER","AUTO_LINKIFY_REGEX","th","quoteClump","lines","t","raw","join","formatMessage","message","links","placeholderBlocks","match","link","RegExp","processedLines","quoteBlock","line","delimit","number","String","sign","abs","Math","integer","floor","result","mod","truncateText","string","max","ellipsis","wordSeparator","trim","truncateAt","pos","indexOf","substring","plainText","$","setOptions","prompt","htmlEscape","opt","optHtml","html","ifExists","func","call","scrollbarWidth","$div","appendTo","$innerDiv","find","w1","innerWidth","css","w2","remove","dim","speed","animate","opacity","undim","confirmDelete","extend","defaults","$object","$dialog","noMessage","no_message","onContinue","cancelled","isFunction","confirmed","url","success","data","fadeOut","prepareData","authenticity_token","ajaxJSON","request","status","error","unhandledXHRs","skipConfirmations","dialog","dialog_options","confirmation_class","includes","modal","close","buttons","text","I18n","click","class","confirm","fragmentChange","query","query_hash","item","bind","$doc","found","_checkFragments","fragmentList","doc","fragment","setTimeout","triggerHandler","hash","list","idx","clickLink","eq","hasClass","showIf","bool","index","show","hide","disableIf","prop","indicate","$indicator","zIndex","container","document","createElement","position","display","border","backgroundColor","addClass","mouseover","stop","append","singleFlash","fadeIn","scroll","hasScrollbar","clientHeight","scrollHeight","log","msg","console","fillWindowWithMe","opts","minHeight","$this","$wrapper","$main","$not_right_side","$window","$toResize","add","alsoResize","fillWindowWithThisElement","spaceLeftForThis","newHeight","onResize","unbind","autoGrowInput","o","maxWidth","minWidth","comfortZone","filter","input","testSubject","fontSize","fontFamily","fontWeight","letterSpacing","whiteSpace","check","testerWidth","newWidth","isValidWidthChange","insertAfter"],"mappings":";AAAA;AAAA;AAAA;AAwBA,IAAEA,GAAGC,gBAAkB,SAASC,GAC9B,MAAMC,EAAU;AAChB,MAAMC,EAAO,IAAEF;AAEf,GAAoB,IAAhBE,EAAKC,OACP;AAEF,IAAIC,EAAcF,EAAKG,SACrBC,EAAQJ,EAAKK,aACbC,EAASN,EAAKO,cACdC,EAAMN,EAAYM,IAClBC,EAASD,EAAMF,EACfI,EAAOR,EAAYQ,KACnBC,EAAQD,EAAON,EACfQ,EAA8B,aAAjBC,KAAKC,SAA0B,IAAEC,kBAAoBF,KAAKG,YACvEC,EAAcJ,KAAKK,aACnBC,EAAgBN,KAAKN,cACrBa,EAAeP,KAAKR;AAEtB,GAAqB,aAAjBQ,KAAKC,SAAyB,CAChC,IAAIO,EAAc,IAAE,QAAQlB;AAC5BU,KAAKS,MAAK,WACR,IACED,EAAc,IAAER,MAAMV;AACtB,OAAO,MACP,MAAOoB;AAEXf,GAAOa,EAAYb;AACnBC,GAAUY,EAAYb;AACtBE,GAAQW,EAAYX;AACpBC,GAASU,EAAYX,KAGvB,GAAuB,QAAnBG,KAAK,GAAGW,SAAwC,QAAnBX,KAAK,GAAGW,QAAmB,CAC1DL,EAAgB,IAAEM,QAAQnB;AACtB,IAAE,uBAAuBL,OAAS,IACpCkB,GAAiB,IAAE,uBAAuBb;AAE5Cc,EAAe,IAAEK,QAAQrB;AACzBI,GAAOI;AACPF,GAAQO;AACRR,GAAUG;AACVD,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C0E;AAGnD,OAAOpO;AAGM0F,EAAf","file":"34-c-953d7c590b.js","sourcesContent":["/*\n * Copyright (C) 2011 - present Instructure, Inc.\n *\n * This file is part of Canvas.\n *\n * Canvas is free software: you can redistribute it and/or modify it under\n * the terms of the GNU Affero General Public License as published by the Free\n * Software Foundation, version 3 of the License.\n *\n * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Affero General Public License along\n * with this program. If not, see .\n */\n\n// Scrolls the supplied object until its visible. Call from\n// (\"html,body\") to scroll the window.\n\nimport $ from 'jquery'\nimport './jquery.scrollTo'\n\n$.fn.scrollToVisible = function(obj) {\n const options = {}\n const $obj = $(obj)\n\n if ($obj.length === 0) {\n return\n }\n let innerOffset = $obj.offset(),\n width = $obj.outerWidth(),\n height = $obj.outerHeight(),\n top = innerOffset.top,\n bottom = top + height,\n left = innerOffset.left,\n right = left + width,\n currentTop = this.selector == 'html,body' ? $.windowScrollTop() : this.scrollTop(),\n currentLeft = this.scrollLeft(),\n currentHeight = this.outerHeight(),\n currentWidth = this.outerWidth()\n\n if (this.selector != 'html,body') {\n let outerOffset = $('body').offset()\n this.each(function() {\n try {\n outerOffset = $(this).offset()\n return false\n } catch (e) {}\n })\n top -= outerOffset.top\n bottom -= outerOffset.top\n left -= outerOffset.left\n right -= outerOffset.left\n }\n\n if (this[0].tagName == 'HTML' || this[0].tagName == 'BODY') {\n currentHeight = $(window).height()\n if ($('#wizard_box:visible').length > 0) {\n currentHeight -= $('#wizard_box:visible').height()\n }\n currentWidth = $(window).width()\n top -= currentTop\n left -= currentLeft\n bottom -= currentTop\n right -= currentLeft\n }\n if (top < 0 || (currentHeight < height && bottom > currentHeight)) {\n options.scrollTop = top + currentTop\n } else if (bottom > currentHeight) {\n options.scrollTop = bottom + currentTop - currentHeight + 20\n }\n if (left < 0) {\n options.scrollLeft = left + currentLeft\n } else if (right > currentWidth) {\n options.scrollLeft = right + currentLeft - currentWidth + 20\n }\n if (options.scrollTop == 1) {\n options.scrollTop = 0\n }\n if (options.scrollLeft == 1) {\n options.scrollLeft = 0\n }\n\n this.scrollTop(options.scrollTop)\n this.scrollLeft(options.scrollLeft)\n\n return this\n}\n","//\n// Copyright (C) 2012 - present Instructure, Inc.\n//\n// This file is part of Canvas.\n//\n// Canvas is free software: you can redistribute it and/or modify it under\n// the terms of the GNU Affero General Public License as published by the Free\n// Software Foundation, version 3 of the License.\n//\n// Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n// A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n// details.\n//\n// You should have received a copy of the GNU Affero General Public License along\n// with this program. If not, see .\n\n// an extraction of the deparam method from Ben Alman's jQuery BBQ\n// http://benalman.com/projects/jquery-bbq-plugin/\n\nimport unflatten from 'obj-unflatten'\n\nconst coerceTypes = {\n true: true,\n false: false,\n null: null\n}\n\nexport default function deparam(params, coerce) {\n // shortcut for just deparam'ing the current querystring\n if (!params || typeof params === 'boolean') {\n const currentQueryString = window.location.search\n if (!currentQueryString) return {}\n return deparam(currentQueryString, ...arguments)\n }\n\n const obj = {}\n params\n .replace(/\\+/g, ' ')\n .split('&')\n .forEach(param => {\n let [key, val] = param.split('=')\n key = decodeURIComponent(key)\n val = decodeURIComponent(val)\n\n // coerce values.\n if (coerce) {\n val =\n val && !isNaN(val)\n ? +val // number\n : val === 'undefined'\n ? undefined // undefined\n : coerceTypes[val] !== undefined\n ? coerceTypes[val] // true, false, null\n : val // string\n }\n\n obj[key] = val\n })\n\n return unflatten(obj)\n}\n","//\n// Copyright (C) 2012 - present Instructure, Inc.\n//\n// This file is part of Canvas.\n//\n// Canvas is free software: you can redistribute it and/or modify it under\n// the terms of the GNU Affero General Public License as published by the Free\n// Software Foundation, version 3 of the License.\n//\n// Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n// A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n// details.\n//\n// You should have received a copy of the GNU Affero General Public License along\n// with this program. If not, see .\n\nimport _ from 'underscore'\n\n// turns {'foo[bar]': 1} into {foo: {bar: 1}}\nexport default function unflatten(obj) {\n return _(obj).reduce((newObj, val, key) => {\n let keys = key.split('][')\n let lastKey = keys.length - 1\n\n // If the first keys part contains [ and the last ends with ], then []\n // are correctly balanced.\n if (/\\[/.test(keys[0]) && /\\]$/.test(keys[lastKey])) {\n // Remove the trailing ] from the last keys part.\n keys[lastKey] = keys[lastKey].replace(/\\]$/, '')\n\n // Split first keys part into two parts on the [ and add them back onto\n // the beginning of the keys array.\n keys = keys\n .shift()\n .split('[')\n .concat(keys)\n lastKey = keys.length - 1\n } else {\n // Basic 'foo' style key.\n lastKey = 0\n }\n\n if (lastKey) {\n // Complex key, build deep object structure based on a few rules:\n // * The 'cur' pointer starts at the object top-level.\n // * [] = array push (n is set to array length), [n] = array if n is\n // numeric, otherwise object.\n // * If at the last keys part, set the value.\n // * For each keys part, if the current level is undefined create an\n // object or array based on the type of the next keys part.\n // * Move the 'cur' pointer to the next level.\n // * Rinse & repeat.\n let i = 0\n let cur = newObj\n while (i <= lastKey) {\n key = keys[i] === '' ? cur.length : keys[i]\n\n cur = cur[key] =\n i < lastKey ? cur[key] || (keys[i + 1] && isNaN(keys[i + 1]) ? {} : []) : val\n i++\n }\n } else {\n // Simple key, even simpler rules, since only scalars and shallow\n // arrays are allowed.\n\n if (_.isArray(newObj[key])) {\n // val is already an array, so push on the next value.\n newObj[key].push(val)\n } else if (newObj[key] != null) {\n // val isn't an array, but since a second value has been specified,\n // convert val into an array.\n newObj[key] = [newObj[key], val]\n } else {\n // val is a scalar.\n newObj[key] = val\n }\n }\n\n return newObj\n }, Object.create(null))\n}\n","// this file was auto-generated by rake i18n:generate_js.\n// you probably shouldn't edit it directly\nimport mergeI18nTranslations from '@canvas/i18n/mergeI18nTranslations.js';\n\n// we use JSON.parse here instead of just loading it as a javascript object literal\n// because according to https://v8.dev/blog/cost-of-javascript-2019#json that is faster\nmergeI18nTranslations(JSON.parse(\"{\\\"ar\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"إظهار النص المقتبس\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"ca\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"mostra el text citat\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"cy\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"dangos testun wedi’i ddyfynnu\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"da\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"vis tekst i gåseøjne\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"da-x-k12\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"vis tekst i gåseøjne\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"de\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"zitierten Text zeigen\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"el\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"προβολή κειμένου που παρατίθεται\\\"}}},\\\"en\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"show quoted text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"en-AU\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"show quoted text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"en-CA\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"show quoted text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"en-GB\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"show quoted text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"es\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"mostrar texto citado\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"fa\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"نمایش متن نقل شده\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"fi\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"näytä lainattu teksti\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"fr\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"afficher le texte entre guillemets\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"fr-CA\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"afficher le texte entre guillemets\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"he\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"מציג ציטוט\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"ht\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"afiche tèks site\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"hu\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"idézett szöveg megjelenítése\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"hy\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"ցույց տալ մեջբերվող տեքստը\\\",\\\"word_separator\\\":\\\"-\\\"}}},\\\"is\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"Sýna ívitnaðan texta\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"it\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"mostra testo citato\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"ja\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"引用したテキストを表示\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"ko\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"인용된 텍스트 표시\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"mi\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"whakaatu kuputuhi faahiti\\\",\\\"word_separator\\\":\\\"-\\\"}}},\\\"nb\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"vis den merkede teksten\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"nb-x-k12\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"vis den merkede teksten\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"nl\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"geciteerde tekst tonen\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"nn\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"vis sitert tekst\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"pl\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"pokaż cytowany fragment tekstu\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"pt\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"exibir texto citado\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"pt-BR\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"exibir texto citado\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"ru\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"показать цитированный текст\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"sl\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"prikaži citirano besedilo\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"sv\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"visa citerad text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"sv-x-k12\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"visa citerad text\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"tr\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"alıntılanan metni göster\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"uk\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"Показати цитований текст\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"zh-Hans\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"显示引用的文本\\\",\\\"word_separator\\\":\\\" \\\"}}},\\\"zh-Hant\\\":{\\\"lib\\\":{\\\"text_helper\\\":{\\\"ellipsis\\\":\\\"...\\\",\\\"quoted_text_toggle\\\":\\\"顯示引用的文字\\\",\\\"word_separator\\\":\\\" \\\"}}}}\"));\n","\n import I18n from '@canvas/i18n/i18nObj';\n \n import 'translations/lib.text_helper';\n import 'translations/_core';\n \n import 'translations/_core_en';\n\n export default I18n.scoped('lib.text_helper');\n ","#\n# Copyright (C) 2012 - present Instructure, Inc.\n#\n# This file is part of Canvas.\n#\n# Canvas is free software: you can redistribute it and/or modify it under\n# the terms of the GNU Affero General Public License as published by the Free\n# Software Foundation, version 3 of the License.\n#\n# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n# details.\n#\n# You should have received a copy of the GNU Affero General Public License along\n# with this program. If not, see .\n#\n\nimport $ from 'jquery'\nimport I18n from 'i18n!lib.text_helper'\nimport htmlEscape from 'html-escape'\n\nAUTO_LINKIFY_PLACEHOLDER = \"LINK-PLACEHOLDER\"\nAUTO_LINKIFY_REGEX = ///\n \\b\n ( # Capture 1: entire matched URL\n (?:\n https?:// # http or https protocol\n | # or\n www\\d{0,3}[.] # \"www.\", \"www1.\", \"www2.\" … \"www999.\"\n | # or\n [a-z0-9.\\-]+[.][a-z]{2,4}/ # looks like domain name followed by a slash\n )\n\n (?:\n [^\\s()<>]+ # Run of non-space, non-()<>\n | # or\n \\([^\\s()<>]*\\) # balanced parens, single level\n )+\n\n (?:\n \\([^\\s()<>]*\\) # balanced parens, single level\n | # or\n [^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’] # End with: not a space or one of these punct chars\n )\n ) | (\n LINK-PLACEHOLDER\n )\n///gi\n\nexport default th =\n quoteClump: (lines) ->\n \"\"\n\n formatMessage: (message) ->\n # replace any links with placeholders so we don't escape them\n links = []\n placeholderBlocks = []\n message = message.replace AUTO_LINKIFY_REGEX, (match, i) ->\n placeholderBlocks.push(if match == AUTO_LINKIFY_PLACEHOLDER\n AUTO_LINKIFY_PLACEHOLDER\n else\n link = match\n link = \"http://\" + link unless link[0..6] == 'http://' or link[0..7] == 'https://'\n links.push link\n \"#{htmlEscape(match)}\"\n )\n AUTO_LINKIFY_PLACEHOLDER\n\n # now escape html\n message = htmlEscape message\n\n # now put the links back in\n message = message.replace new RegExp(AUTO_LINKIFY_PLACEHOLDER, 'g'), (match, i) ->\n placeholderBlocks.shift()\n\n # replace newlines\n message = message.replace /\\n/g, '
\\n'\n\n # generate quoting clumps\n processedLines = []\n quoteBlock = []\n for line in message.split(\"\\n\")\n if line.match /^(>|>)/\n quoteBlock.push line\n else\n processedLines.push th.quoteClump(quoteBlock) if quoteBlock.length\n quoteBlock = []\n processedLines.push line\n processedLines.push th.quoteClump(quoteBlock) if quoteBlock.length\n message = processedLines.join \"\\n\"\n\n delimit: (number) ->\n # only process real numbers\n return String(number) if isNaN number\n\n # capture sign and then start working with the absolute value. don't\n # process infinities.\n sign = if number < 0 then '-' else ''\n abs = Math.abs number\n return String(number) if abs is Infinity\n\n # break out the integer portion and initialize the result to just the\n # decimal (if any)\n integer = Math.floor abs\n result = if abs == integer then '' else String(abs).replace(/^\\d+\\./, '.')\n\n # for each comma'd chunk, prepend to the result and remove from integer\n while integer >= 1000\n mod = String(integer).replace(/\\d+(\\d\\d\\d)$/, ',$1')\n integer = Math.floor integer / 1000\n result = mod + result\n\n # integer is now either in [1, 999], or equal to 0 iff number in (-1, 1).\n # prepend it with the sign\n sign + String(integer) + result\n\n truncateText: (string, options = {}) ->\n max = options.max ? 30\n ellipsis = I18n.t('ellipsis', '...')\n wordSeparator = I18n.t('word_separator', ' ')\n\n string = (string ? \"\").replace(/\\s+/g, wordSeparator).trim()\n return string if not string or string.length <= max\n\n truncateAt = 0\n while true\n pos = string.indexOf(wordSeparator, truncateAt + 1)\n break if pos < 0 || pos > max - ellipsis.length\n truncateAt = pos\n truncateAt or= max - ellipsis.length # first word > max, so we cut it\n\n string.substring(0, truncateAt) + ellipsis\n\n plainText: (message) ->\n # remove all html tags from the message returning only the text\n message.replace(/(<([^>]+)>)/ig, '');\n","// this file was auto-generated by rake i18n:generate_js.\n// you probably shouldn't edit it directly\nimport mergeI18nTranslations from '@canvas/i18n/mergeI18nTranslations.js';\n\n// we use JSON.parse here instead of just loading it as a javascript object literal\n// because according to https://v8.dev/blog/cost-of-javascript-2019#json that is faster\nmergeI18nTranslations(JSON.parse(\"{\\\"ar\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"إلغاء\\\",\\\"delete\\\":\\\"حذف\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"هل ترغب بالتأكيد في حذف هذا؟\\\"}}},\\\"ca\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancel·la\\\",\\\"delete\\\":\\\"Suprimeix\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Segur que ho voleu suprimir?\\\"}}},\\\"cy\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Canslo\\\",\\\"delete\\\":\\\"Dileu\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Ydych chi’n siŵr eich bod am ddileu hyn?\\\"}}},\\\"da\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annullér\\\",\\\"delete\\\":\\\"Slet\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Er du sikker på, at du vil slette dette?\\\"}}},\\\"da-x-k12\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annullér\\\",\\\"delete\\\":\\\"Slet\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Er du sikker på, at du vil slette dette?\\\"}}},\\\"de\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Abbrechen\\\",\\\"delete\\\":\\\"Löschen\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Möchten Sie dies wirklich löschen?\\\"}}},\\\"el\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Ακύρωση\\\",\\\"delete\\\":\\\"Διαγραφή\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Είστε σίγουρος/η ότι επιθυμείτε να το διαγράψετε;\\\"}}},\\\"en\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancel\\\",\\\"delete\\\":\\\"Delete\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Are you sure you want to delete this?\\\"}}},\\\"en-AU\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancel\\\",\\\"delete\\\":\\\"Delete\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Are you sure you want to delete this?\\\"}}},\\\"en-CA\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancel\\\",\\\"delete\\\":\\\"Delete\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Are you sure you want to delete this?\\\"}}},\\\"en-GB\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancel\\\",\\\"delete\\\":\\\"Delete\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Are you sure you want to delete this?\\\"}}},\\\"es\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancelar\\\",\\\"delete\\\":\\\"Eliminar\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"¿Seguro que desea eliminarlo?\\\"}}},\\\"fa\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"لغو\\\",\\\"delete\\\":\\\"حذف\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"مطمئنید که می خواهید این مورد حذف شود؟\\\"}}},\\\"fi\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Peruuta\\\",\\\"delete\\\":\\\"Poista\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Haluatko varmasti poistaa tämän?\\\"}}},\\\"fr\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annuler\\\",\\\"delete\\\":\\\"Supprimer\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Voulez-vous vraiment supprimer cet élément ?\\\"}}},\\\"fr-CA\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annuler\\\",\\\"delete\\\":\\\"Supprimer\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Voulez-vous vraiment supprimer cet élément?\\\"}}},\\\"he\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"ביטול\\\",\\\"delete\\\":\\\"ביטול\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"בטוח/ה שרוצה לבטל זאת?\\\"}}},\\\"ht\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Anile\\\",\\\"delete\\\":\\\"Efase\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Ou kwè vrèman ou vle efase sa a?\\\"}}},\\\"hu\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Mégse\\\",\\\"delete\\\":\\\"Törlés\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Biztos benne, hogy törli ezt?\\\"}}},\\\"hy\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Չեղյալ համարել\\\",\\\"delete\\\":\\\"Ջնջել\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Դուք իսկապե՞ս ցանկանում եք ջնջել սա:\\\"}}},\\\"is\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Hætta við\\\",\\\"delete\\\":\\\"Eyða\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Viltu örugglega eyða þessu?\\\"}}},\\\"it\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annulla\\\",\\\"delete\\\":\\\"Elimina\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Vuoi eliminare questo?\\\"}}},\\\"ja\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"キャンセル\\\",\\\"delete\\\":\\\"削除\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"これを削除してもよろしいですか?\\\"}}},\\\"ko\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"취소\\\",\\\"delete\\\":\\\"삭제\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"삭제하시겠습니까?\\\"}}},\\\"mi\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Whakakore\\\",\\\"delete\\\":\\\"Muku\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"E tino hiahia ana koe ki te muku i tēnei?\\\"}}},\\\"nb\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Avbryt\\\",\\\"delete\\\":\\\"Slett\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Er du sikker på at du ønsker å slette dette?\\\"}}},\\\"nb-x-k12\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Avbryt\\\",\\\"delete\\\":\\\"Slett\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Er du sikker på at du ønsker å slette dette?\\\"}}},\\\"nl\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Annuleren\\\",\\\"delete\\\":\\\"Verwijderen\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Weet je zeker dat je dit wilt verwijderen?\\\"}}},\\\"nn\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Avbryt\\\",\\\"delete\\\":\\\"Slett\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Er du sikker på at du vil slette dette?\\\"}}},\\\"pl\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Anuluj\\\",\\\"delete\\\":\\\"Usuń\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Czy na pewno chcesz usunąć ten element?\\\"}}},\\\"pt\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancelar\\\",\\\"delete\\\":\\\"Eliminar\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Tem certeza de que deseja excluir isto?\\\"}}},\\\"pt-BR\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Cancelar\\\",\\\"delete\\\":\\\"Excluir\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Tem certeza que deseja excluir isto?\\\"}}},\\\"ru\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Отменить\\\",\\\"delete\\\":\\\"Удалить\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Действительно хотите удалить?\\\"}}},\\\"sl\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Prekliči\\\",\\\"delete\\\":\\\"Odstrani\\\"}},\\\"sv\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Avbryt\\\",\\\"delete\\\":\\\"Ta bort\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Vill du verkligen radera det här?\\\"}}},\\\"sv-x-k12\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Avbryt\\\",\\\"delete\\\":\\\"Ta bort\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Vill du verkligen radera det här?\\\"}}},\\\"tr\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"İptal\\\",\\\"delete\\\":\\\"Sil\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"Bunu silmek istediğinize emin misiniz?\\\"}}},\\\"uk\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"Скасувати\\\",\\\"delete\\\":\\\"Видалити\\\"}},\\\"zh-Hans\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"取消\\\",\\\"delete\\\":\\\"删除\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"是否确定要删除它?\\\"}}},\\\"zh-Hant\\\":{\\\"buttons\\\":{\\\"cancel\\\":\\\"取消\\\",\\\"delete\\\":\\\"刪除\\\"},\\\"instructure_misc_plugins\\\":{\\\"confirms\\\":{\\\"default_delete_thing\\\":\\\"您是否確定要刪除?\\\"}}}}\"));\n","\n import I18n from '@canvas/i18n/i18nObj';\n \n import 'translations/instructure_misc_plugins';\n import 'translations/_core';\n \n import 'translations/_core_en';\n\n export default I18n.scoped('instructure_misc_plugins');\n ","/*\n * Copyright (C) 2011 - present Instructure, Inc.\n *\n * This file is part of Canvas.\n *\n * Canvas is free software: you can redistribute it and/or modify it under\n * the terms of the GNU Affero General Public License as published by the Free\n * Software Foundation, version 3 of the License.\n *\n * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Affero General Public License along\n * with this program. If not, see .\n */\nimport I18n from 'i18n!instructure_misc_plugins'\nimport $ from 'jquery'\nimport htmlEscape from 'html-escape'\nimport authenticity_token from '@canvas/authenticity-token'\nimport './jquery.ajaxJSON'\nimport 'jqueryui/dialog'\nimport 'jquery-scroll-to-visible'\nimport 'jquery-scroll-to-visible/jquery.scrollTo'\n\n$.fn.setOptions = function(prompt, options) {\n let result = prompt ? \"' : ''\n\n if (options == null) {\n options = []\n }\n\n options.forEach(opt => {\n const optHtml = htmlEscape(opt)\n result += ''\n })\n\n return this.html($.raw(result))\n}\n\n// this function is to prevent you from doing all kinds of expesive operations on a\n// jquery object that doesn't actually have any elements in it\n// it is similar and inspired by http://www.slideshare.net/paul.irish/perfcompression (slide #42)\n// to use it do something like:\n// $(\"a .bunch #of .nodes\").ifExists(function(orignalQuery){\n// // 'this' points to the original jquery object (in this case, $(\"a .bunch #of .nodes\") );\n// // orignalQuery is the same as 'this';\n// this.slideUp().dialog().show();\n// });\n$.fn.ifExists = function(func) {\n this.length && func.call(this, this)\n return this\n}\n\n// Returns the width of the browser's scroll bars.\n$.fn.scrollbarWidth = function() {\n const $div = $(\n '
'\n ).appendTo(this),\n $innerDiv = $div.find('div')\n // Append our div, do our calculation and then remove it\n const w1 = $innerDiv.innerWidth()\n $div.css('overflow-y', 'scroll')\n const w2 = $innerDiv.innerWidth()\n $div.remove()\n return w1 - w2\n}\n\n// Simple animation for dimming an element's opacity\n$.fn.dim = function(speed) {\n return this.animate({opacity: 0.4}, speed)\n}\n\n$.fn.undim = function(speed) {\n return this.animate({opacity: 1.0}, speed)\n}\n\n// Helper for deleting objects from the DOM and db.\n// url: URL to pass DELETE message. If none provided,\n// behaves as if the request were a success. Useful for testing.\n// message: Confirmation message\n// cancelled: Function to handle cancel.\n// confirmed: Function to handle confirm, before submit.\n// success: What to do on success. If none provided, fades\n// out the element and removes it from the DOM.\n// error: Error.\n// dialog: If present, do a jquery.ui.dialog instead of a confirm(). If an\n// object, it will be merged into the dialog options.\n$.fn.confirmDelete = function(options) {\n var options = $.extend({}, $.fn.confirmDelete.defaults, options)\n const $object = this\n let $dialog = null\n let result = true\n options.noMessage = options.noMessage || options.no_message\n const onContinue = function() {\n if (!result) {\n if (options.cancelled && $.isFunction(options.cancelled)) {\n options.cancelled.call($object)\n }\n return\n }\n if (!options.confirmed) {\n options.confirmed = function() {\n $object.dim()\n }\n }\n options.confirmed.call($object)\n if (options.url) {\n if (!options.success) {\n options.success = function(data) {\n $object.fadeOut('slow', () => {\n $object.remove()\n })\n }\n }\n const data = options.prepareData ? options.prepareData.call($object, $dialog) : {}\n data.authenticity_token = authenticity_token()\n $.ajaxJSON(\n options.url,\n 'DELETE',\n data,\n data => {\n options.success.call($object, data)\n },\n (data, request, status, error) => {\n if (options.error && $.isFunction(options.error)) {\n options.error.call($object, data, request, status, error)\n } else {\n $.ajaxJSON.unhandledXHRs.push(request)\n }\n }\n )\n } else {\n if (!options.success) {\n options.success = function() {\n $object.fadeOut('slow', () => {\n $object.remove()\n })\n }\n }\n options.success.call($object)\n }\n }\n if (options.message && !options.noMessage && !$.skipConfirmations) {\n if (options.dialog) {\n result = false\n const dialog_options = typeof options.dialog === 'object' ? options.dialog : {}\n const confirmation_class = options.url.includes('assignments') ? 'btn-danger' : 'btn-primary'\n $dialog = $(options.message).dialog(\n $.extend(\n {},\n {\n modal: true,\n close: onContinue,\n buttons: [\n {\n text: I18n.t('#buttons.cancel', 'Cancel'),\n click() {\n $(this).dialog('close')\n } // ; onContinue();\n },\n {\n text: I18n.t('#buttons.delete', 'Delete'),\n class: confirmation_class,\n click() {\n result = true\n $(this).dialog('close')\n }\n }\n ]\n },\n dialog_options\n )\n )\n return\n } else {\n result = confirm(options.message)\n }\n }\n onContinue()\n}\n$.fn.confirmDelete.defaults = {\n get message() {\n return I18n.t('confirms.default_delete_thing', 'Are you sure you want to delete this?')\n }\n}\n\n// Watches the given element's location.href for any changes\n// to the fragment (\"#...\") and calls the provided function\n// when there are any.\n// $(document).fragmentChange(function(event, hash) { alert(hash); });\n$.fn.fragmentChange = function(fn) {\n if (fn && fn !== true) {\n const query = (window.location.search || '').replace(/^\\?/, '').split('&')\n // The URL can hard-code a hash regardless of what's\n // actually shown in the hash by specifying a query\n // parameter, hash=some_hash\n let query_hash = null\n for (var i = 0; i < query.length; i++) {\n const item = query[i]\n if (item && item.indexOf('hash=') === 0) {\n query_hash = '#' + item.substring(5)\n }\n }\n this.bind('document_fragment_change', fn)\n const $doc = this\n let found = false\n // Can only be used on the root document,\n // will not work on an iframe, for example.\n for (var i = 0; i < $._checkFragments.fragmentList.length; i++) {\n const obj = $._checkFragments.fragmentList[i]\n if (obj.doc[0] == $doc[0]) {\n found = true\n }\n }\n if (!found) {\n $._checkFragments.fragmentList.push({\n doc: $doc,\n fragment: ''\n })\n }\n $(window).bind('hashchange', $._checkFragments)\n setTimeout(() => {\n if (query_hash && query_hash.length > 0) {\n $doc.triggerHandler('document_fragment_change', query_hash)\n } else if ($doc && $doc[0] && $doc[0].location && $doc[0].location.hash.length > 0) {\n $doc.triggerHandler('document_fragment_change', $doc[0].location.hash)\n }\n }, 500)\n } else {\n this.triggerHandler('document_fragment_change', this[0].location.hash)\n }\n return this\n}\n$._checkFragments = function() {\n const list = $._checkFragments.fragmentList\n for (let idx = 0; idx < list.length; idx++) {\n const obj = list[idx]\n const $doc = obj.doc\n if ($doc[0].location.hash != obj.fragment) {\n $doc.triggerHandler('document_fragment_change', $doc[0].location.hash)\n obj.fragment = $doc[0].location.hash\n $._checkFragments.fragmentList[idx] = obj\n }\n }\n}\n$._checkFragments.fragmentList = []\n// Triggers a click only if the anchor tag isn't disabled.\n$.fn.clickLink = function() {\n const $obj = this.eq(0)\n if (!$obj.hasClass('disabled_link')) {\n $obj.click()\n }\n}\n\n// jQuery supposedly has this built-in, but I haven't\n// had much success with it.\n$.fn.showIf = function(bool) {\n if ($.isFunction(bool)) {\n return this.each(function(index) {\n $(this).showIf(bool.call(this))\n })\n }\n if (bool) {\n this.show()\n } else {\n this.hide()\n }\n return this\n}\n\n$.fn.disableIf = function(bool) {\n if ($.isFunction(bool)) {\n bool = bool.call(this)\n }\n this.prop('disabled', !!bool)\n return this\n}\n\n$.fn.indicate = function(options) {\n options = options || {}\n let $indicator\n if (options == 'remove') {\n $indicator = this.data('indicator')\n if ($indicator) {\n $indicator.remove()\n }\n return\n }\n $('.indicator_box').remove()\n let offset = this.offset()\n if (options && options.offset) {\n offset = options.offset\n }\n const width = this.width()\n const height = this.height()\n const zIndex = (options.container || this).zIndex()\n $indicator = $(document.createElement('div'))\n $indicator.css({\n width: width + 6,\n height: height + 6,\n top: offset.top - 3,\n left: offset.left - 3,\n zIndex: zIndex + 1,\n position: 'absolute',\n display: 'block',\n '-moz-border-radius': 5,\n opacity: 0.8,\n border: '2px solid #870',\n backgroundColor: '#fd0'\n })\n $indicator.addClass('indicator_box')\n $indicator.mouseover(function() {\n $(this)\n .stop()\n .fadeOut('fast', function() {\n $(this).remove()\n })\n })\n if (this.data('indicator')) {\n this.indicate('remove')\n }\n this.data('indicator', $indicator)\n $('body').append($indicator)\n if (options && options.singleFlash) {\n $indicator\n .hide()\n .fadeIn()\n .animate({opacity: 0.8}, 500)\n .fadeOut('slow', function() {\n $(this).remove()\n })\n } else {\n $indicator\n .hide()\n .fadeIn()\n .animate({opacity: 0.8}, 500)\n .fadeOut('slow')\n .fadeIn('slow')\n .animate({opacity: 0.8}, 2500)\n .fadeOut('slow', function() {\n $(this).remove()\n })\n }\n if (options && options.scroll) {\n $('html,body').scrollToVisible($indicator)\n }\n}\n\n$.fn.hasScrollbar = function() {\n return this.length && this[0].clientHeight < this[0].scrollHeight\n}\n\n$.fn.log = function(msg) {\n console.log('%s: %o', msg, this)\n return this\n}\n\n// this is used if you want to fill the browser window with something inside #content but you want to also leave the footer and header on the page.\n$.fn.fillWindowWithMe = function(options) {\n const opts = $.extend({minHeight: 400}, options),\n $this = $(this),\n $wrapper = $('#wrapper'),\n $main = $('#main'),\n $not_right_side = $('#not_right_side'),\n $window = $(window),\n $toResize = $(this).add(opts.alsoResize)\n\n function fillWindowWithThisElement() {\n $toResize.height(0)\n const spaceLeftForThis =\n $window.height() -\n ($wrapper.offset().top + $wrapper.outerHeight()) +\n ($main.height() - $not_right_side.height()),\n newHeight = Math.max(400, spaceLeftForThis)\n\n $toResize.height(newHeight)\n if ($.isFunction(opts.onResize)) {\n opts.onResize.call($this, newHeight)\n }\n }\n fillWindowWithThisElement()\n $window\n .unbind('resize.fillWindowWithMe')\n .bind('resize.fillWindowWithMe', fillWindowWithThisElement)\n return this\n}\n\n$.fn.autoGrowInput = function(o) {\n o = $.extend(\n {\n maxWidth: 1000,\n minWidth: 0,\n comfortZone: 70\n },\n o\n )\n\n this.filter('input:text').each(function() {\n let minWidth = o.minWidth || $(this).width(),\n val = '',\n input = $(this),\n testSubject = $('').css({\n position: 'absolute',\n top: -9999,\n left: -9999,\n width: 'auto',\n fontSize: input.css('fontSize'),\n fontFamily: input.css('fontFamily'),\n fontWeight: input.css('fontWeight'),\n letterSpacing: input.css('letterSpacing'),\n whiteSpace: 'nowrap'\n }),\n check = function() {\n setTimeout(() => {\n if (val === (val = input.val())) {\n return\n }\n\n // Enter new content into testSubject\n testSubject.text(val)\n\n // Calculate new width + whether to change\n const testerWidth = testSubject.width(),\n newWidth =\n testerWidth + o.comfortZone >= minWidth ? testerWidth + o.comfortZone : minWidth,\n currentWidth = input.width(),\n isValidWidthChange =\n (newWidth < currentWidth && newWidth >= minWidth) ||\n (newWidth > minWidth && newWidth < o.maxWidth)\n\n // Animate width\n if (isValidWidthChange) {\n input.width(newWidth)\n }\n })\n }\n\n testSubject.insertAfter(input)\n\n $(this).bind('keyup keydown blur update change', check)\n })\n\n return this\n}\n\nexport default $\n"],"sourceRoot":""}