mirror of
https://github.com/wassname/talk.git
synced 2026-07-08 02:58:03 +08:00
Merge branch 'master' into moderation-refactor
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Get the auth element and parse it as JSON by decoding it.
|
||||
const auth = document.getElementById('auth');
|
||||
const doc = document.implementation.createHTMLDocument('');
|
||||
doc.body.innerHTML = auth.innerText;
|
||||
|
||||
// Set the item in localStorage.
|
||||
localStorage.setItem('auth', doc.body.textContent);
|
||||
|
||||
// Close the window.
|
||||
setTimeout(() => {
|
||||
window.close();
|
||||
}, 50);
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
function showError(error) {
|
||||
try {
|
||||
let err = JSON.parse(error);
|
||||
$('.error-console').text(err.message).addClass('active');
|
||||
} catch (err) {
|
||||
$('.error-console').text(error).addClass('active');
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
localStorage.setItem('auth', document.getElementById('auth').innerText);
|
||||
setTimeout(function() { window.close(); }, 50);
|
||||
});
|
||||
@@ -20,9 +20,17 @@
|
||||
</form>
|
||||
</div>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script src="/public/javascripts/admin.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
function showError(error) {
|
||||
try {
|
||||
let err = JSON.parse(error);
|
||||
$('.error-console').text(err.message).addClass('active');
|
||||
} catch (err) {
|
||||
$('.error-console').text(error).addClass('active');
|
||||
}
|
||||
}
|
||||
|
||||
function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
$('.error-console').removeClass('active');
|
||||
|
||||
@@ -30,9 +30,17 @@
|
||||
</form>
|
||||
</div>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script src="/public/javascripts/admin.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
function showError(error) {
|
||||
try {
|
||||
let err = JSON.parse(error);
|
||||
$('.error-console').text(err.message).addClass('active');
|
||||
} catch (err) {
|
||||
$('.error-console').text(error).addClass('active');
|
||||
}
|
||||
}
|
||||
|
||||
function handleSubmit (e) {
|
||||
e.preventDefault();
|
||||
$('.error-console').removeClass('active');
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<html>
|
||||
<body>
|
||||
<script type="application/json" id="auth"><%- encodeJSONForHTML(auth) %></script>
|
||||
<script type="text/javascript" src="<%= STATIC_URL %>public/javascripts/auth-callback.js"></script>
|
||||
<script type="text/javascript" src="<%= STATIC_URL %>static/coral-auth-callback/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+26
-8
@@ -19,7 +19,11 @@ const targetPlugins = manager.section('targets').plugins;
|
||||
|
||||
debug(`Using ${pluginsPath} as the plugin configuration path`);
|
||||
|
||||
const buildTargets = ['coral-admin', 'coral-docs'];
|
||||
const buildTargets = [
|
||||
'coral-admin',
|
||||
'coral-docs',
|
||||
{ name: 'coral-auth-callback', disablePolyfill: true },
|
||||
];
|
||||
|
||||
const buildEmbeds = ['stream'];
|
||||
|
||||
@@ -156,9 +160,14 @@ const config = {
|
||||
modules: [
|
||||
path.resolve(__dirname, 'plugins'),
|
||||
path.resolve(__dirname, 'client'),
|
||||
...buildTargets.map(target =>
|
||||
path.join(__dirname, 'client', target, 'src')
|
||||
),
|
||||
...buildTargets.map(target => {
|
||||
if (typeof target !== 'string') {
|
||||
target = target.name;
|
||||
}
|
||||
|
||||
return path.join(__dirname, 'client', target, 'src');
|
||||
}),
|
||||
|
||||
...buildEmbeds.map(embed =>
|
||||
path.join(__dirname, 'client', `coral-embed-${embed}`, 'src')
|
||||
),
|
||||
@@ -276,10 +285,19 @@ module.exports = [
|
||||
// All framework targets/embeds/plugins.
|
||||
applyConfig([
|
||||
// Load in all the targets.
|
||||
...buildTargets.map(target => ({
|
||||
name: `${target}/bundle`,
|
||||
path: path.join(__dirname, 'client/', target, '/src/index'),
|
||||
})),
|
||||
...buildTargets.map(target => {
|
||||
let disablePolyfill = false;
|
||||
if (typeof target !== 'string') {
|
||||
disablePolyfill = target.disablePolyfill;
|
||||
target = target.name;
|
||||
}
|
||||
|
||||
return {
|
||||
name: `${target}/bundle`,
|
||||
path: path.join(__dirname, 'client/', target, '/src/index'),
|
||||
disablePolyfill,
|
||||
};
|
||||
}),
|
||||
|
||||
// Load in all the embeds.
|
||||
...buildEmbeds.map(embed => ({
|
||||
|
||||
Reference in New Issue
Block a user