Commit 3546e6e9 authored by Jeff Sturek's avatar Jeff Sturek
Browse files

Implement DCF Tabs

parent 652dadef
......@@ -3,7 +3,6 @@
/node_modules
/.project
/.settings
/www/css
/www/less/lib
/www/wdn
/.buildpath
......
......@@ -6,7 +6,6 @@ module.exports = function (grunt) {
var lessDir = 'www/less';
var lessVendorDir = lessDir + '/lib';
var sassDir = 'www/scss';
// var sassVendorDir = sassDir + '/mixins';
var cssDir = 'www/css';
var jsDir = 'www/js';
......@@ -17,6 +16,7 @@ module.exports = function (grunt) {
var jsFiles = [
jsDir + '/search.js',
jsDir + '/search-tabs.js'
];
//TODO Update or remove for 5.0?
......@@ -30,18 +30,6 @@ module.exports = function (grunt) {
return fs.existsSync(lessVendorDir + '/' + value);
});
// TODO: Import DCF and UNLedu 5.0 mixins and variables
// var dcfMixinLibBaseUrl = 'https://raw.githubusercontent.com/d-c-n/dcf/master/assets/dist/scss/mixins/';
// var dcfMixins = [
// '_mixins.backgrounds.scss',
// '_mixins.margins.scss',
// '_mixins.padding.scss',
// '_mixins.typography.scss'
// ];
// var allMixinsExist = every(dcfMixins, function(value) {
// return fs.existsSync(sassVendorDir + '/' + value);
// });
var lessFiles = {};
cssFiles.forEach(function(file) {
lessFiles[cssDir + '/' + file + '.css'] = lessDir + '/' + file + '.less';
......@@ -53,7 +41,8 @@ module.exports = function (grunt) {
});
var builtJsFiles = {};
builtJsFiles[jsDir + '/search.min.js'] = jsFiles;
builtJsFiles[jsDir + '/search.min.js'] = jsDir + '/search.js';
builtJsFiles[jsDir + '/search-tabs.min.js'] = jsDir + '/search-tabs.js';
var autoprefixPlugin = new (require('less-plugin-autoprefix'))({browsers: ["last 2 versions"]});
var cleanCssPlugin = new (require('less-plugin-clean-css'))();
......@@ -70,13 +59,6 @@ module.exports = function (grunt) {
}),
dest: lessVendorDir
}
// 'dcf-mixins': {
// src: dcfMixins.map(function(file) {
// return dcfMixinLibBaseUrl + file;
// }),
// dest: sassVendorDir
// }
// TODO: add UNLedu 5.0 mixins
},
less: {
......@@ -98,9 +80,6 @@ module.exports = function (grunt) {
options: {
implementation: sass,
sourceMap: true
// includePaths: [
// __dirname+'/node_modules/modularscale-sass/stylesheets'
// ]
}
},
},
......@@ -159,7 +138,6 @@ module.exports = function (grunt) {
clean: {
lessCss: Object.keys(lessFiles).concat(lessVendorDir),
// css: Object.keys(sassFiles).concat(sassVendorDir),
sassCss: Object.keys(sassFiles),
js: Object.keys(builtJsFiles).concat(jsDir + '/**/*.map')
},
......
#wdn_search,.embed #visitorChat{display:none!important}.search-bg{background-image:url(../images/search-bg-640.jpg)}@media (min-width:640px){.search-bg{background-image:url(../images/search-bg-960.jpg)}}@media (min-width:960px){.search-bg{background-image:url(../images/search-bg-1280.jpg)}}@media (min-width:1280px){.search-bg{background-image:url(../images/search-bg-1920.jpg)}}@media (min-width:1920px){.search-bg{background-image:url(../images/search-bg-2560.jpg)}}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.search-bg{background-image:url(../images/search-bg-1280.jpg)}}@media only screen and (-webkit-min-device-pixel-ratio:2) and (min-width:640px),only screen and (min-resolution:2dppx) and (min-width:640px),only screen and (min-resolution:192dpi) and (min-width:640px){.search-bg{background-image:url(../images/search-bg-1920.jpg)}}@media only screen and (-webkit-min-device-pixel-ratio:2) and (min-width:960px),only screen and (min-resolution:2dppx) and (min-width:960px),only screen and (min-resolution:192dpi) and (min-width:960px){.search-bg{background-image:url(../images/search-bg-2560.jpg)}}.webp .search-bg{background-image:url(../images/search-bg-640.webp)}@media (min-width:640px){.webp .search-bg{background-image:url(../images/search-bg-960.webp)}}@media (min-width:960px){.webp .search-bg{background-image:url(../images/search-bg-1280.webp)}}@media (min-width:1280px){.webp .search-bg{background-image:url(../images/search-bg-1920.webp)}}@media (min-width:1920px){.webp .search-bg{background-image:url(../images/search-bg-2560.webp)}}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.webp .search-bg{background-image:url(../images/search-bg-1280.webp)}}@media only screen and (-webkit-min-device-pixel-ratio:2) and (min-width:640px),only screen and (min-resolution:2dppx) and (min-width:640px),only screen and (min-resolution:192dpi) and (min-width:640px){.webp .search-bg{background-image:url(../images/search-bg-1920.webp)}}@media only screen and (-webkit-min-device-pixel-ratio:2) and (min-width:960px),only screen and (min-resolution:2dppx) and (min-width:960px),only screen and (min-resolution:192dpi) and (min-width:960px){.webp .search-bg{background-image:url(../images/search-bg-2560.webp)}}#searchform .dcf-input-group{margin:0 auto;max-width:30em!important}.google-search,.search-results h3{display:none}.search-faux-tab{border-color:#e3e3e2 #e3e3e2 #fff;margin-bottom:-1px}#directory_results .cInfo,#directory_results .overflow .roles .organization-name,#directory_results .result_head,#directory_results h3,#directory_results h4,[data-uid=kfarrell2] .given-name{display:none}#directory_results .dep_result,#directory_results .ppl_Sresult{margin-bottom:1.77em}#directory_results .overflow>.recordDetails{align-self:center;flex:1 1 auto}#directory_results .overflow .roles li{margin-bottom:.32em}#directory_results .overflow .roles:last-child{margin-bottom:0}#directory_results .overflow .roles .organization-unit,#directory_results .overflow .roles .title{display:block}#directory_results .given-name{font-size:1rem;margin-left:1em;text-transform:uppercase}
/*# sourceMappingURL=search-5.0.css.map */
\ No newline at end of file
{"version":3,"sources":["../scss/search.scss"],"names":[],"mappings":"AAKA,gCAEE,sBAAwB,CACzB,AAID,WACE,iDAAoD,CAiBrD,AAfC,yBAHF,WAG8B,iDAAoD,CAejF,CAAA,AAdC,yBAJF,WAI8B,kDAAqD,CAclF,CAAA,AAbC,0BALF,WAK+B,kDAAqD,CAanF,CAAA,AAZC,0BANF,WAM+B,kDAAqD,CAYnF,CAAA,AAVC,yIARF,WAYI,kDAAqD,CAMxD,CAAA,AAJG,2MAdJ,WAcgC,kDAAqD,CAIpF,CAAA,AAHG,2MAfJ,WAegC,kDAAqD,CAGpF,CAAA,AAGD,iBACE,kDAAqD,CAiBtD,AAfC,yBAHF,iBAG8B,kDAAqD,CAelF,CAAA,AAdC,yBAJF,iBAI8B,mDAAsD,CAcnF,CAAA,AAbC,0BALF,iBAK+B,mDAAsD,CAapF,CAAA,AAZC,0BANF,iBAM+B,mDAAsD,CAYpF,CAAA,AAVC,yIARF,iBAYI,mDAAsD,CAMzD,CAAA,AAJG,2MAdJ,iBAcgC,mDAAsD,CAIrF,CAAA,AAHG,2MAfJ,iBAegC,mDAAsD,CAGrF,CAAA,AAGD,6BACE,cAAc,AACd,wBAAyB,CAC1B,AAED,kCAEC,YAAa,CACb,AAED,iBACE,kCAA0C,AAC1C,kBAAmB,CACpB,AAID,8LAME,YAAa,CACd,AAGD,+DAEE,oBAAqB,CACtB,AAGD,4CACE,kBAAkB,AAClB,aAAc,CACf,AAGD,uCACE,mBAAoB,CACrB,AAGD,+CACE,eAAgB,CACjB,AAGD,kGAEE,aAAc,CACf,AAGD,+BACE,eAAe,AACf,gBAAgB,AAChB,wBAAyB,CAC1B","file":"search-5.0.css"}
\ No newline at end of file
.unl .google-results table,.unl .google-results tbody td,.unl .google-results tbody th{border:0!important}.unl .google-results tbody td,.unl .google-results tbody th{padding:0}.unl .gsc-control-cse{font-family:inherit;font-size:inherit}.unl .cse .gsc-control-cse,.unl .gsc-control-cse{background-color:transparent;border:0;padding:0}.unl .gsc-control-cse .gsc-table-result{font-family:inherit;font-size:inherit;padding:0}.unl .gsc-above-wrapper-area{border:0;margin-bottom:2.37em;padding:0}.unl .gsc-result-info{font-size:inherit;margin:0;padding:0}.unl .gcsc-branding{display:none}.unl .gsc-webResult .gsc-result{border:0;padding-bottom:2.37em;padding-top:0}.unl .gsc-thumbnail-inside{padding-left:0}.unl .gsc-thumbnail-inside>.gs-title,.unl .gsc-thumbnail-inside>.gs-title *{color:#d00000;height:auto;line-height:1.25em;text-decoration:none}.unl .gsc-thumbnail-inside>.gs-title{font-size:1.5em;margin-bottom:.18em}.unl .gsc-thumbnail-inside>.gs-title *{font-size:1rem}.unl .gsc-thumbnail-left{display:block;margin-bottom:.43em}.unl .gs-snippet{margin-bottom:.43em}.unl .gsc-table-cell-snippet-close .gs-title{display:none}.unl .gsc-control-cse .gs-snippet{color:inherit}.unl .gs-promotion-image-box,.unl .gs-web-image-box{padding:0 1em 0 0}.unl .gs-promotion-image-box img.gs-promotion-image,.unl .gs-web-image-box img.gs-image{max-height:none;max-width:100%}.unl .gs-image-box.gs-web-image-box.gs-web-image-box-landscape,.unl .gs-image-box.gs-web-image-box.gs-web-image-box-portrait{width:4.21em}.unl .gs-image-box.gs-web-image-box.gs-web-image-box-portrait{height:auto}.unl .gsc-result.gsc-webResult:hover{border:0}.unl .gsc-url-top{display:block;font-size:.75em;padding:0 0 1em}.unl .gsc-url-bottom{display:none}.unl .gsc-results .gsc-cursor-box{border-top:1px solid #ccc;margin:0;padding:1em 0 0}.unl .gsc-results .gsc-cursor-box .gsc-cursor-page{display:inline-block;padding:.43em;text-align:center}.unl .gsc-results .gsc-cursor-box .gsc-cursor-page:not(:last-child){margin-right:1em}.unl .gsc-results .gsc-cursor-box .gsc-cursor-current-page{font-weight:400;text-decoration:none}.unl .gs-result .gs-visibleUrl,.unl .gsc-author .unl .gs-result a.gs-visibleUrl,.unl .gsc-location,.unl .gsc-org,.unl .gsc-reviewer,.unl .gsc-role,.unl .gsc-snippet-metadata,.unl .gsc-tel{color:#6d6d6c}.unl .gs-result .gs-visibleUrl,.unl .gs-result a.gs-visibleUrl{padding-bottom:0}
/*# sourceMappingURL=search-google-5.0.css.map */
\ No newline at end of file
{"version":3,"sources":["../scss/search-google.scss"],"names":[],"mappings":"AASA,uFAGE,kBAAoB,CACrB,AAED,4DAEE,SAAU,CACX,AAED,sBAIE,oBAAoB,AACpB,iBAAkB,CAEnB,AAED,iDAPE,6BAA6B,AAC7B,SAAS,AAGT,SAAU,CAQX,AAED,wCACE,oBAAoB,AACpB,kBAAkB,AAClB,SAAU,CACX,AAED,6BACE,SAAS,AAET,qBAAqB,AACrB,SAAU,CACX,AAED,sBAGE,kBAAkB,AAClB,SAAS,AACT,SAAU,CACX,AAED,oBACE,YAAa,CACd,AAED,gCACE,SAAS,AAET,sBAAsB,AACtB,aAAc,CACf,AAED,2BACE,cAAe,CAChB,AAED,4EAGE,cAAc,AACd,YAAe,AAGf,mBAAmB,AAFnB,oBAAqB,CAGtB,AAED,qCAEE,gBAAgB,AAChB,mBAAoB,CACrB,AAED,uCAEE,cAAe,CAChB,AAED,yBACE,cAAc,AAEd,mBAAoB,CACrB,AAED,iBAEE,mBAAoB,CACrB,AAED,6CACE,YAAa,CACd,AAED,kCACE,aAAc,CACf,AAED,oDAEE,iBAAkB,CACnB,AAED,wFAEE,gBAAgB,AAChB,cAAe,CAChB,AAED,6HAGE,YAAa,CACd,AAED,8DACE,WAAY,CACb,AAOD,qCACE,QAAS,CACV,AAED,kBACE,cAAc,AAGd,gBAAgB,AAFhB,eAAkB,CAGnB,AAED,qBACE,YAAa,CACd,AAcD,kCAGE,0BAA0B,AAC1B,SAAS,AACT,eAAkB,CACnB,AAED,mDAGE,qBAAqB,AAErB,cAAc,AACd,iBAAkB,CACnB,AAED,oEAEE,gBAAiB,CAElB,AAED,2DAEE,gBAAgB,AAChB,oBAAqB,CACtB,AAED,4LASE,aAAc,CACf,AAED,+DAEE,gBAAiB,CAClB","file":"search-google-5.0.css"}
\ No newline at end of file
.gsc-control-cse,.gsc-control-cse .gsc-table-result{font-family:inherit;font-size:inherit}.gsc-thumbnail-inside{padding-left:0;padding-right:0}.gsc-control-cse .gs-snippet{color:inherit}.gsc-thumbnail .gs-image-box{padding-right:.5em}.gsc-url-top{font-size:80%;padding-left:0;padding-right:0}.gsc-control-cse{padding:0}.gsc-webResult .gsc-result{border:0;padding:.75em 0}.gsc-result .gs-title{height:1.662em}.gsc-result.gsc-webResult:hover{border:none}.gs-result .gs-title,.gs-result .gs-title *{color:#d00000;text-decoration:none}.gs-result .gs-visibleUrl,.gs-result .gsc-url-top,.gs-result a.gs-visibleUrl{color:#554721}.gsc-result-info{color:#5b5b5a;font-style:italic;margin:0 0 10px}.gsc-results .gsc-cursor-box{border-top:1px solid #eae9e6;font-family:Gotham SSm A,Gotham SSm B,Verdana,sans-serif;font-style:normal;font-weight:400;margin-top:1em;padding:1em 0 0}.gsc-results .gsc-cursor-box .gsc-cursor-page{border:1px solid #eae9e6;color:#d00000;display:inline-block;margin-bottom:1em;min-width:2.2em;padding:2px 8px;text-align:center;text-decoration:none}.gsc-results .gsc-cursor-box .gsc-cursor-current-page{border:0;color:#5b5b5a;font-weight:400}.gcsc-branding{display:none;margin-bottom:1.3333em}td.gcsc-branding-text{font-style:italic;width:auto}td.gcsc-branding-text div.gcsc-branding-text{color:#5b5b5a;text-align:left}td.gcsc-branding-text-name{width:100%}.gs-promotion-image-box img.gs-promotion-image,.gs-web-image-box img.gs-image{max-height:none;max-width:100%}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC1nb29nbGUuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFpQixvREFBb0Qsb0JBQW9CLGlCQUFpQixDQUFDLHNCQUFzQixlQUFlLGVBQWUsQ0FBQyw2QkFBNkIsYUFBYSxDQUFDLDZCQUE2QixrQkFBa0IsQ0FBQyxhQUFhLGNBQWMsZUFBZSxlQUFlLENBQUMsaUJBQWlCLFNBQVMsQ0FBQywyQkFBMkIsU0FBUyxlQUFlLENBQUMsc0JBQXNCLGNBQWMsQ0FBQyxnQ0FBZ0MsV0FBVyxDQUFDLDRDQUE0QyxjQUFjLG9CQUFvQixDQUFDLDZFQUE2RSxhQUFhLENBQUMsaUJBQW1ELGNBQWEsQUFBL0Msa0JBQWtCLGVBQWdCLENBQWMsNkJBQTZCLDZCQUE2QixBQUErQix5REFBNkQsQUFBZ0Isa0JBQWlCLEFBQWpDLGdCQUFnQixBQUE1RixlQUFlLEFBQS9CLGVBQWdCLENBQThHLDhDQUE4Qyx5QkFBeUIsQUFBOEcsY0FBYSxBQUF6RSxxQkFBcU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NzYy1icmFuZGluZy10ZXh0e3RleHQtYWxpZ246bGVmdDtjb2xvcjojNWI1YjVhfXRkLmdjc2MtYnJhbmRpbmctdGV4dC1uYW1le3dpZHRoOjEwMCV9LmdzLXByb21vdGlvbi1pbWFnZS1ib3ggaW1nLmdzLXByb21vdGlvbi1pbWFnZSwuZ3Mtd2ViLWltYWdlLWJveCBpbWcuZ3MtaW1hZ2V7bWF4LXdpZHRoOjEwMCU7bWF4LWhlaWdodDpub25lfSJdfQ== */
\ No newline at end of file
#wdn_search,.embed #visitorChat{display:none!important}#search_results table,#search_results td{border:0;padding:0}#searchform{background:#38431b url(../images/050419.jpg) 50% 50% no-repeat;background-size:cover;text-align:center}#searchform .wdn-input-group{margin:0 auto;max-width:30em}#search_wrapper{display:none}.results-group:hover{background-color:#fff}.results-group:hover .result-head{background-color:#474746}.results-group .result-head{background-color:#50504f;color:#fff;position:relative}.results-group .result-head h2{color:inherit;margin:0}.result-tab{color:#d5d5d2;list-style:none;margin:0;padding:0;position:relative}.result-tab li{display:inline}.result-tab li.selected{color:#fff}.result-tab li a{border:0;color:inherit}.result-tab li:before{content:"\b7\a0"}.result-tab li:first-child:before{content:none}.result-tab:after{border-color:transparent transparent #fff;border-style:solid;border-width:0 6px 6px;bottom:-1.425em;content:"";left:0;position:absolute;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}#directory_results .result-tab:after{-webkit-transform:translateX(1.3125em);transform:translateX(1.3125em)}#search_results .result-tab:after{-webkit-transform:translateX(1.875em);transform:translateX(1.875em)}#search_results .result-tab:after.no-local{-webkit-transform:translateX(2.2812em);transform:translateX(2.2812em)}#directory_results .result-tab.state-1:after{-webkit-transform:translateX(7em);transform:translateX(7em)}#search_results .result-tab.state-1:after{-webkit-transform:translateX(7.5312em);transform:translateX(7.5312em)}.embed,.search-set{background:#fff;margin:0}.search-results{opacity:0;transition:opacity .4s}.search-results.active{opacity:1}.search-results h3{display:none}.results-group{float:left;width:100%}#directory_results>*{padding:1.425em 9.375%}@media (min-width:48em){#directory_results{width:33.3333%}}.embed #directory_results{width:40%}#search_results>*{padding:1.425em 7.812%}@media (min-width:48em){#search_results{width:66.6667%}#search_results .result-head{border-right:1px solid #474746}#search_results .search-results{border-right:1px solid #f4f3f0}}.embed #search_results{width:60%}.embed #search_results .result-head{border-right:1px solid #474746}.embed #search_results .search-results{border-right:1px solid #f4f3f0}#ppl_results .result_head,#ppl_results h3,#ppl_results h4,.google-search{display:none}#ppl_results .pfResult{list-style:none;padding:0}#ppl_results .dep_result,#ppl_results .ppl_Sresult{margin:1em 0}#ppl_results .cInfo{display:none}#ppl_results .overflow{display:flex}#ppl_results .overflow>.profile_pic{margin-right:1em;min-width:40px;width:40px}#ppl_results .overflow>.recordDetails{align-self:center;flex:1 1 auto}#ppl_results .overflow .photo{-o-object-fit:cover;border-radius:50%;height:40px;margin-top:.375em;object-fit:cover;width:100%}#ppl_results .overflow .roles{list-style:none;margin:0;padding:0}#ppl_results .overflow .roles li{margin-bottom:.618rem}#ppl_results .overflow .roles li:last-child{margin-bottom:0}#ppl_results .overflow .roles .organization-unit,#ppl_results .overflow .roles .title{display:block}#ppl_results .overflow .roles .organization-name{display:none}#ppl_results .fn{font-size:1.128em;font-weight:700}#ppl_results .given-name{color:#5b5b5a;font-family:Gotham SSm A,Gotham SSm B,Verdana,sans-serif;font-size:1rem;font-style:normal;font-weight:400;margin-left:1em;text-transform:uppercase}[data-uid=kfarrell2] .given-name{display:none}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlYXJjaC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWlCLGdDQUFnQyxzQkFBc0IsQ0FBQyx5Q0FBeUMsU0FBUyxTQUFTLENBQUMsWUFBOEIsK0RBQStELHNCQUFxQixBQUF0RyxpQkFBa0IsQ0FBcUYsNkJBQTZCLGNBQWMsY0FBYyxDQUFDLGdCQUFnQixZQUFZLENBQUM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le2Rpc3BsYXk6YmxvY2t9I3BwbF9yZXN1bHRzIC5vdmVyZmxvdyAucm9sZXMgLm9yZ2FuaXphdGlvbi1uYW1le2Rpc3BsYXk6bm9uZX0jcHBsX3Jlc3VsdHMgLmZue2ZvbnQtc2l6ZToxLjEyOGVtO2ZvbnQtd2VpZ2h0OjcwMH0jcHBsX3Jlc3VsdHMgLmdpdmVuLW5hbWV7bWFyZ2luLWxlZnQ6MWVtO2ZvbnQtc2l6ZToxcmVtO2ZvbnQtZmFtaWx5OidHb3RoYW0gU1NtIEEnLCdHb3RoYW0gU1NtIEInLFZlcmRhbmEsc2Fucy1zZXJpZjtmb250LXdlaWdodDo0MDA7Zm9udC1zdHlsZTpub3JtYWw7dGV4dC10cmFuc2Zvcm06dXBwZXJjYXNlO2NvbG9yOiM1YjViNWF9W2RhdGEtdWlkPWtmYXJyZWxsMl0gLmdpdmVuLW5hbWV7ZGlzcGxheTpub25lfSJdfQ== */
\ No newline at end of file
<?php
$cacheVersion = date('Ymd');
$search_engine_id = '015236299699564929946:nk1siew10ie';
$config_file = __DIR__ . '/../config.sample.php';
......@@ -26,13 +26,6 @@ function loadDefaultSections($page)
$page->affiliation = '';
}
$localScriptUrl = './js/search.min.js?v=20190116';
if (UNL_Search::$mode === 'debug') {
$pageTemplate = 'Local';
$localScriptUrl = './js/search.js';
}
$isEmbed = isset($_GET['embed']) && $_GET['embed'];
// While the site proper is skinned with a specific version, the templates used
......@@ -43,13 +36,27 @@ if ($isEmbed && $_GET['embed'] === '1') {
$pageTemplate = 'Fixed';
$page = Templates::factory($pageTemplate, Templates::VERSION_4_1);
$templatePath = 'templates/4.1/';
$page->addStyleSheet('css/search.css?v=20180901');
$page->addStyleSheet('css/search.css?v=' . $cacheVersion);
$localScriptUrl = './js/search.min.js?v=' . $cacheVersion;
if (UNL_Search::$mode === 'debug') {
$pageTemplate = 'Local';
$localScriptUrl = './js/search.js';
}
} else {
$pageTemplate = 'AppLocal';
$page = Templates::factory($pageTemplate, Templates::VERSION_5_1);
$templatePath = 'templates/5.0/';
$localScriptUrl = './js/search-tabs.min.js?v=' . $cacheVersion;
if (UNL_Search::$mode === 'debug') {
$pageTemplate = 'Local';
$localScriptUrl = './js/search-tabs.js';
}
if (!$isEmbed) {
if (file_exists(__DIR__ . '/wdn/templates_5.1')) {
$page->setLocalIncludePath(__DIR__);
......@@ -61,7 +68,6 @@ if ($isEmbed && $_GET['embed'] === '1') {
// Add WDN Deprecated Styles
$page->head .= '<link rel="preload" href="/wdn/templates_5.1/css/deprecated.css" as="style" onload="this.onload=null;this.rel=\'stylesheet\'"> <noscript><link rel="stylesheet" href="/wdn/templates_5.1/css/deprecated.css"></noscript>';
// no menu items, so hide mobile menu
$page->addStyleDeclaration("#dcf-mobile-toggle-menu {display: none!important}");
......@@ -69,7 +75,7 @@ if ($isEmbed && $_GET['embed'] === '1') {
$page->addStyleDeclaration("#dcf-mobile-toggle-search, #dcf-search {display: none!important}");
}
$page->addStyleSheet('css/search-5.0.css?v=20180901');
$page->addStyleSheet('css/search-5.0.css?v=' . $cacheVersion);
}
$localResults = '';
......@@ -125,7 +131,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
}
$localResults = renderTemplate($templatePath . 'google-results.tpl.php', array(
'title' => $page->titlegraphic,
'title' => $page->titlegraphic, // leave for backwards compatibility for 4.1
'id' => 'local_results',
));
} elseif (!$isEmbed) {
......@@ -144,7 +150,8 @@ if (!$isEmbed) {
if ($isEmbed || !empty($_GET['q'])) {
$maincontent .= renderTemplate($templatePath . 'search-results.tpl.php', array(
'isEmbed' => $isEmbed,
'local_results' => $localResults
'local_results' => $localResults,
'localTitle' => $page->titlegraphic
));
}
......@@ -152,7 +159,8 @@ $endScript = renderTemplate($templatePath . 'end-scripts.tpl.php', array(
'localScriptUrl' => $localScriptUrl,
'googleLoaderUrl' => 'https://cse.google.com/cse.js?cx=' . $search_engine_id,
'initialQuery' => $initialQuery,
'localContext' => $context
'localContext' => $context,
'cacheVersion' => $cacheVersion
));
if ($isEmbed) {
......@@ -175,5 +183,6 @@ if (UNL_Search::$mode === 'debug') {
echo renderTemplate($template, array(
'head' => $page->head,
'maincontent' => $maincontent
'maincontent' => $maincontent,
'cacheVersion' => $cacheVersion
));
This diff is collapsed.
define(['jquery', 'analytics'], function ($, analytics) {
"use strict";
// Service server (defaults to //directory.unl.edu)
var directoryServer = null;
var unlContext = '015236299699564929946:nk1siew10ie';
var transitionDelay = 400;
var inputSel = '#search_q';
var formSel = '#searchform form';
var resultSel = '.search-results';
var googleSel = '.google-results';
var evtStateChange = 'statechange';
var wrapperMain = '#search_wrapper';
var wrapperWeb = '#search_results';
var wrapperDir = '#directory_results';
var dirPeopleResults = 'ppl_results';
var dirDeptResults = 'dept_results';
var unlResults = 'unl_results';
var localResults = 'local_results';
window.pf_getUID = function() {
return true;
};
// Caching Class
var Cache = function() {
this.storage = {};
};
Cache.prototype.get = function(key) {
return this.storage[key] || undefined;
};
Cache.prototype.save = function(key, value) {
this.storage[key] = value;
return this;
};
// Directory Controller Class
var Directory = function(server, peopleContainerId, deptContainerId) {
this.peopleContainer = '#' + peopleContainerId;
this.deptContainer = '#' + deptContainerId;
this._server = server || 'https://directory.unl.edu';
this._cache = new Cache();
this._searchCanceled = false;
};
Directory.prototype._render = function(data) {
if (this._searchCanceled) {
return;
}
// render people results
$(this.peopleContainer).html(data);
this._renderState('people', this.peopleContainer);
// render dept results
$(this.deptContainer).html(data);
this._renderState('dept', this.deptContainer);
};
Directory.prototype._renderState = function(type, container) {
var $innerRes = $('.results', $(container)),
$showRes, $hideRes,
depFilter = '.departments';
if (!$innerRes.length) {
return;
}
if (type === 'people') {
$showRes = $innerRes.not(depFilter);
$hideRes = $innerRes.filter(depFilter);
} else {
$showRes = $innerRes.filter(depFilter);
$hideRes = $innerRes.not(depFilter);
}
if (!$showRes.length) {
$(container).html('Sorry, no results could be found.');
if (type === 'people') {
$('.dept-results-tab').first().click();
}
}
$hideRes.hide();
};
Directory.prototype.cancelSearch = function() {
this._searchCanceled = true;
if (this._xhr) {
this._xhr.abort();
}
};
Directory.prototype.execute = function(q) {
var cacheData = this._cache.get(q),
self = this;
this._searchCanceled = false;
if (this._xhr) {
this._xhr.abort();
}
if (cacheData) {
this._render(cacheData);
} else {
this._xhr = $.get(this._server + '/service.php?q=' + encodeURIComponent(q), function(data) {
self._cache.save(q, data);
self._render(data);
});
}
};
Directory.prototype.clearAllResults = function() {
$(this.peopleContainer).empty();
$(this.deptContainer).empty();
};
// Google Search Wrapper Class
var GoogleSearcher = function(search_element, root_of_element) {
this.control = search_element;
this.control.root = root_of_element;
}
GoogleSearcher.prototype.setSearchCompleteCallback = function(callback) {
this.complete_callback = callback;
}
GoogleSearcher.prototype.setSearchStartingCallback = function(callback) {
this.starting_callback = callback;
}
GoogleSearcher.prototype.execute = function(query) {
this.starting_callback(this.control, null, query);
this.control.execute(query);
this.complete_callback(this.control);
}
return {
initialize: function(firstQ, localContext) {
// query related
var query = '';
// CustomSearchControl instances and config
var activeSearch; // this is the search that is currently shown
var unlGoogleSearch;
var localGoogleSearch;
var directorySearch;
var searchToggleLock = false;
var trackQuery = function(q) {
var loc = window.location,
qs = loc.search.replace(/(?:(\?)|&)q=[^&]*(?:&|$)/, '$1'),
page = [
loc.pathname,
qs || '?',
(qs && qs != '?') ? '&' : '',
'q=',
encodeURIComponent(q)
].join('');
analytics.callTrackPageview(page);
if (window.history.pushState) {
window.history.pushState({query: q}, '', page);
}
};
var queryComplete = function(control) {
var $root = $(control.root);
// a11y patching
$('img.gs-image', $root).each(function() {
if (!this.alt) {
this.alt = $(this).closest('.gsc-table-result').find('.gs-title').first().text();
}
});
$('img.gcsc-branding-img-noclear', $root).attr('alt', 'Google™');
setTimeout(function() {
if (!searchToggleLock && localGoogleSearch && control == localGoogleSearch.control && $('.gs-no-results-result', $root).length) {
$root.closest('.results-group').find('.result-tab li:last-child').click();
return;
}
}, 1000);
searchToggleLock = false;
};
var fullQuery = function(q, track) {
if (track !== false) {
trackQuery(q);
}
try {
activeSearch.execute(q);
} catch (e) {
queryComplete(activeSearch.control);
}
directorySearch.execute(q);
$(wrapperMain).fadeIn();
};
var fullStop = function() {
//activeSearch.cancelSearch(): // TODO: implement this
directorySearch.cancelSearch();
$(wrapperMain).fadeOut();
setTimeout(function() {
activeSearch.control.clearAllResults();
directorySearch.clearAllResults();
}, transitionDelay);
};
var queryStart = function(control, searcher, q) {
if (q !== query) {
trackQuery(q);
directorySearch.execute(q);
}
};
directorySearch = new Directory(directoryServer, dirPeopleResults, dirDeptResults);
// Setup DOM on ready
$(function() {
var $q = $(inputSel),
resSel = '.results-group',
tabsSel = '.result-tab',
selCls = 'selected',
stateClsPfx = 'state-',
$resTabs = $('.result-tab'),
tabStateChange = function(e, state, prevState) {
var $tab = $(this).find(tabsSel);
e.stopPropagation();
$tab.removeClass(stateClsPfx + prevState);
$tab.addClass(stateClsPfx + state);
$tab.children().removeClass(selCls).eq(state).addClass(selCls);
},
googleOrigin = /^https?:\/\/.*\.google\.com$/,
isValidOrigin = function(origin) {
if (googleOrigin.test(origin)) {
return false;
}
// don't allow self origin or browser extension origins
if (origin == location.origin || /^chrome:/.test(origin)) {
return false;
}
return true;
},
passiveQuery = function(q, track) {
if (query === q) {
return;
}
query = q;
$q.val(q);
if (q) {
fullQuery(q, track);
} else {
fullStop();
}
};
var render_attrs = {
div: 'unl_results',
tag: 'searchresults-only',
attributes: {
enableImageSearch: false
}
}
// draw the Google search results stuff
google.search.cse.element.render(render_attrs);
// bind the search results element to this class
var searchElement = google.search.cse.element.getAllElements()['searchresults-only0'];
window.googleSearchElement = searchElement;
unlGoogleSearch = new GoogleSearcher(searchElement, $('#unl_results'));
unlGoogleSearch.setSearchStartingCallback(queryStart);
unlGoogleSearch.setSearchCompleteCallback(queryComplete);
activeSearch = unlGoogleSearch;
if (localContext) {
var render_attrs_local = {
div: 'local_results',
tag: 'searchresults-only',
attributes: {
enableImageSearch: false,
as_sitesearch: localContext
}
}
google.search.cse.element.render(render_attrs_local);
var localSearchElement = google.search.cse.element.getAllElements()['searchresults-only1'];
window.localGoogleSearchElement = searchElement;
localGoogleSearch = new GoogleSearcher(localSearchElement, $('#local_results'));
localGoogleSearch.setSearchStartingCallback(queryStart);
localGoogleSearch.setSearchCompleteCallback(queryComplete);
activeSearch = localGoogleSearch;
}
// a11y patch Google search box
$('form.gsc-search-box').remove();
// setup the tab-like result filters
$('li:first-child', $resTabs).addClass(selCls);
$($resTabs).on('click', 'li', function(e) {
e.preventDefault();
var i = $(this).index(),
$par = $(this).parents(resSel);
if ($par.is(wrapperDir)) {
directorySearch.changeViewState(i);
} else if ($par.is(wrapperWeb)) {
searchToggleLock = true;
$(activeSearch.control.root).closest(googleSel).trigger(evtStateChange, [i, 0 + !i]);
if (i === 0) {
activeSearch = localGoogleSearch;
} else {
activeSearch = unlGoogleSearch;
}
activeSearch.execute(query);
}
});
$(resSel).on(evtStateChange, tabStateChange);
// listen for the submit event
$(formSel).submit(function(e) {
e.preventDefault();
var q = $.trim($q.val());
passiveQuery(q);
});
// issue an inital query
if (firstQ) {
passiveQuery(firstQ, false);
}
// listen for message from parent frames
$(window).on('message', function(e) {
var oEvent = e.originalEvent, q;
if (!isValidOrigin(oEvent.origin)) {
return;
}
// Chrome iOS issues a message on touch that is an object with
// oEvent.data.type = 'org.chromium.contextMenuMessage'.
// We will just ignore anything that isn't a string, which is what is
// expected from the parent window with wdntemplates's embedded search.
if (typeof oEvent.data !== 'string') {
return;
}
q = $.trim(oEvent.data);
passiveQuery(q);
});
$(window).on('popstate', function(e) {
var oEvent = e.originalEvent,
q = firstQ || '';
if (oEvent.state) {