Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = (src, dest, preview) => () => {
.reduce((accum, { file: depPath, type }) => (type === 'dependency' ? accum.concat(depPath) : accum), [])
.map((importedPath) => fs.stat(importedPath).then(({ mtime }) => mtime))
).then((mtimes) => {
const newestMtime = mtimes.reduce((max, curr) =>
const newestMtime = mtimes.reduce((max, curr) =>
(!max || curr > max ? curr : max), 0)
if (newestMtime > file.stat.mtime) file.stat.mtimeMs = +(file.stat.mtime = newestMtime)
}),
Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = (src, dest, preview) => () => {
// NOTE concat already uses stat from newest combined file
.pipe(concat('js/site.js')),
vfs
.src('js/vendor/*.js', { ...opts, read: false })
.src('js/vendor/+([^.])?(.bundle).js', { ...opts, read: false })
.pipe(
// see https://gulpjs.org/recipes/browserify-multiple-destination.html
map((file, enc, next) => {
Expand Down Expand Up @@ -92,6 +92,9 @@ module.exports = (src, dest, preview) => () => {
)
.pipe(buffer())
.pipe(uglify({ output: { comments: /^!/ } })),
vfs
.src('js/vendor/*.min.js', opts)
.pipe(map((file, enc, next) => next(null, Object.assign(file, { extname: '' }, { extname: '.js' })))),
vfs.src(require.resolve('jquery/dist/jquery.min.js'), opts).pipe(concat('js/vendor/jquery.js')),
vfs
.src(['css/site.css', 'css/vendor/docsearch.css'], { ...opts, sourcemaps })
Expand Down
5 changes: 2 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const task = require('./gulp.d/tasks')
const glob = {
all: [srcDir, previewSrcDir],
css: `${srcDir}/css/**/*.css`,
js: ['gulpfile.js', 'gulp.d/**/*.js', `${srcDir}/{helpers,js}/**/*.js`],
js: ['gulpfile.js', 'gulp.d/**/*.js', `${srcDir}/helpers/**/*.js`, `${srcDir}/js/**/+([^.])?(.bundle).js`],
}

const cleanTask = createTask({
Expand Down Expand Up @@ -66,8 +66,7 @@ const buildTask = createTask({

const bundleBuildTask = createTask({
name: 'bundle:build',
// call: series(cleanTask, lintTask, buildTask),
call: series(cleanTask, buildTask),
call: series(cleanTask, lintTask, buildTask),
})

const bundlePackTask = createTask({
Expand Down
28 changes: 9 additions & 19 deletions src/css/chatbot.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.lex-web-ui-iframe {
bottom: 1.5rem;
display: none; /* hidden by default changed once iframe is loaded */
margin-bottom: 0px;
margin-bottom: 0;
margin-left: 2px;
margin-right: 3vw;
margin-top: 2px;
Expand All @@ -15,6 +15,9 @@

.lex-web-ui-iframe iframe {
border-radius: 8px 8px 10px 10px;
overflow: hidden;
width: 100%;
height: 100%;
}

.lex-web-ui-iframe--show {
Expand All @@ -34,30 +37,26 @@
min-width: calc(55vw - 3vw) !important;
}


/* disable box shadow when minimized */
.lex-web-ui-iframe.lex-web-ui-iframe--minimize iframe {
box-shadow: none;
border-radius: none;
}

/* hide on very small resolutions */
@media only screen and (max-width: 240px),
only screen and (max-height: 256px)
{
@media only screen and (max-width: 240px), only screen and (max-height: 256px) {
.lex-web-ui-iframe {
display: none!important;
display: none !important;
}

.lex-web-ui-iframe--minimize {
max-width: 300px !important;
max-height: 185px !important;
}
}

/* take most space on small resolutions (smart phones) */
@media only screen
and (min-width: 241px)
and (max-width: 480px) {
@media only screen and (min-width: 241px) and (max-width: 480px) {
.lex-web-ui-iframe {
min-width: 85vw !important;
height: 84vh;
Expand All @@ -70,13 +69,10 @@ and (max-width: 480px) {
height: 90vh; /* dynamically changed on iframe maximize/minimize */
min-width: 96vw !important;
}

}

/* adjust down on medium resolutions */
@media only screen
and (min-width: 481px)
and (max-width: 960px) {
@media only screen and (min-width: 481px) and (max-width: 960px) {
.lex-web-ui-iframe {
max-width: 55vw;
height: 80vh; /* dynamically changed on iframe maximize/minimize */
Expand All @@ -96,9 +92,3 @@ and (max-width: 960px) {
min-width: 230px !important;
}
}

.lex-web-ui-iframe iframe {
overflow: hidden;
width: 100%;
height: 100%;
}
3 changes: 1 addition & 2 deletions src/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@
@import "table.css";
@import "tabs.css";
@import "terminal.css";

@import "chatbot.css";
@import "chatbot.css";
2 changes: 1 addition & 1 deletion src/js/06-page-rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
// })

$.ajax({
'url': 'https://couchbasecommunity.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/tod1zk/b/4/b0105d975e9e59f24a3230a22972a71a/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-GB&collectorId=a3b807e8',
'url': 'https://couchbasecommunity.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/tod1zk/b/4/b0105d975e9e59f24a3230a22972a71a/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-GB&collectorId=a3b807e8', // eslint-disable-line max-len
'type': 'get',
'cache': true,
'dataType': 'script',
Expand Down
45 changes: 45 additions & 0 deletions src/js/12-chatbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
;(function () {
var iframeLoader = new window.ChatBotUiLoader.IframeLoader()

var chatbotUiconfig = {
ui: {
parentOrigin: 'https://preview.docs-test.couchbase.com',
toolbarTitle: 'Couchbase',
toolbarLogo: 'https://www.couchbase.com/wp-content/uploads/sites/3/2023/10/SDKs_Ottoman.svg',
positiveFeedbackIntent: 'Thumbs up',
negativeFeedbackIntent: 'Thumbs down',
helpIntent: 'Help',
enableLogin: false,
forceLogin: false,
AllowSuperDangerousHTMLInMessage: true,
shouldDisplayResponseCardTitle: false,
saveHistory: false,
minButtonContent: '',
hideInputFieldsForButtonResponse: false,
pushInitialTextOnRestart: false,
directFocusToBotInput: false,
showDialogStateIcon: false,
backButton: false,
messageMenu: true,
hideButtonMessageBubble: false,
enableLiveChat: false,
},
iframe: {
iframeOrigin: 'https://d2sozpdiqok6m4.cloudfront.net',
shouldLoadIframeMinimized: true,
iframeSrcPath: '/#/?lexWebUiEmbed=true',
},
}

// load the iframe
iframeLoader
.load(chatbotUiconfig)
.then(function () {
iframeLoader.api.ping()
// perform actions on the parent dependent on the chatbot loading.
document.getElementById('send-intent').setAttribute('disabled', false)
})
.catch(function (error) {
console.error('chatbot UI failed to load', error)
})
})()
45 changes: 0 additions & 45 deletions src/js/13-chatbot.js

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion src/js/vendor/docsearch.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@
return {
name: hit.component,
version: hit.cversion,
title: hit.component_title }
title: hit.component_title,
}
}

function renderFilters (components, filters) {
Expand Down
6 changes: 2 additions & 4 deletions src/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<template id="run-code-panel">
{{> terminal}}
</template>

<script id="site-script" src="{{{uiRootPath}}}/js/vendor/chatbox-ui.js"></script>
<script id="site-script" src="{{{uiRootPath}}}/js/site.js"></script>
<script async src="{{{uiRootPath}}}/js/vendor/tabs.js" data-sync-storage-key="preferred-tab"></script>
{{#with page.attributes.content-scripts}}
Expand Down Expand Up @@ -47,7 +47,5 @@ MathJax.Hub.Register.StartupHook("AsciiMath Jax Ready", function () {
<script async src="{{{uiRootPath}}}/js/vendor/mark.js"></script>
{{/if}}
{{#if (eq env.SHOW_FEEDBACK_BUTTON 'true')}}
<script async id="feedback-script" src="{{{uiRootPath}}}/js/vendor/feedback.js?v=1"
data-collector-id="{{#if env.JIRA_COLLECTOR_ID}}{{env.JIRA_COLLECTOR_ID}}{{else}}709818cb{{/if}}"></script>
<script async id="feedback-script" src="{{{uiRootPath}}}/js/vendor/feedback.js?v=1" data-collector-id="{{#if env.JIRA_COLLECTOR_ID}}{{env.JIRA_COLLECTOR_ID}}{{else}}709818cb{{/if}}"></script>
{{/if}}