Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wildcat
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jason Zhou
wildcat
Commits
54c566d2
Commit
54c566d2
authored
Jul 31, 2018
by
Jason Zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix app App issue
parent
8a5fbded
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
5 deletions
+149
-5
actions.js
packages/actions.js
+12
-2
manifest.json
packages/codes/manifest.json
+5
-3
App.es6
packages/codes/new/exceptions/App.es6
+66
-0
App.es6
packages/codes/old/exceptions/App.es6
+66
-0
No files found.
packages/actions.js
View file @
54c566d2
...
@@ -15,11 +15,16 @@ handlebars.registerHelper('if_eq', function(a, b, opts) {
...
@@ -15,11 +15,16 @@ handlebars.registerHelper('if_eq', function(a, b, opts) {
const
restoreLegacyCodes
=
()
=>
{
const
restoreLegacyCodes
=
()
=>
{
log
.
title
(
'📤 Restore previous codes'
)
log
.
title
(
'📤 Restore previous codes'
)
LEGACY_CODES
.
forEach
(
file
=>
{
LEGACY_CODES
.
regulars
.
forEach
(
file
=>
{
log
.
item
(
`Restoring
${
file
}
...`
)
log
.
item
(
`Restoring
${
file
}
...`
)
const
basename
=
path
.
basename
(
file
)
const
basename
=
path
.
basename
(
file
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/old/
${
basename
}
`
,
file
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/old/
${
basename
}
`
,
file
)
})
})
LEGACY_CODES
.
exceptions
.
forEach
(
file
=>
{
log
.
item
(
`Restoring
${
file
}
...`
)
const
basename
=
path
.
basename
(
file
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/old/exceptions/
${
basename
}
`
,
file
)
})
}
}
const
updateConfigs
=
(
mode
=
'chill'
)
=>
{
const
updateConfigs
=
(
mode
=
'chill'
)
=>
{
...
@@ -45,11 +50,16 @@ const restoreConfigs = () => {
...
@@ -45,11 +50,16 @@ const restoreConfigs = () => {
}
}
const
updateCodes
=
()
=>
{
const
updateCodes
=
()
=>
{
LEGACY_CODES
.
forEach
(
file
=>
{
LEGACY_CODES
.
regulars
.
forEach
(
file
=>
{
const
basename
=
path
.
basename
(
file
)
const
basename
=
path
.
basename
(
file
)
log
.
item
(
`Updating
${
basename
}
...`
)
log
.
item
(
`Updating
${
basename
}
...`
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/new/
${
basename
}
`
,
file
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/new/
${
basename
}
`
,
file
)
})
})
LEGACY_CODES
.
exceptions
.
forEach
(
file
=>
{
const
basename
=
path
.
basename
(
file
)
log
.
item
(
`Updating
${
basename
}
...`
)
fs
.
copyFileSync
(
`
${
__dirname
}
/codes/new/exceptions/
${
basename
}
`
,
file
)
})
}
}
const
updatePackages
=
()
=>
{
const
updatePackages
=
()
=>
{
...
...
packages/codes/manifest.json
View file @
54c566d2
[
{
"regulars"
:
[
"package.json"
,
"package.json"
,
"yarn.lock"
,
"yarn.lock"
,
"config/fonts.json"
,
"config/fonts.json"
,
"Procfile"
,
"Procfile"
,
"fe/js/App.es6"
,
"fe/js/blog.client.es6"
,
"fe/js/blog.client.es6"
,
"fe/js/BlogEditor.es6"
,
"fe/js/BlogEditor.es6"
,
"fe/js/components/HtmlComponent.es6"
,
"fe/js/components/HtmlComponent.es6"
,
...
@@ -37,4 +37,6 @@
...
@@ -37,4 +37,6 @@
"fe/manifests/verticals/zine.js"
,
"fe/manifests/verticals/zine.js"
,
"fe/nextgen/app.es6"
,
"fe/nextgen/app.es6"
,
"fe/scripts/fonts/generateFontsJson.js"
"fe/scripts/fonts/generateFontsJson.js"
]
],
"exceptions"
:
[
"fe/js/App.es6"
]
}
packages/codes/new/exceptions/App.es6
0 → 100644
View file @
54c566d2
require('./init')
// This component will be the entry point for our entire app based on new architecture design from
// this document: https://striking.quip.com/gazxA3ZruIrs
// It curently only includes very limited functionality, but the goal is to gradually move everything
// to be bootstrap from here
import $ from 'jquery'
import EditorStore from 'js/stores/editor_store'
import EditPage from 'js/v3_bridge/edit_page_bridge'
import * as i18nHelper from 'js/utils/helpers/i18nHelper'
import 'js/vendor/jquery/jquery.ba-hashchange.min'
// HACK: setup event object (v3 legacy, only a fix for old code)
// v3 code still relay on event to communicate with iframes
let Event = null
window.edit_page = EditPage
if (parent.window.edit_page && parent.window.edit_page.Event) {
Event = parent.window.edit_page.Event
EditPage.Event = Event
} else {
Event = EditPage.Event
if (parent.window.edit_page) {
parent.window.edit_page.Event = Event
} else {
parent.window.edit_page = {
Event
}
}
}
const p1 = import(`locales/${i18nHelper.getTranslationFile()}`)
Promise.all([p1])
.then(([poFile]) => {
const I18n = require('js/utils/i18n')
I18n.init(poFile)
$(() => {
const cloudinary = require('cloudinary')
const ConfStore = require('js/stores/conf_store')
cloudinary.config('cloud_name', ConfStore.getCloudinaryCloudName())
const ctx = EditorStore.init()
const ReactAppManager = require('js/v4_bridge/react_app_bridge/ReactAppManager')
ReactAppManager.init(ctx)
// TODO: use react router
$(window).hashchange(() => {
const appName = document.location.hash.replace('#', '')
if (appName !== '') {
ReactAppManager.loadApp(appName)
}
})
$(window).hashchange()
})
})
.catch(e => console.error(e))
if (module.hot) {
module.hot.accept(err => {
if (err) {
console.error(err)
}
})
}
packages/codes/old/exceptions/App.es6
0 → 100644
View file @
54c566d2
require('./init')
// This component will be the entry point for our entire app based on new architecture design from
// this document: https://striking.quip.com/gazxA3ZruIrs
// It curently only includes very limited functionality, but the goal is to gradually move everything
// to be bootstrap from here
import $ from 'jquery'
import EditorStore from 'js/stores/editor_store'
import EditPage from 'js/v3_bridge/edit_page_bridge'
import * as i18nHelper from 'js/utils/helpers/i18nHelper'
import 'js/vendor/jquery/jquery.ba-hashchange.min'
// HACK: setup event object (v3 legacy, only a fix for old code)
// v3 code still relay on event to communicate with iframes
let Event = null
window.edit_page = EditPage
if (parent.window.edit_page && parent.window.edit_page.Event) {
Event = parent.window.edit_page.Event
EditPage.Event = Event
} else {
Event = EditPage.Event
if (parent.window.edit_page) {
parent.window.edit_page.Event = Event
} else {
parent.window.edit_page = {
Event,
}
}
}
const p1 = require(`promise-loader?global!locales/${i18nHelper.getTranslationFile()}`)
Promise.all([p1()])
.then(([poFile]) => {
const I18n = require('js/utils/i18n')
I18n.init(poFile)
$(() => {
const cloudinary = require('cloudinary')
const ConfStore = require('js/stores/conf_store')
cloudinary.config('cloud_name', ConfStore.getCloudinaryCloudName())
const ctx = EditorStore.init()
const ReactAppManager = require('js/v4_bridge/react_app_bridge/ReactAppManager')
ReactAppManager.init(ctx)
// TODO: use react router
$(window).hashchange(() => {
const appName = document.location.hash.replace('#', '')
if (appName !== '') {
ReactAppManager.loadApp(appName)
}
})
$(window).hashchange()
})
})
.catch(e => console.error(e))
if (module.hot) {
module.hot.accept(err => {
if (err) {
console.error(err)
}
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment