added build notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-08 16:13:19 +03:00
parent 28708baf62
commit 150d8edcf0
6 changed files with 92 additions and 46 deletions

54
ui (gen4)/doc/BUILD-NOTES Executable file
View File

@ -0,0 +1,54 @@
Chromium flicker issue
----------------------
This appears to be GPU related.
package.json:
"chromium-args": "--disable-gpu-compositing",
This will fix the issue temporarily, but still need a better solution.
Remote debugging via DevTools
-----------------------------
Set this in package.json:
"chromium-args": "--remote-debugging-port=9222",
Then open http://localhost:9222 in chrome.
Sharp
-----
To build sharp for a specific version of node:
cd ./node_modules/sharp/
node-gyp --target=v5.7.0 rebuild # v5.7.0 is the version
# of node used in nw.js
Speedup loading of app
----------------------
One of the ways to speed up the load times when packed is to store Node's
modules ./node_modules in a speporate loaction, outside of the the app.zip
or package.nw
To enable require(..) to find them:
- > npm install --save app-module-path
- when building the zip move all the modules out to a new location
*except* app-module-path
- add this line to all root js modules *before* any other
require(..) is called:
if(process.__nwjs){
var path = require('path')
require('app-module-path')
.addPath(path.dirname(process.execPath)
+ '/node_modules/')
}

View File

@ -147,6 +147,8 @@ var AppControlActions = actions.Actions({
that.storeWindowGeometry() that.storeWindowGeometry()
}, 500) }, 500)
})], })],
// XXX add ability to use devtools on background page (node context)...
showDevTools: ['Interface|Development/Show Dev Tools', showDevTools: ['Interface|Development/Show Dev Tools',
function(){ function(){
nw.Window.get().showDevTools && nw.Window.get().showDevTools &&

View File

@ -171,11 +171,6 @@ var BrowserClassPrototype = {
.append($('<div>') .append($('<div>')
.addClass('v-block list')) .addClass('v-block list'))
// XXX make this part of the framework...
if(obj){
browser.data('widget-controller', obj)
}
return browser return browser
}, },
} }

View File

@ -31,11 +31,6 @@ var DrawerClassPrototype = {
overlay.attr('tabindex', 0) overlay.attr('tabindex', 0)
} }
// XXX make this part of the framework...
if(obj){
overlay.data('widget-controller', obj)
}
return overlay return overlay
}, },
} }
@ -80,8 +75,9 @@ var DrawerPrototype = {
if(handler == null){ if(handler == null){
var that = this var that = this
this.dom.animate({ this.dom.animate({
scrollTop: this.options.direction == 'bottom'? 0 scrollTop: this.options.direction == 'top'?
: this.dom.find('.content')[0].scrollHeight, this.dom.find('.content')[0].scrollHeight
: 0,
opacity: 0, opacity: 0,
filter: 'none', filter: 'none',
}, },
@ -120,24 +116,21 @@ var DrawerPrototype = {
that.close() that.close()
}) })
.css({ opacity: 0 }) .css({ opacity: 0 })
.scrollTop(options.direction == 'bottom' ? 0 .scrollTop(options.direction == 'top' ?
: options.direction == 'top' ?
dom.find('.content')[0].scrollHeight dom.find('.content')[0].scrollHeight
: 0) : 0)
.animate({ .animate({
scrollTop: scrollTop:
(options.direction == 'bottom' ? (options.direction == 'top' ?
Math.min( (dom.find('.content')[0].scrollHeight
- dom.outerHeight()
+ options['fade-at']) + 'px'
: Math.min(
client_dom.outerHeight(), client_dom.outerHeight(),
// do not scroll more than the container height and // do not scroll more than the container height and
// keep a bit on top... // keep a bit on top...
(parent.is('body') ? $(document) : parent) (parent.is('body') ? $(document) : parent)
.outerHeight()-options['fade-at']) + 'px' .outerHeight()-options['fade-at']) + 'px'),
: options.direction == 'top' ?
(dom.find('.content')[0].scrollHeight
- dom.outerHeight()
+ options['fade-at']) + 'px'
: 0),
opacity: 1, opacity: 1,
}, },
options['animate'], options['animate'],
@ -145,25 +138,8 @@ var DrawerPrototype = {
dom.scroll(function(){ dom.scroll(function(){
var st = $(this).scrollTop() var st = $(this).scrollTop()
// bottom drawer...
if(options.direction == 'bottom'){
var h = Math.min(options['fade-at'], client_dom.outerHeight())
// start fading...
if(st < h){
dom.css({ opacity: Math.min(1, st/h) })
} else if(dom.css('opacity') < 1){
dom.css('opacity', 1)
}
// close drawer when scrolling to the top...
if(st < options['close-at']){
that.close()
}
// top drawer... // top drawer...
} else if(options.direction == 'top'){ if(options.direction == 'top'){
var h = dom.find('.content')[0].scrollHeight var h = dom.find('.content')[0].scrollHeight
// start fading... // start fading...
@ -178,6 +154,23 @@ var DrawerPrototype = {
if(st > h - options['close-at']){ if(st > h - options['close-at']){
that.close() that.close()
} }
// bottom drawer...
} else if(options.direction == 'bottom'){
var h = Math.min(options['fade-at'], client_dom.outerHeight())
// start fading...
if(st < h){
dom.css({ opacity: Math.min(1, st/h) })
} else if(dom.css('opacity') < 1){
dom.css('opacity', 1)
}
// close drawer when scrolling to the top...
if(st < options['close-at']){
that.close()
}
} }
}) })
}) })

View File

@ -42,11 +42,6 @@ var OverlayClassPrototype = {
overlay.attr('tabindex', 0) overlay.attr('tabindex', 0)
} }
// XXX make this part of the framework...
if(obj){
overlay.data('widget-controller', obj)
}
return overlay return overlay
}, },
} }

View File

@ -59,6 +59,7 @@ var WidgetClassPrototype = {
var WidgetPrototype = { var WidgetPrototype = {
// NOTE: this must have .data('widget-controller', this) set...
dom: null, dom: null,
client: null, client: null,
@ -105,6 +106,8 @@ var WidgetPrototype = {
// build the dom... // build the dom...
if(this.constructor.make){ if(this.constructor.make){
this.dom = this.constructor.make(this, options) this.dom = this.constructor.make(this, options)
this.dom.data('widget-controller', this)
} }
// XXX do we do this here??? // XXX do we do this here???
@ -148,6 +151,8 @@ var ContainerClassPrototype = {
var ContainerPrototype = { var ContainerPrototype = {
// NOTE: this must have .data('widget-controller', this) set...
dom: null,
focus: function(handler){ focus: function(handler){
if(handler != null){ if(handler != null){
@ -181,6 +186,8 @@ var ContainerPrototype = {
if(this.constructor.make){ if(this.constructor.make){
this.dom = this.constructor this.dom = this.constructor
.make(this, client.dom || client, options) .make(this, client.dom || client, options)
this.dom.data('widget-controller', this)
} }
// add keyboard handler... // add keyboard handler...