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
Bal Feng
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
42 deletions
+186
-42
actions.js
packages/actions.js
+12
-2
manifest.json
packages/codes/manifest.json
+42
-40
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
[
{
"package.json"
,
"regulars"
:
[
"yarn.lock"
,
"package.json"
,
"config/fonts.json"
,
"yarn.lock"
,
"Procfile"
,
"config/fonts.json"
,
"fe/js/App.es6"
,
"Procfile"
,
"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"
,
"fe/js/components/page_settings_dialog/NewDomainsTab.es6"
,
"fe/js/components/page_settings_dialog/NewDomainsTab.es6"
,
"fe/js/EcommerceManager.es6"
,
"fe/js/EcommerceManager.es6"
,
"fe/js/editor.es6"
,
"fe/js/editor.es6"
,
"fe/js/Landing.es6"
,
"fe/js/Landing.es6"
,
"fe/js/MainDashboard.es6"
,
"fe/js/MainDashboard.es6"
,
"fe/js/page.client.es6"
,
"fe/js/page.client.es6"
,
"fe/js/PortfolioManager.es6"
,
"fe/js/PortfolioManager.es6"
,
"fe/js/stores/font_store.es6"
,
"fe/js/stores/font_store.es6"
,
"fe/js/utils/helpers/EcommerceHelper.es6"
,
"fe/js/utils/helpers/EcommerceHelper.es6"
,
"fe/js/v3_bridge/page_analytics_engine.es6"
,
"fe/js/v3_bridge/page_analytics_engine.es6"
,
"fe/js/v4_bridge/Bridge.es6"
,
"fe/js/v4_bridge/Bridge.es6"
,
"fe/lib/webpack/entries-generation-webpack-plugin.js"
,
"fe/lib/webpack/entries-generation-webpack-plugin.js"
,
"fe/manifests/verticals/app.js"
,
"fe/manifests/verticals/app.js"
,
"fe/manifests/verticals/bright.js"
,
"fe/manifests/verticals/bright.js"
,
"fe/manifests/verticals/fresh.js"
,
"fe/manifests/verticals/fresh.js"
,
"fe/manifests/verticals/glow.js"
,
"fe/manifests/verticals/glow.js"
,
"fe/manifests/verticals/ion.js"
,
"fe/manifests/verticals/ion.js"
,
"fe/manifests/verticals/minimal.js"
,
"fe/manifests/verticals/minimal.js"
,
"fe/manifests/verticals/onyx_new.js"
,
"fe/manifests/verticals/onyx_new.js"
,
"fe/manifests/verticals/persona.js"
,
"fe/manifests/verticals/persona.js"
,
"fe/manifests/verticals/personal.js"
,
"fe/manifests/verticals/personal.js"
,
"fe/manifests/verticals/perspective.js"
,
"fe/manifests/verticals/perspective.js"
,
"fe/manifests/verticals/pitch_new.js"
,
"fe/manifests/verticals/pitch_new.js"
,
"fe/manifests/verticals/profile.js"
,
"fe/manifests/verticals/profile.js"
,
"fe/manifests/verticals/s5-theme.js"
,
"fe/manifests/verticals/s5-theme.js"
,
"fe/manifests/verticals/sleek.js"
,
"fe/manifests/verticals/sleek.js"
,
"fe/manifests/verticals/spectre.js"
,
"fe/manifests/verticals/spectre.js"
,
"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