{"version":3,"sources":["globals.tsx","components/article-card.tsx","components/article-add.tsx","components/article-grid.tsx","components/page_data.tsx","components/feature-image.tsx","components/article-view.tsx","components/article-list.tsx","components/Filters.tsx","App.tsx","index.tsx"],"names":["PAGE_NAME","ArticleCard","id","href","imageSrc","title","editMode","btnClickHandler","deleteBtnHandler","className","Card","as","onClick","Img","src","alt","ImgOverlay","Title","Footer","e","stopPropagation","window","confirm","icon","faTrashAlt","AddArticleCard","Text","faPlus","ArticleGridView","articles","addBtnClickHandler","Col","CardDeck","length","map","i","key","Articles","_selectedArticleId","updateArticle","generateId","createNewArticle","deleteArticle","this","fullWidthImage","displayImage","videoUrl","content","featured","newId","newArticle","selected","unshift","article","getArticleById","articleIndex","indexOf","splice","uuid","value","artcileIndex","Object","assign","existingArticle","undefined","articleId","articleList","selectArticleFromList","currentlySelected","selectedArticle","FeatureImage","props","refDisplayImage","refFullWidthImage","React","createRef","fullWidth","onToggleUploader","onFeatureImageChange","onToggleFullWidth","onToggleImageDisplay","Image","thumbnail","Button","variant","type","onChange","newContent","target","Form","Check","label","checked","ref","current","Component","ArticleView","html","onVideoUrlChange","onBodyContentChange","onTitleChange","toggleFullWidth","toggleImageDisplay","useState","showModal","setShowModal","onHideModal","xs","span","Row","display","data","onBeforeLoad","CKEDITOR","disableAutoInline","onBlur","editor","getData","dangerouslySetInnerHTML","__html","style","width","height","ResponsiveEmbed","aspectRatio","newVideoUrl","Modal","show","onShow","$","load","onHide","size","centered","Header","closeButton","Body","ArticleList","listItems","test","articleListItem","listItemClassName","data-article-id","Filters","isGridOnlyView","selectedLetter","clickViewAllHandler","updateSelectedLetter","md","offset","InputGroup","FormControl","placeholder","Append","faSearch","split","letter","toUpperCase","DATA_STORE_ELEMENT_SELECTOR","DATA_STORE_SNIPPET_SELECTOR","App","handleArticleSelect","handleSidePanelToggle","addNewArticle","updateStore","updateVideoUrl","updateContent","updateImage","updateTitle","genericArticleUpdate","transform","state","newString","removeHtmlTags","url","replace","trim","filteredArticles","sidePanelToggled","setState","result","currentArticle","toLowerCase","push","filterByTitleLetter","deselectArticle","dataStoreSelector","selector","storeElement","document","querySelector","textContent","JSON","stringify","stageArticleList","imageContent","urlHash","parse","loadArticleList","search","match","exec","groups","letterFilter","getFilterLetter","location","selectedArticleId","idMatch","getSelectedArticleId","Container","fluid","faAngleLeft","faAngleRight","ReactDOM","render","getElementById"],"mappings":"qTAGaA,EAAY,qBCsEVC,EArDgD,SAAC,GAAD,IAC7DC,EAD6D,EAC7DA,GACAC,EAF6D,EAE7DA,KACAC,EAH6D,EAG7DA,SACAC,EAJ6D,EAI7DA,MACAC,EAL6D,EAK7DA,SACAC,EAN6D,EAM7DA,gBACAC,EAP6D,EAO7DA,iBACAC,EAR6D,EAQ7DA,UAR6D,OAU7D,kBAACC,EAAA,EAAD,CACEC,GAAG,IACHR,KAAMA,EACNM,UAAS,0CAC6BH,EAAW,WAAa,GADrD,YAC4DG,GAAa,IAElFG,QAASL,GAET,kBAACG,EAAA,EAAKG,IAAN,CAAUC,IAAKV,EACbW,IAAI,aACJN,UAAU,yCAEZ,kBAACC,EAAA,EAAKM,WAAN,CACEP,UAAU,yBAEV,kBAACC,EAAA,EAAKO,MAAN,CACER,UAAU,uBAETJ,GAGDC,EACI,kBAACI,EAAA,EAAKQ,OAAN,CAAaT,UAAU,wBACrB,4BACEA,UAAU,iBACVJ,MAAM,sBACNO,QAAS,SAACO,IACRA,EAAEC,kBACElB,KACgBmB,OAAOC,QDzDE,kDC0DXd,EAAiBN,MAIrC,kBAAC,IAAD,CAAiBqB,KAAMC,QAG3B,MCxCGC,EAjBkD,SAAC,GAAD,IAC/DlB,EAD+D,EAC/DA,gBAD+D,OAG/D,kBAACG,EAAA,EAAD,CACEC,GAAG,SACHF,UAAU,oDACVG,QAASL,GAET,kBAACG,EAAA,EAAKgB,KAAN,CACEf,GAAG,MACHF,UAAU,8CAEV,kBAAC,IAAD,CAAiBA,UAAU,iBAAiBc,KAAMI,SC6CzCC,EAjDqD,SAAC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tB,kBAAC,EAAD,CACEhG,SAAUA,EACVuB,SAAUoJ,EACV1K,gBAAiB0J,EACjBzJ,iBAAkBkC,EAClBZ,mBAAoBqI,Y,GAlQtBzF,IAAMqB,WC1CxBsH,IAASC,OAAO,kBAAC,EAAD,MAASzB,SAAS0B,eAAe,W","file":"static/js/main.fad16a12.chunk.js","sourcesContent":["\r\nexport const INPUT_DEBOUNCE_DELAY = 3000;\r\nexport const DELETE_ARTICLE_CONFIRMATION_MSG = 'Are you sure you wish to delete this article?';\r\nexport const PAGE_NAME = 'a-z-of-motorcycles';\r\nexport const UPLOADER_ADDRESS = '/ckfinder.html?type=Images&CKEditor=editor4&CKEditorFuncNum=115&langCode=en';\r\nexport const MODAL_BODY_ID = 'image-upload-modal__body';\r\nexport const MODAL_ID = 'image-upload-modal';\r\nexport const JQUERY_IDENTIFIER = '$';\r\n\r\nexport interface PageSettings {\r\n pageName: string,\r\n}\r\n\r\nexport interface CKEditorEditor {\r\n getData: (arg?: any)=>string\r\n}\r\n\r\nexport interface updateArticleHandler {\r\n (arg0: T, arg1?: string): void,\r\n}\r\n\r\nexport interface CKEditorEvent {\r\n editor: CKEditorEditor\r\n}\r\n","\r\nimport React, { SyntheticEvent } from 'react';\r\nimport Card from 'react-bootstrap/Card';\r\n\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { faTrashAlt } from '@fortawesome/free-solid-svg-icons';\r\n\r\nimport { DELETE_ARTICLE_CONFIRMATION_MSG } from '../globals';\r\n\r\ntype ArticleCardProps = {\r\n id?: string\r\n href?: string,\r\n imageSrc?: string,\r\n title?: string,\r\n editMode: boolean,\r\n className?: string,\r\n btnClickHandler: (e: any) => void,\r\n deleteBtnHandler: (id: string) => void,\r\n}\r\n\r\nconst ArticleCard: React.FunctionComponent = ({\r\n id,\r\n href,\r\n imageSrc,\r\n title,\r\n editMode,\r\n btnClickHandler,\r\n deleteBtnHandler,\r\n className,\r\n}) => (\r\n \r\n \r\n \r\n \r\n {title}\r\n \r\n {\r\n editMode\r\n ? \r\n {\r\n e.stopPropagation();\r\n if (id) {\r\n const confirmed = window.confirm(DELETE_ARTICLE_CONFIRMATION_MSG);\r\n if (confirmed){ deleteBtnHandler(id) }\r\n }\r\n }}\r\n >\r\n \r\n \r\n \r\n : ''\r\n }\r\n \r\n \r\n)\r\n\r\nexport default ArticleCard;","\r\nimport React from 'react';\r\nimport Card from 'react-bootstrap/Card';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { faPlus } from '@fortawesome/free-solid-svg-icons';\r\n\r\ntype AddArticleProps = {\r\n btnClickHandler: (e: any) => void,\r\n}\r\n\r\nconst AddArticleCard: React.FunctionComponent = ({\r\n btnClickHandler,\r\n}) => (\r\n \r\n \r\n \r\n \r\n \r\n)\r\n\r\nexport default AddArticleCard;","\r\nimport React from 'react';\r\nimport CardDeck from 'react-bootstrap/CardDeck';\r\nimport Col from 'react-bootstrap/Col';\r\nimport ArticleCard from './article-card'; \r\nimport AddArticleCard from './article-add'; \r\nimport { MetaArticle } from './page_data';\r\n\r\nimport { updateArticleHandler } from '../globals';\r\n\r\ntype ArticlesGridProps = {\r\n editMode: boolean,\r\n articles: Array,\r\n btnClickHandler: (articleId: string) => void,\r\n addBtnClickHandler: () => void,\r\n deleteBtnHandler: (id: string) => void,\r\n};\r\n\r\nconst ArticleGridView: React.FunctionComponent = ({\r\n editMode,\r\n articles,\r\n btnClickHandler,\r\n addBtnClickHandler,\r\n deleteBtnHandler,\r\n}) => (\r\n \r\n
\r\n

\r\n Featured \r\n Topics\r\n

\r\n
\r\n
\r\n \r\n {editMode\r\n ? \r\n : ''\r\n }\r\n {articles.length > 0\r\n ? articles.map(({\r\n id,\r\n href,\r\n title,\r\n imageSrc\r\n }: MetaArticle, i): React.ReactNode => (\r\n btnClickHandler(id)}\r\n deleteBtnHandler={deleteBtnHandler}\r\n editMode={editMode}\r\n />\r\n ))\r\n :
\r\n No Topics Match Your Search Conditions'\r\n
\r\n }\r\n
\r\n
\r\n \r\n);\r\n\r\nexport default ArticleGridView;\r\n","import React from 'react';\r\nimport uuid from 'uuid/v1';\r\nimport ArticleList from './article-list';\r\nimport { number } from 'prop-types';\r\nimport { booleanLiteral } from '@babel/types';\r\n\r\nimport { PAGE_NAME } from '../globals';\r\n\r\n /**\r\n * Collection of all available Articles\r\n * \r\n * @interface\r\n * @property {Array} articles - all available articles\r\n * @property {ArticleInterface|null} selected - the article that has been selected or null if none\r\n * @example\r\n *\r\n * const MAL1 = {\r\n * articles: [\r\n * {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '5',\r\n * href: '#',\r\n * imageSrc: '/place_holder/2.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * }\r\n * ]\r\n * }\r\n * \r\n * MAL1.selected = MAL1.articles[0];\r\n *\r\n */\r\n\r\nexport interface ArticlesInterface {\r\n articles: Array,\r\n selected: ArticleInterface | null,\r\n [t:string]: any,\r\n}\r\n\r\n /**\r\n * Contains the basic information needed to render an article on the featured article page\r\n * \r\n * @interface\r\n * @property {string} id - article id\r\n * @property {string} href - points to the article page\r\n * @property {string} imageSrc - the url of the article image\r\n * @property {string} title - the article title\r\n * @property {boolean} selected - true if the article is the article bein displayed\r\n * @property {boolean} featured - determines if the article is featured on the featured page\r\n * @example\r\n * \r\n * const MA = {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * };\r\n * \r\n */\r\n \r\nexport interface MetaArticle {\r\n id: string,\r\n href: string,\r\n imageSrc: string,\r\n title: string,\r\n selected: boolean,\r\n featured: boolean,\r\n //[i:string]: any,\r\n}\r\n\r\n/**\r\n * Contains all information needed to render an article on the article page\r\n * \r\n * @interface\r\n * @augments MetaArcticle\r\n * @property {string} videoUrl - URL of a video to embed on the article page\r\n * @property {string} content - the body of the article\r\n * @property {boolean} fullWidthImage - true of feature image should display full width\r\n * @property {boolean} displayImage - true if image should be displayed in article view\r\n * \r\n * @example\r\n * \r\n * const MA = {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world this is the a test article',\r\n * };\r\n * \r\n */\r\nexport interface ArticleInterface extends MetaArticle {\r\n videoUrl: string,\r\n fullWidthImage: boolean,\r\n displayImage: boolean,\r\n content: string,\r\n}\r\n\r\n/**\r\n * \r\n * @class\r\n * @implements {ArticleInterface}\r\n * \r\n\r\nexport class Article implements ArticleInterface {\r\n constructor(\r\n public id: string,\r\n public href: string,\r\n public imageSrc: string, \r\n public title: string,\r\n public selected: boolean,\r\n public featured: boolean,\r\n public videoUrl: string,\r\n public content: string,\r\n ){ }\r\n}\r\n */\r\n\r\n/**\r\n * \r\n * @class \r\n * \r\n */\r\n\r\nexport class Articles {\r\n private _selectedArticleId: string | undefined\r\n public updateArticle: (\r\n id: string, \r\n key: K,\r\n value: ArticleInterface[K],\r\n ) => ArticleInterface | null\r\n public generateId: () => string\r\n public createNewArticle: (\r\n title?: string,\r\n imageSrc?: string,\r\n fullWidthImage?: boolean,\r\n displayImage?: boolean,\r\n videoUrl?: string,\r\n content?: string,\r\n href?: string,\r\n id?: string,\r\n featured?: boolean,\r\n ) => ArticleInterface\r\n public deleteArticle: ( id: string) => void\r\n\r\n constructor(\r\n public articles: Array,\r\n ){\r\n /**\r\n * produce a new Artile and prepends it to this.articles\r\n * @param {string} title - articles title\r\n * @param {string} imgSrc - image source\r\n * @param {string} videoUrl - video url\r\n * @param {content} content - articles content can contain html\r\n * @returns {ArticleInterface}\r\n */\r\n this.createNewArticle = (\r\n title?: string,\r\n imageSrc?: string,\r\n fullWidthImage?: boolean,\r\n displayImage?: boolean,\r\n videoUrl?: string,\r\n content?: string,\r\n href?: string,\r\n id?: string,\r\n featured?: boolean,\r\n ): ArticleInterface => {\r\n const newId = id || this.generateId();\r\n const newArticle = {\r\n id: newId,\r\n href: href || `/--${PAGE_NAME}#id=${newId}`,\r\n imageSrc: imageSrc || '',\r\n fullWidthImage: fullWidthImage || false,\r\n displayImage: displayImage || true,\r\n title: title || '',\r\n selected: false,\r\n featured: featured || true,\r\n videoUrl: videoUrl || '',\r\n content: content || '',\r\n };\r\n\r\n this.articles.unshift(newArticle);\r\n return newArticle;\r\n }\r\n\r\n /**\r\n * removes the article with the given id from the articleList\r\n * @param {string} id - id of the article we want to delete\r\n * \r\n */\r\n this.deleteArticle = ( id: string): void => {\r\n const { articles } = this;\r\n const article = getArticleById(id, articles);\r\n if (article) {\r\n const articleIndex = articles.indexOf(article);\r\n articles.splice(articleIndex, 1);\r\n }\r\n }\r\n\r\n /**\r\n * produces a new unique id \r\n * @returns {number}\r\n * TODO\r\n */\r\n this.generateId = (): string => {\r\n return uuid();\r\n }\r\n /**\r\n * produce a new Article where the value of the attribute specified by\r\n * the given key is set to value. Also replaces the instance of the article\r\n * in this.articles with the new article.\r\n * \r\n * @param {string} id - id of the article we are modifying\r\n * @param {string} key - the attribute on the article we would like to modify\r\n * @param {value} value - the value with would like to set it to\r\n * @returns {ArticleInterface | null} - the new article\r\n */\r\n this.updateArticle = (\r\n id: string, \r\n key: K,\r\n value: ArticleInterface[K],\r\n ): ArticleInterface | null => {\r\n const article = getArticleById(id, this.articles);\r\n if (article){\r\n const artcileIndex = this.articles.indexOf(article);\r\n const newArticle = Object.assign({}, article, {[key]: value});\r\n this.articles[artcileIndex] = newArticle;\r\n return newArticle;\r\n }\r\n\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * returns the article associated with this.selectedArticleId\r\n */\r\n public get selectedArticle(): ArticleInterface | null {\r\n const { _selectedArticleId, articles } = this;\r\n if (_selectedArticleId) {\r\n return getArticleById(_selectedArticleId, articles);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * sets this.selectedArticleId to the given id if the article with that id\r\n * exists in this.articles. If it does not exist, leave this.selectedArticleId\r\n * unaltered.\r\n */\r\n\r\n public set selectedArticle(article: ArticleInterface | null) {\r\n if (article){\r\n const existingArticle = getArticleById(article.id, this.articles);\r\n if (existingArticle) {\r\n this._selectedArticleId = existingArticle.id;\r\n }\r\n } else {\r\n this._selectedArticleId = undefined;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * produce an Article from the fiven array of Articles that matches the given id or null if none\r\n * found.\r\n * \r\n * @param {string} articleId - id of the article we are looking for\r\n * @param {Article[]} articleList - an array of articles to search\r\n * @returns {Article} - an Article with an \"id\" that matches the value of \"articleId\"\r\n * \r\n * @example\r\n * \r\n * const articleList: Array = [\r\n * {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * },\r\n * {\r\n * id: '5',\r\n * href: '#',\r\n * imageSrc: '/place_holder/2.jpg',\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * },\r\n * {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * title: 'Card Title',\r\n * selected: true,\r\n * featured: true,\r\n * }\r\n * ];\r\n * \r\n * const article1 = getArticleById('6', articleList);\r\n * // should return:\r\n * // {\r\n * // id: '6',\r\n * // href: '#',\r\n * // imageSrc: '/place_holder/3.jpg',\r\n * // title: 'Card Title',\r\n * // selected: true,\r\n * // featured: true,\r\n * // }\r\n * \r\n * const article2 = getArticleById('8', articleList);\r\n * // should return null;\r\n * \r\n */\r\n\r\nexport function getArticleById(\r\n articleId: string, articleList: Array\r\n): ArticleInterface | null {\r\n for (let i = 0; i < articleList.length; i+=1) {\r\n let article = articleList[i];\r\n if (article.id === articleId) { return article}\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Selects the Article|MetaArticle with the given articleId and produces the article of the it\r\n * exists or null if it does not exist. To select an article we do the following:\r\n * - If an article is currently selected, we unset the selected flag on that article\r\n * - then we clear the selected field on the article list\r\n * - and add the new article to the list\r\n * @param {string} articleId - the id of the article we would like to select\r\n * @param {MetaArticleList} articles - represents all the available articles.\r\n * @return {MetaArticle | null} the selected Article or null if it does not exist\r\n * @example\r\n * \r\n * const MAL1 = {\r\n * articles: [\r\n * {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * title: 'Card Title',\r\n * selected: true,\r\n * featured: true,\r\n * },\r\n * {\r\n * id: '5',\r\n * href: '#',\r\n * imageSrc: '/place_holder/2.jpg',\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * },\r\n * {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * }\r\n * ]\r\n * }\r\n * \r\n * MAL1.selected = MAL1.articles[0];\r\n * \r\n * selectArticleFromList('5', MAL1);\r\n * // should return:\r\n * // {\r\n * // id: '5',\r\n * // href: '#',\r\n * // imageSrc: '/place_holder/2.jpg',\r\n * // title: 'Card Title',\r\n * // selected: true,\r\n * // featured: true,\r\n * // }\r\n * //\r\n * // expect MAL1.articles[0].selected to be false\r\n * // expect MAL1.articles[1].selected to be true\r\n * //\r\n * \r\n * selectArticleFromList('20', MAL1);\r\n * // should return null\r\n * // expect MAL1.articles[1].selected to be true\r\n * \r\n * - If an article is currently selected, we unset the selected flag on that article\r\n * - then we clear the selected field on the article list\r\n * - and add the new article to the list\r\n */\r\n\r\nexport function selectArticleFromList(\r\n articleId: string, articles: Articles\r\n): ArticleInterface | null {\r\n const article = getArticleById(articleId, articles.articles);\r\n if (!article) { return null };\r\n\r\n const currentlySelected = articles.selectedArticle;\r\n if (currentlySelected) {currentlySelected.selected = false};\r\n article.selected = true;\r\n articles.selectedArticle = article;\r\n\r\n return articles.selectedArticle;\r\n}\r\n\r\n/**\r\n * Deselect the currently selected article. To deselect an article we do the following:\r\n * - If an article is currently selected, we set the selected flag on that article to false\r\n * - then we clear the selected field on the article list\r\n * \r\n * @param {Articles} articles - represents all the available articles.\r\n * @return {ArticleInterface | null} the selected Article or null if it does not exist\r\n * @example\r\n * \r\n * const MAL1 = {\r\n * articles: [\r\n * {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: true,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '5',\r\n * href: '#',\r\n * imageSrc: '/place_holder/2.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * }\r\n * ]\r\n * }\r\n * \r\n * MAL1.selected = MAL1.articles[1];\r\n * \r\n * deselectArticle(MAL1);\r\n * // should return:\r\n * // {\r\n * // id: '5',\r\n * // href: '#',\r\n * // imageSrc: '/place_holder/2.jpg',\r\n * // fullWidthImage: false,\r\n * // displayImage: true,\r\n * // title: 'Card Title',\r\n * // selected: true,\r\n * // featured: true,\r\n * // videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * // content: 'hello world',\r\n * // }\r\n * //\r\n * // expect MAL1.articles[1].selected to be false\r\n * //\r\n * \r\n * selectArticleFromList(20, MAL1);\r\n * // should return null\r\n * // expect MAL1.articles[1].selected to be true\r\n */\r\nexport function deselectArticle(articles: Articles): ArticleInterface | null {\r\n const { selectedArticle } = articles;\r\n if (!selectedArticle){ return null }\r\n (selectedArticle as ArticleInterface).selected = false;\r\n articles.selectedArticle = null;\r\n\r\n return selectedArticle;\r\n}\r\n\r\n/**\r\n * Produce an array of Articles containing all Articles from a given array who's title start with\r\n * the given letter.\r\n * \r\n * @author Adrian\r\n * @param {string} letter - the letter to filter by\r\n * @param {Array} articles - represents all the available articles.\r\n * @return {Array} the selected Article or null if it does not exist\r\n * @example\r\n * \r\n * const articles = [\r\n * {\r\n * id: '4',\r\n * href: '#',\r\n * imageSrc: '/place_holder/1.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'A Card Title',\r\n * selected: true,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '5',\r\n * href: '#',\r\n * imageSrc: '/place_holder/2.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'B Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '8',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * },\r\n * {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'a Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * }\r\n * ]\r\n * \r\n * filterByTitleLetter('A', articles);\r\n * // should return:\r\n * // [\r\n * // {\r\n * // id: '4',\r\n * // href: '#',\r\n * // imageSrc: '/place_holder/1.jpg',\r\n * // fullWidthImage: false,\r\n * // displayImage: true,\r\n * // title: 'A Card Title',\r\n * // selected: true,\r\n * // featured: true,\r\n * // videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * // content: 'hello world',\r\n * // },\r\n * // {\r\n * // id: '6',\r\n * // href: '#',\r\n * // imageSrc: '/place_holder/3.jpg',\r\n * // fullWidthImage: false,\r\n * // displayImage: true,\r\n * // title: 'a Card Title',\r\n * // selected: false,\r\n * // featured: true,\r\n * // videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * // content: 'hello world',\r\n * // }\r\n * // ]\r\n * \r\n */\r\nexport function filterByTitleLetter(\r\n letter: string,\r\n articles: Array\r\n): Array {\r\n const result = [];\r\n for (var i in articles) {\r\n let currentArticle = articles[i];\r\n let title = currentArticle.title.toLowerCase();\r\n\r\n if (title[0] == letter.toLowerCase()) {\r\n result.push(currentArticle);\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Produce the given article with the given attribute set to the given value\r\n * \r\n * @param {ArticleInterface} article - article to modify\r\n * @param {string} key - the Attribute to modify\r\n * @param {string} value - the new value to assign to the attribute\r\n * @param {function} transform - takes a string as argument, does some arbitrary transformation\r\n * on it and returns the transformed string\r\n * @return {ArticleInterface} the article with the modified videoUrl\r\n * @example\r\n * const myArticle = {\r\n * id: '6',\r\n * href: '#',\r\n * imageSrc: '/place_holder/3.jpg',\r\n * fullWidthImage: false,\r\n * displayImage: true,\r\n * title: 'a Card Title',\r\n * selected: false,\r\n * featured: true,\r\n * videoUrl: 'https://www.youtube.com/embed/0-nufsLsoZo',\r\n * content: 'hello world',\r\n * }\r\n * \r\n * const result = updateArticleVideo(myArticle, 'videoUrl', 'https://www.youtube.com/embed/0-FAKE-VIDEO')\r\n * // expect result.videoUrl to be 'https://www.youtube.com/embed/0-FAKE-VIDEO'\r\n * \r\n */\r\nexport function updateArticle(\r\n article: ArticleInterface,\r\n key: K,\r\n value: ArticleInterface[K],\r\n transform?: (arg0: ArticleInterface[K]) => ArticleInterface[K],\r\n): ArticleInterface {\r\n let newString = value;\r\n if (transform) { newString = transform(value) }\r\n article[key] = newString;\r\n return article;\r\n}\r\n\r\n/**\r\n * Produce JSX from a given string containing html\r\n * \r\n * @property {string} html - html string to convert\r\n * @returns {React.ReactDOM} JSX form of given string\r\n */\r\n\r\nexport function renderContent(html: string): React.ReactElement {\r\n return
;\r\n}\r\n\r\n/**\r\n * Stores the JSON representation of the articles in the element corresponding\r\n * to the given selector\r\n * \r\n * @param {Articles} articleList - the articleList it stage\r\n * @param {string} selector - points to a DOM element that holds the store\r\n * snippet\r\n * \r\n */\r\nexport function stageArticleList(\r\n articleList: Array, \r\n selector: string\r\n): void {\r\n const storeElement = document.querySelector(selector);\r\n if (storeElement) {\r\n storeElement.textContent = JSON.stringify(articleList);\r\n }\r\n}\r\n\r\n/**\r\n * Loads the JSON representation of the articles from the element referenced\r\n * by the given selector\r\n * \r\n * @param {string} selector - references the DOM element that holds the data\r\n * @returns {Array | null}\r\n */\r\n\r\nexport function loadArticleList(\r\n selector: string\r\n): Array | null {\r\n const storeElement: Element | null = document.querySelector(selector);\r\n if (storeElement) {\r\n const content = storeElement.textContent || '';\r\n const articleList = JSON.parse(content);\r\n return articleList;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Produce True if The site CKEditor is anabled\r\n * \r\n */\r\n\r\nexport function isEditingEnabled(): boolean {\r\n return (typeof CKEDITOR !== 'undefined');\r\n}\r\n\r\n/**\r\n * Produce an object containing:\r\n * selectedLetter - selected letter or empty string\r\n * selectedArticleId\r\n */\r\n\r\nexport function simpleRouter(urlHash: string): {selectedLetter: string | null, selectedArticleId: string | null} {\r\n function getSelectedArticleId(urlHash: string) {\r\n const reIdFilter = /(?=(id=(?[0-9a-zA-Z-_]+)($|&)))/gi;\r\n const idMatch = reIdFilter.exec(urlHash);\r\n if (idMatch) {\r\n let result = (idMatch.groups as {id:string}).id;\r\n if (result) { return result }\r\n }\r\n return null;\r\n }\r\n\r\n function getFilterLetter(urlHash: string): string | null {\r\n const reFilterLetter = /(?=(letterfilter=(?[a-z])($|&)))/gi;\r\n const match = reFilterLetter.exec(urlHash);\r\n if (match) { return (match.groups as {letterFilter:string}).letterFilter }\r\n return null;\r\n }\r\n const selectedLetter = getFilterLetter(urlHash);\r\n const selectedArticleId = getSelectedArticleId(urlHash);\r\n\r\n return {selectedLetter, selectedArticleId}\r\n}\r\n","\r\nimport React, { ChangeEvent } from 'react';\r\nimport Image from 'react-bootstrap/Image';\r\nimport Form from 'react-bootstrap/Form';\r\nimport Button from 'react-bootstrap/Button';\r\n\r\nimport {\r\n updateArticleHandler,\r\n} from '../globals';\r\n\r\nconst FEATURE_PHOTO_INPUT_ID = \"feature-photo__ctrl-src\";\r\n\r\ninterface FeatureImageProps {\r\n imageSrc: string,\r\n editMode: boolean,\r\n fullWidth: boolean,\r\n displayImage: boolean,\r\n onFeatureImageChange: updateArticleHandler,\r\n onToggleUploader: () => void,\r\n onToggleFullWidth: (arg0: boolean) => void,\r\n onToggleImageDisplay: (arg0: boolean) => void,\r\n}\r\n\r\nclass FeatureImage extends React.Component {\r\n public refDisplayImage: React.RefObject\r\n public refFullWidthImage: React.RefObject\r\n\r\n constructor(props: FeatureImageProps) {\r\n super(props);\r\n this.refDisplayImage = React.createRef();\r\n this.refFullWidthImage = React.createRef();\r\n }\r\n\r\n render() {\r\n const { \r\n props,\r\n refDisplayImage,\r\n refFullWidthImage,\r\n } = this;\r\n\r\n const {\r\n imageSrc,\r\n editMode,\r\n fullWidth,\r\n displayImage,\r\n onToggleUploader,\r\n onFeatureImageChange,\r\n onToggleFullWidth,\r\n onToggleImageDisplay,\r\n } = props;\r\n\r\n return (\r\n
\r\n {imageSrc && (\r\n \r\n )}\r\n {editMode && ( \r\n <>\r\n
\r\n \r\n ) => {\r\n const newContent: string = e.target.value;\r\n onFeatureImageChange(newContent);\r\n }}\r\n />\r\n
\r\n )}\r\n title=\"Select To display feature image on article page\"\r\n className=\"feature-photo__switch\"\r\n onChange={()=>{\r\n onToggleImageDisplay(\r\n (refDisplayImage.current as HTMLInputElement).checked\r\n )\r\n }}\r\n />\r\n )}\r\n title=\"Select to enable full with image\"\r\n className=\"feature-photo__switch\"\r\n onChange={()=>{\r\n onToggleFullWidth(\r\n (refFullWidthImage.current as HTMLInputElement).checked\r\n )\r\n }}\r\n />\r\n
\r\n
\r\n
\r\n

Follow these instruction to set this articles feature image:

\r\n
    \r\n
  1. \r\n Click the \"Upload Image\" Button to upload an image to the server.\r\n
      \r\n
    • \r\n On the popup that appears, select the \"articles\" folder\r\n from the left panel labeled \"Folders\".\r\n
    • \r\n
    • \r\n Click the \"Upload\" button (first button on the control bar at the top of the popup),\r\n and select the image you would like to upload from the window that opens.\r\n
    • \r\n
    • \r\n Once the image has been uploaded, close the popup.\r\n
    • \r\n
    \r\n
  2. \r\n
  3. \r\n Once your image is on the server, select the input box next\r\n to the \"Upload Image\" button.\r\n
  4. \r\n
  5. \r\n Enter the URL to the Image you would like to select. The URL takes\r\n the format \"/fckimages/articles/[[ImageName]]\". [[ImageName]]\r\n should be replaced with the name of the image you uploaded \r\n (e.g. /fckimages/articles/aftermarket_parts_main.jpg).\r\n
  6. \r\n
  7. \r\n Use the \"Display\" switch to hide or display the feature image on the\r\n article view and the \"Full Width\" switch to toggle b/w thumbnail and\r\n full width feature image.\r\n
  8. \r\n
  9. \r\n When you are satisfied with the changes, click the save button (floppy disk)\r\n on the \"Content Editor\" bar at the top of the screen and exit the editting\r\n session.\r\n
  10. \r\n
\r\n
\r\n \r\n )}\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default FeatureImage;","\r\nimport React, { useState, ChangeEvent } from 'react';\r\nimport Col from 'react-bootstrap/Col';\r\nimport Row from 'react-bootstrap/Row';\r\nimport Modal from 'react-bootstrap/Modal';\r\nimport Button from 'react-bootstrap/Button';\r\nimport ResponsiveEmbed from 'react-bootstrap/ResponsiveEmbed';\r\nimport $ from 'jquery';\r\n\r\nimport { renderContent, ArticleInterface } from './page_data'; \r\nimport FeatureImage from './feature-image';\r\n\r\nimport CKEditor from 'ckeditor4-react';\r\n\r\nimport { \r\n CKEditorEvent,\r\n updateArticleHandler,\r\n MODAL_BODY_ID,\r\n MODAL_ID,\r\n UPLOADER_ADDRESS,\r\n} from '../globals';\r\n\r\nconst EMBED_URL_EXAMPLE = 'https://wpexplorer-themes.com/total/docs/get-embed-urllink-youtube-video/';\r\nconst ARTICLE_TITLE_INPUT_ID = 'article__heading-ctrl';\r\nconst VIDEO_URL_INPUT_ID = 'article__video-ctrl--url'\r\n\r\ntype ArticleProps = {\r\n article: ArticleInterface,\r\n editMode: boolean,\r\n onVideoUrlChange: updateArticleHandler,\r\n onBodyContentChange: updateArticleHandler,\r\n onFeatureImageChange: updateArticleHandler,\r\n onTitleChange: updateArticleHandler,\r\n toggleFullWidth: updateArticleHandler,\r\n toggleImageDisplay: updateArticleHandler,\r\n}\r\n\r\nconst ArticleView: React.FunctionComponent = ({\r\n article,\r\n editMode,\r\n onVideoUrlChange,\r\n onBodyContentChange,\r\n onFeatureImageChange,\r\n onTitleChange,\r\n toggleFullWidth,\r\n toggleImageDisplay,\r\n}) => {\r\n const [showModal, setShowModal] = useState(false);\r\n\r\n const onShowModal = () => {\r\n setShowModal(true);\r\n }\r\n\r\n const onHideModal = () => {\r\n setShowModal(false);\r\n }\r\n\r\n const { \r\n id, \r\n title, \r\n content, \r\n videoUrl, \r\n imageSrc, \r\n fullWidthImage,\r\n displayImage,\r\n \r\n } = article;\r\n return (\r\n <>\r\n \r\n \r\n \r\n

\r\n {editMode\r\n ? ) => {\r\n const newContent: string = e.target.value;\r\n onTitleChange(newContent);\r\n }}\r\n />\r\n : title\r\n }\r\n

\r\n toggleFullWidth(fullWidth, id)}\r\n onToggleImageDisplay={(display: boolean)=>toggleImageDisplay(display, id)}\r\n />\r\n
\r\n {editMode\r\n ? ( CKEDITOR.disableAutoInline = true ) }\r\n onBlur={(e: CKEditorEvent )=>{\r\n const newContent: string = e.editor.getData();\r\n onBodyContentChange(newContent);\r\n }}\r\n type=\"classic\"\r\n />\r\n : renderContent(content)\r\n }\r\n
\r\n \r\n \r\n
\r\n \r\n