UNPKG

corporate-frontend-mithril

Version:

Corporate frontend MithrilJS modules

1 lines 11.9 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,,function(t,e){var n=[{value:31,label:"Anthropology"},{value:294,label:"Arabic Languages and Cultures"},{value:78,label:"Archaeology"},{value:40,label:"Art History"},{value:71,label:"Asian Studies"},{value:69,label:"Celtic Studies"},{value:72,label:"Chinese Studies"},{value:450,label:"Classics and Ancient History"},{value:465,label:"Economics"},{value:39,label:"English"},{value:85,label:"European Studies"},{value:23,label:"Faculty of Arts and Social Sci..."},{value:41,label:"French and Francophone Studies"},{value:70,label:"Gender and Cultural Studies"},{value:42,label:"Germanic Studies"},{value:439,label:"Government and International R..."},{value:466,label:"Graduate School of Government"},{value:293,label:"Hebrew, Biblical and Jewish St..."},{value:45,label:"History"},{value:75,label:"Indian Sub-continental Studies"},{value:483,label:"Indigenous Academic Units"},{value:74,label:"Indonesian Studies"},{value:415,label:"International Comparative Li..."},{value:48,label:"Italian Studies"},{value:416,label:"Japanese Studies"},{value:417,label:"Korean Studies"},{value:51,label:"Linguistics"},{value:263,label:"Media and Communications"},{value:44,label:"Modern Greek Studies"},{value:480,label:"Peace and Conflict Studies"},{value:57,label:"Philosophy"},{value:440,label:"Political Economy"},{value:279,label:"SLAM"},{value:277,label:"SLC"},{value:484,label:"Social Work"},{value:291,label:"Sociology and Social Policy"},{value:414,label:"Spanish and Latin American Studies"},{value:481,label:"SSESW"},{value:76,label:"Studies in Religion"},{value:491,label:"Sydney College of the Arts"},{value:53,label:"The Medieval and Early Modern..."},{value:35,label:"Theatre and Performance Studies..."},{value:437,label:"United States Studies Centre"},{value:469,label:"Writing Studies"}].map(function(t){var e=t.value;return{name:t.label,value:e}});t.exports={ARTS_UOS_API:"https://sydney.edu.au/arts/app/uos/data/uos.php",DEPARTMENT_OPTIONS:n,LEVELS_OPTIONS:[{name:"Undergraduate",value:"uc"},{name:"Postgraduate",value:"pg"}],SEMESTERS_OPTIONS:[{name:"Semester 1",value:"S1C"},{name:"Semester 2",value:"S2C"}],kEY_DEPARTMENT:"deptID",KEY_LEVEL:"level",KEY_SEMESTER:"session",LOADING_RESULT:"loading results",NO_RESULT:"no results"}},function(t,e){t.exports={random:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=t&&t<=12?t:12,n="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=i.length,a=0;a<e;a++)n+=i.charAt(Math.floor(Math.random()*r));return n},truncate:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.length>e,r=i?t.substr(0,e-1):t;return r=n&&i?r.substr(0,r.lastIndexOf(" ")):r,i?r+"...":r},removeEmptyHtmlTags:function(t,e){return t.replace(e,"").replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)/gm,"")},removeLineBreaks:function(t){return t.replace(/\r?\n|\r|&lt;br&gt;|<br>|<br\/>/g,"")},getMediaTimeStringFromSeconds:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=parseInt(t),n=Math.floor(t/3600);e-=3600*n;var i=Math.floor(e/60),r="";return n>0&&(r=r+n+" hour "),i>0&&(r=r+i+" min "),r=r+(e-=60*i)+" sec"},upperCaseFirstChar:function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}}},function(t,e,n){function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,l=t[Symbol.iterator]();!(i=(o=l.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==l.return||l.return()}finally{if(r)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var r=n(1);t.exports={pickAttrsStdFn:function(t){var e=t.vm,n=t.props;return function(t){for(var a=0,o=Object.entries(r.pick({v:t.attrs,props:n}));a<o.length;a++){var l=i(o[a],2),s=l[0],c=l[1];e[s]=c}}}}},function(t,e,n){n(7),t.exports=n(11)},function(t,e,n){n(8),n(9),n(10)},,,function(t,e){},function(t,e,n){(function(t){var e=n(15);t.mount(document.body.querySelector("#b-js-uos-explorer"),e)}).call(this,n(0))},,,,function(t,e,n){(function(e){var i=n(1),r=n(3),a=n(16),o=n(18),l=n(19),s=n(21),c=n(24),u=n(25);t.exports=function(){var t=u();return{view:function(){return e(".b-uos-explorer-view.b-component",[e(".grid",[e(".1/2--tablet-up.grid__cell",[e(".b-component--tight",[e(s,{title:"Department",options:r.DEPARTMENT_OPTIONS,placeholder:"Select a department",limitHeight:!0,nextFn:i.partial({fn:t.selectedOpt,args:{key:r.kEY_DEPARTMENT}})})])]),e(".1/2--tablet-up.grid__cell",[e(".b-component--tight",[e(s,{title:"Semester",options:r.SEMESTERS_OPTIONS,placeholder:"Select a semester",nextFn:i.partial({fn:t.selectedOpt,args:{key:r.KEY_SEMESTER}})})])]),e(".1/2--tablet-up.grid__cell",[e(".b-component--tight",[e(s,{title:"Level",options:r.LEVELS_OPTIONS,placeholder:"Select a level",nextFn:i.partial({fn:t.selectedOpt,args:{key:r.KEY_LEVEL}})})])])]),e(".b-component",[e(a,{text:"Search",type:"search",nextFn:t.fetchUnitList})]),e("h3.b-title.b-title--first.b-title--h3","Results"),t.isLoading&&e(".grid",[e(".1/2.grid__cell",[e(o)])]),t.noResults&&e("p.b-component",[e("span","There were no results for your selection. Please try again, or "),e("a",{href:"https://sydney.edu.au/arts/about/contact-us.html"},"contact the Faculty of Arts and Social Sciences"),e("span"," .")]),e(l,{list:t.unitList,nextFn:t.showUnitDetails}),e(c,t.unitDetails)])}}}}).call(this,n(0))},function(t,e,n){(function(e){var i=n(17),r=n(5);t.exports=function(){var t=i();return{onbeforeupdate:r.pickAttrsStdFn({vm:t,props:["text","type","style","nextFn"]}),view:function(){return t.text&&e("button.b-button".concat(t.style),t.attrs,[e("span","".concat(t.text)),t.iconStyle&&e("i".concat(t.iconStyle))])}}}}).call(this,n(0))},function(t,e,n){var i=n(4);t.exports=function(){var t="button-".concat(i.random()),e=void 0,n=void 0,r="",a={primary:".b-button--primary",secondary:".b-button--secondary",tertiary:".b-button--tertiary"},o={search:".b-icon.b-icon--search.b-icon--side-right"},l=void 0;return{get id(){return t},get style(){return e?a[e]:a.primary},set text(t){r=t},get text(){return r},set style(t){e=t},set nextFn(t){l=t},set type(t){n=t},get attrs(){return Object.assign({"data-js-el":t},l&&{onclick:l},"submit"==n&&{type:n})},get iconStyle(){return o[n]}}}},function(t,e,n){(function(e){t.exports={view:function(){return e(".b-spinner",[e(".b-spinner__child.b-spinner__child--1"),e(".b-spinner__child.b-spinner__child--2"),e(".b-spinner__child.b-spinner__child--3"),e(".b-spinner__child.b-spinner__child--4"),e(".b-spinner__child.b-spinner__child--5"),e(".b-spinner__child.b-spinner__child--6")])}}}).call(this,n(0))},function(t,e,n){(function(e){var i=n(20),r=n(5),a=n(1);t.exports=function(){var t=i();return{onbeforeupdate:r.pickAttrsStdFn({vm:t,props:["list","nextFn"]}),view:function(){return t.list&&e(".b-component",{"b-js-el":t.id},[t.list.map(function(n){return e("a.b-link.b-link--block",Object.assign({href:n.href||"javascript:void(0);"},t.nextFn&&{onclick:a.unapply({fn:a.partial({fn:t.nextFn,args:{obj:n}}),props:["e"]})}),[e("span","".concat(n.name))])})])}}}}).call(this,n(0))},function(t,e,n){var i=n(4);t.exports=function(){var t="link-list-std-".concat(i.random()),e=void 0,n=void 0;return{get id(){return t},set list(t){e=t},get list(){return e&&e.length>0?e:void 0},set nextFn(t){n=t},get nextFn(){return n},next:n}}},function(t,e,n){(function(e){var i=n(1),r=n(5),a=n(22);t.exports=function(){var t=a();return{onbeforeupdate:r.pickAttrsStdFn({vm:t,props:["title","options","placeholder","limitHeight","nextFn"]}),view:function(){return e("div",{"data-js-el":t.id},[t.title&&e("p.b-form-control__label b-form-control__label--size-base.b-form-control__label--tight",t.title),e(".b-dropdown-simple.b-abstract-dropdown-component.b-abstract-dropdown-component--show-panel.b-input-group__wrapper",[e("a.b-dropdown-simple__button-toggle.b-dropdown-simple__option.b-link--block.b-link--no-underline[href=javascript:void(0);]",{onclick:t.toggleOptionsVisibility},[e("span.button-toggle-text","".concat(t.selectedOpt.name)),e("span.b-dropdown-simple__button-toggle-icon.b-icon.b-icon--down-chevron")]),e(".b-dropdown-simple__panel".concat(t.limitHeight),t.options.map(function(n){return e(".b-dropdown-simple__option-wrapper",[e("a.b-dropdown-simple__option.b-link--block.b-link--no-underline[href=javascript:void(0);]",{onclick:i.unapply({fn:i.partial({fn:t.next,args:{obj:n}}),props:["e"]})},n.name)])}))])])}}}}).call(this,n(0))},function(t,e,n){(function(e){var i=n(23),r=n(4);t.exports=function(){var t="dropdown-".concat(r.random()),n="",a=[],o="Select",l=!1,s=!1,c=void 0,u=void 0,p=void 0;return i.documentClick$.subscribe(function(t){Object.is(t.target,u)||(s=!1,e.redraw()),u=void 0}),{get id(){return t},get title(){return n},set title(t){n=t},get selectedOpt(){return c||{name:o,value:""}},get options(){return s?a:[]},set options(t){Object.is(a,t)||(a=t,s=!1,c=void 0)},get placeholder(){return o},set placeholder(t){Object.is(o,t)||Object.is(t,void 0)||(o=t)},get limitHeight(){return l?".b-dropdown-simple__panel--limit-height":""},set limitHeight(t){l=!!t},set nextFn(t){p=t},toggleOptionsVisibility:function(t){u=t.target,s=!s},next:function(t){var e=t.e,n=t.obj;u=e.target,s=!1,Object.is(c,n)||(c=n,p&&p({e:e,obj:n}))}}}}).call(this,n(0))},function(t,e,n){var i=(0,n(35).fromEvent)(document,"click");t.exports={documentClick$:i}},function(t,e,n){(function(e){t.exports=function(){return{view:function(t){var n=t.attrs;return n&&n.name&&e(".b-unit-details",[e("h3.b-title.b-title--first.b-title--h3",n.name),e(".b-paragraph",[e("div","".concat(n.Session_name,", ").concat(n.Academic_year)),e("div","Credit Points: ".concat(n.UOS_credit_points||""))]),e(".b-paragraph",[e("div","Coordinator: ".concat(n.Coordinator_name||"")),e("div","Phone: ".concat(n.Coordinator_phone||"")),e("div","Email: ".concat(n.Coordinator_email||""))]),n.UOS_description&&e(".b-paragraph",[e("h4.b-title.b-title--first.b-title--h4","Description"),n.UOS_description.map(function(t){return e("p",t)})]),n.UOS_assessment&&e(".b-paragraph",[e("h4.b-title.b-title--first.b-title--h4","Assessments"),n.UOS_assessment.map(function(t){return e("p",t)})]),n.UOS_lectures&&e(".b-paragraph",[e("h4.b-title.b-title--first.b-title--h4","Classes"),n.UOS_lectures.map(function(t){return e("p",t)})])])}}}}).call(this,n(0))},function(t,e,n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=n(26),a=n(3);t.exports=function(){var t={},e=void 0,n={get unitList(){var t=r.resultStream();return Object.is(i(t),"object")?t.map(function(t){return Object.assign({},t,{name:"".concat(t.UOS_alpha).concat(t.UOS_digit," ").concat(t.UOS_name)})}):void 0},get unitDetails(){return e},get isLoading(){return Object.is(r.resultStream(),a.LOADING_RESULT)},get noResults(){return!!Object.is(r.resultStream(),a.NO_RESULT)},selectedOpt:function(e){var n=e.key,i=e.obj;t[n]=i?i.value:void 0},fetchUnitList:function(){e=void 0,r.fetchUnitList({obj:t})},showUnitDetails:function(t){var n=t.obj;e=n}};return n}},function(t,e,n){(function(e){var i,r,a=n(3),o=n(27),l=n(29),s=n(1),c=n(33),u=o(),p=(i={props:[a.kEY_DEPARTMENT,a.KEY_LEVEL]},r=i.props,function(t){return l.stringify(s.pick({v:t,props:r}))});t.exports={resultStream:u,fetchUnitList:function(t){var n=t.obj;u(a.LOADING_RESULT),e.redraw(),fetch("".concat(a.ARTS_UOS_API,"?allUOS&").concat(p(n))).then(function(t){return t.json()}).then(function(t){var i=n[a.KEY_SEMESTER],r=t&&t.data?s.filterIn({fn:function(t){var e=t.v;return!i||Object.is(e.Period,i)},arr:t.data}):a.NO_RESULT;c.isEmpty(r)&&(r=a.NO_RESULT),u(r),e.redraw()})}}}).call(this,n(0))}],[[6,1,2]]]);