Browse Source

sachen

pull/943/head
phischdev 8 years ago
parent
commit
cc038c53e2
  1. 70
      .sencha/app/Boot.js
  2. 13
      .sencha/app/Microloader.js
  3. 27
      .sencha/app/build-impl.xml
  4. 6
      .sencha/app/init-impl.xml
  5. 10
      .sencha/app/page-impl.xml
  6. 1
      .sencha/app/refresh-impl.xml
  7. 59
      .sencha/app/sass-impl.xml
  8. 2
      .sencha/app/sencha.cfg
  9. 1
      .sencha/app/slice-impl.xml
  10. 8
      app/Application.js
  11. 6
      app/view/main/MainController.js
  12. 2
      electron/tray.js
  13. 7
      package.json
  14. 2
      test/tests/app/example.spec.js

70
.sencha/app/Boot.js

@ -537,9 +537,27 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
init: function () { init: function () {
var scriptEls = doc.getElementsByTagName('script'), var scriptEls = doc.getElementsByTagName('script'),
script = scriptEls[0],
len = scriptEls.length, len = scriptEls.length,
re = /\/ext(\-[a-z\-]+)?\.js$/, re = /\/ext(\-[a-z\-]+)?\.js$/,
entry, script, src, state, baseUrl, key, n, origin; entry, src, state, baseUrl, key, n, origin;
// No check for script definedness because there always should be at least one
Boot.hasReadyState = ("readyState" in script);
Boot.hasAsync = ("async" in script);
Boot.hasDefer = ("defer" in script);
Boot.hasOnLoad = ("onload" in script);
// Feature detecting IE
Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
Boot.isIE10 = (new Function('/*@cc_on return @_jscript_version @*/')()) === 10;
Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
// IE11 does not support conditional compilation so we detect it by exclusion
Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
// Since we are loading after other scripts, and we needed to gather them // Since we are loading after other scripts, and we needed to gather them
// anyway, we track them in _scripts so we don't have to ask for them all // anyway, we track them in _scripts so we don't have to ask for them all
@ -552,13 +570,9 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
state = script.readyState || null; state = script.readyState || null;
// If we find a script file called "ext-*.js", then the base path is that file's base path. // If we find a script file called "ext-*.js", then the base path is that file's base path.
if (!baseUrl) { if (!baseUrl && re.test(src)) {
if (re.test(src)) {
Boot.hasReadyState = ("readyState" in script);
Boot.hasAsync = ("async" in script) || !Boot.hasReadyState;
baseUrl = src; baseUrl = src;
} }
}
if (!Boot.scripts[key = Boot.canonicalUrl(src)]) { if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
//<debug> //<debug>
@ -578,8 +592,6 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
if (!baseUrl) { if (!baseUrl) {
script = scriptEls[scriptEls.length - 1]; script = scriptEls[scriptEls.length - 1];
baseUrl = script.src; baseUrl = script.src;
Boot.hasReadyState = ('readyState' in script);
Boot.hasAsync = ("async" in script) || !Boot.hasReadyState;
} }
Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1); Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
@ -1394,27 +1406,36 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
createLoadElement: function(callback) { createLoadElement: function(callback) {
var me = this, var me = this,
el = me.getElement(), el = me.getElement();
readyStateChange = function(){
if (this.readyState === 'loaded' || this.readyState === 'complete') { me.preserve = true;
el.onerror = function() {
me.error = true;
if (callback) { if (callback) {
callback(); callback();
callback = null;
} }
} };
},
errorFn = function() { if (Boot.isIE10m) {
me.error = true; el.onreadystatechange = function() {
if (this.readyState === 'loaded' || this.readyState === 'complete') {
if (callback) { if (callback) {
callback(); callback();
callback = this.onreadystatechange = this.onerror = null;
}
} }
}; };
me.preserve = true;
el.onerror = errorFn;
if(Boot.hasReadyState) {
el.onreadystatechange = readyStateChange;
} else {
el.onload = callback;
} }
else {
el.onload = function() {
callback();
callback = this.onload = this.onerror = null;
};
}
// IE starts loading here // IE starts loading here
el[me.prop] = me.getLoadUrl(); el[me.prop] = me.getLoadUrl();
}, },
@ -1541,8 +1562,11 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
// for async modes, we have some options // for async modes, we have some options
if (!sync) { if (!sync) {
// if cross domain, just inject the script tag and let the onload // if cross domain, just inject the script tag and let the onload
// events drive the progression // events drive the progression.
if(me.isCrossDomain()) { // IE10 also needs sequential loading because of a bug that makes it
// fire readystate event prematurely:
// https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
if (Boot.isIE10 || me.isCrossDomain()) {
return me.loadCrossDomain(); return me.loadCrossDomain();
} }
// for IE, use the readyStateChange allows us to load scripts in parallel // for IE, use the readyStateChange allows us to load scripts in parallel

13
.sencha/app/Microloader.js

@ -51,15 +51,24 @@ Ext.Microloader = Ext.Microloader || (function () {
? manifest ? manifest
: manifest + ".json"; : manifest + ".json";
if (location.href.indexOf('file:/') === 0) {
Boot.load(url + 'p');
}
else {
Boot.fetch(url, function(result){ Boot.fetch(url, function(result){
manifest = Ext.manifest = JSON.parse(result.content); Microloader.setManifest(JSON.parse(result.content));
Microloader.load(manifest);
}); });
}
} else { } else {
Microloader.load(manifest); Microloader.load(manifest);
} }
}, },
setManifest: function(cfg) {
manifest = Ext.manifest = cfg;
Microloader.load(manifest);
},
/** /**
* *
* @param manifestDef * @param manifestDef

27
.sencha/app/build-impl.xml

@ -463,6 +463,33 @@ this file in most cases.
depends="init,-before-publish,-publish,-after-publish" depends="init,-before-publish,-publish,-after-publish"
description="Publish app to Sencha Web Application Manager"/> description="Publish app to Sencha Web Application Manager"/>
<!--
===============================================================
Build Dependencies
uses the compiler to build metadata files for all detected
file-to-file dependencies
===============================================================
-->
<target name="build-dependencies" depends="init, -detect-app-build-properties">
<x-compile refid="${compiler.ref.id}">
<![CDATA[
restore
page
and
meta
-infoType=Dependencies
-basePath=${build.dir}
-tpl={0}
-out=${build.dir}/dependencies.json
and
meta
-infoType=AppManifest
-basePath=${build.dir}
-tpl={0}
-out=${build.dir}/bootsequence.json
]]>
</x-compile>
</target>
<!-- <!--
=============================================================== ===============================================================

6
.sencha/app/init-impl.xml

@ -144,6 +144,8 @@
<property name="app.sass.fashion" value="false"/> <property name="app.sass.fashion" value="false"/>
<property name="app.sass.rhino" value="false"/> <property name="app.sass.rhino" value="false"/>
<property name="app.sass.dynamic" value="false"/> <property name="app.sass.dynamic" value="false"/>
<property name="app.sass.generated.var" value="${app.sass.save}"/>
</target> </target>
<target name="-after-init"/> <target name="-after-init"/>
@ -403,7 +405,9 @@
defaultSassFile="${app.out.scss}" defaultSassFile="${app.out.scss}"
defaultCssFile="${app.out.css}" defaultCssFile="${app.out.css}"
refid="app.web.server" refid="app.web.server"
saveVariablesProp="app.sass.save" saveVariablesProp="app.sass.generated.var"
uiDirProp="app.sass.generated.src"
sassNamespaceProp="app.sass.namespace"
j2eeMode="${use.webxml}"> j2eeMode="${use.webxml}">
<mapping name="~cmd" path="${cmd.dir}"/> <mapping name="~cmd" path="${cmd.dir}"/>
<mapping name="" path="${build.web.root}"/> <mapping name="" path="${build.web.root}"/>

10
.sencha/app/page-impl.xml

@ -2,6 +2,11 @@
<macrodef name="x-build-microload-markup"> <macrodef name="x-build-microload-markup">
<sequential> <sequential>
<if>
<not>
<equals arg1="${build.compression}" arg2=""/>
</not>
<then>
<x-sencha-command dir="${app.dir}" inheritall="true"> <x-sencha-command dir="${app.dir}" inheritall="true">
<![CDATA[ <![CDATA[
fs fs
@ -11,6 +16,8 @@
-to=${build.microloader.path} -to=${build.microloader.path}
]]> ]]>
</x-sencha-command> </x-sencha-command>
</then>
</if>
<if> <if>
<x-is-true value="${build.enable.embedded.microloader}"/> <x-is-true value="${build.enable.embedded.microloader}"/>
<then> <then>
@ -55,6 +62,7 @@
# generate json file # generate json file
microload microload
-operation=manifest -operation=manifest
-jsonp=Ext.Microloader.setManifest
-fashion=${use.fashion} -fashion=${use.fashion}
-tpl=${build.microloader.json.tpl.embedded} -tpl=${build.microloader.json.tpl.embedded}
-out=${build.microloader.path} -out=${build.microloader.path}
@ -77,6 +85,7 @@
# generate json file # generate json file
microload microload
-operation=manifest -operation=manifest
-jsonp=Ext.Microloader.setManifest
-fashion=${use.fashion} -fashion=${use.fashion}
-tpl=${build.microloader.json.tpl.standalone} -tpl=${build.microloader.json.tpl.standalone}
-out=${build.out.json.path} -out=${build.out.json.path}
@ -85,6 +94,7 @@
and and
microload microload
-operation=manifest -operation=manifest
-jsonp=Ext.Microloader.setManifest
-fashion=${use.fashion} -fashion=${use.fashion}
-tpl=${build.microloader.json.tpl.external} -tpl=${build.microloader.json.tpl.external}
-out=${build.microloader.path} -out=${build.microloader.path}

1
.sencha/app/refresh-impl.xml

@ -78,6 +78,7 @@ Ext.manifest = Ext.manifest || "${build.json.bootstrap.rel.path}";
and and
microload microload
-operation=manifest -operation=manifest
-jsonp=Ext.Microloader.setManifest
-fashion=${use.fashion} -fashion=${use.fashion}
-bootstrap -bootstrap
+ignoreDisabled +ignoreDisabled

59
.sencha/app/sass-impl.xml

@ -209,17 +209,74 @@
compress="${build.css.compress}" compress="${build.css.compress}"
compilerRefId="${compiler.ref.id}"/> compilerRefId="${compiler.ref.id}"/>
<x-compile refid="${compiler.ref.id}">
<![CDATA[
microload
-operation=manifest
-fashion=false
-tpl=${build.microloader.json.tpl.standalone}
-out=${build.out.json.path}
-resourcePath=${build.out.base.path}
-basePath=${build.out.metadata.dir}
]]>
</x-compile>
<x-sencha-command> <x-sencha-command>
fashion fashion
-config=${build.out.json.path}
-compress=${build.css.compress} -compress=${build.css.compress}
-split=${build.css.selector.limit} -split=${build.css.selector.limit}
-saveFile=${app.dir}/${app.sass.save} -saveFile=${app.dir}/${app.sass.generated.var}
${app.out.scss} ${app.out.scss}
${app.out.css} ${app.out.css}
</x-sencha-command> </x-sencha-command>
<x-update-css-array input="${app.out.css}" <x-update-css-array input="${app.out.css}"
compilerRefId="${compiler.ref.id}"/> compilerRefId="${compiler.ref.id}"/>
<if>
<and>
<available file="${build.out.css.dir}/css-vars.js"/>
</and>
<then>
<x-sencha-command>
<![CDATA[
fs
concat
-to=${build.out.css.dir}/css-vars.js.tmp
${cmd.dir}/extensions/sencha-fashion/fashion/fashion-export-min.js
${build.out.css.dir}/css-vars.js
]]>
</x-sencha-command>
<if>
<not>
<equals arg1="${build.compression}" arg2=""/>
</not>
<then>
<x-compress-js srcFile="${build.out.css.dir}/css-vars.js.tmp"
outFile="${build.out.css.dir}/css-vars.js.tmp"/>
</then>
</if>
<delete file="${build.out.css.dir}/css-vars.js"/>
<move file="${build.out.css.dir}/css-vars.js.tmp"
tofile="${build.out.css.dir}/css-vars.js"/>
<if>
<not>
<equals arg1="${build.environment}" arg2="development"/>
</not>
<then>
<concat destfile="${build.out.js.path}" append="true">
<filelist files="${build.out.css.dir}/css-vars.js"/>
</concat>
</then>
</if>
</then>
</if>
</else> </else>
</if> </if>
</then> </then>

2
.sencha/app/sencha.cfg

@ -42,4 +42,4 @@ app.resource.paths=${app.dir}/resources
app.framework.version=5.1.1.451 app.framework.version=5.1.1.451
app.cmd.version=6.1.2.15 app.cmd.version=6.2.2.36

1
.sencha/app/slice-impl.xml

@ -182,6 +182,7 @@ Ext.Boot.loadSync([
<![CDATA[ <![CDATA[
slicer-manifest slicer-manifest
-exclude=${manifest.root.excludes} -exclude=${manifest.root.excludes}
-jsonp=Ext.Microloader.setManifest
-removeBootstrapCssEntries=${remove.slicer.css.bootstrap.entries} -removeBootstrapCssEntries=${remove.slicer.css.bootstrap.entries}
+ignoreDisabled +ignoreDisabled
-basePath=${bootstrap.base.path} -basePath=${bootstrap.base.path}

8
app/Application.js

@ -26,7 +26,9 @@ Ext.define('Rambox.Application', {
,getStoredServices: function () { ,getStoredServices: function () {
var stored = Ext.getStore('Services').load(); var stored = Ext.getStore('Services').load();
stored = stored.data.items; stored = stored.data.items;
stored = stored.map(g => g.data); stored = stored.map( function (g) {
return g.data;
});
return stored; return stored;
} }
,defaultServices: function () { ,defaultServices: function () {
@ -423,9 +425,9 @@ Ext.define('Rambox.Application', {
,updateTotalNotifications: function( newValue, oldValue ) { ,updateTotalNotifications: function( newValue, oldValue ) {
newValue = parseInt(newValue); newValue = parseInt(newValue);
if ( newValue > 0 ) { if ( newValue > 0 ) {
document.title = 'Rambox (' + Rambox.util.Format.formatNumber(newValue) + ')'; document.title = 'HumanistenBox (' + Rambox.util.Format.formatNumber(newValue) + ')';
} else { } else {
document.title = 'Rambox'; document.title = 'HumanistenBox';
} }
} }

6
app/view/main/MainController.js

@ -96,7 +96,7 @@ Ext.define('Rambox.view.main.MainController', {
var me = this; var me = this;
// Clear counter for unread messaging // Clear counter for unread messaging
document.title = 'Rambox'; document.title = 'HumanistenBox';
if ( btn ) { if ( btn ) {
Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove all services?', function(btnId) { Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove all services?', function(btnId) {
@ -108,7 +108,7 @@ Ext.define('Rambox.view.main.MainController', {
Ext.getStore('Services').load(); Ext.getStore('Services').load();
if ( Ext.isFunction(callback) ) callback(); if ( Ext.isFunction(callback) ) callback();
Ext.cq1('app-main').resumeEvent('remove'); Ext.cq1('app-main').resumeEvent('remove');
document.title = 'Rambox'; document.title = 'HumanistenBox';
} }
}); });
} else { } else {
@ -119,7 +119,7 @@ Ext.define('Rambox.view.main.MainController', {
Ext.getStore('Services').load(); Ext.getStore('Services').load();
if ( Ext.isFunction(callback) ) callback(); if ( Ext.isFunction(callback) ) callback();
Ext.cq1('app-main').resumeEvent('remove'); Ext.cq1('app-main').resumeEvent('remove');
document.title = 'Rambox'; document.title = 'HumanistenBox';
} }
} }

2
electron/tray.js

@ -48,7 +48,7 @@ exports.create = function(win, config) {
]); ]);
appIcon = new Tray(iconPath); appIcon = new Tray(iconPath);
appIcon.setToolTip('Rambox'); appIcon.setToolTip('HumanistenBox');
appIcon.setContextMenu(contextMenu); appIcon.setContextMenu(contextMenu);
appIcon.on('click', () => { appIcon.on('click', () => {
if ( !win.isVisible() ) { if ( !win.isVisible() ) {

7
package.json

@ -94,9 +94,10 @@
}, },
"dependencies": { "dependencies": {
"auto-launch": "4.0.0", "auto-launch": "4.0.0",
"tmp": "0.0.28", "electron": "^1.6.6",
"mime": "^1.3.4", "electron-config": "0.2.1",
"electron-is-dev": "^0.1.1", "electron-is-dev": "^0.1.1",
"electron-config": "0.2.1" "mime": "^1.3.4",
"tmp": "0.0.28"
} }
} }

2
test/tests/app/example.spec.js

@ -17,7 +17,7 @@ describe('Rambox window', function() {
it('should have "Rambox" in the title', function () { it('should have "Rambox" in the title', function () {
return ramboxTestHelper.app.client.browserWindow.getTitle().then(function(title) { return ramboxTestHelper.app.client.browserWindow.getTitle().then(function(title) {
expect(title).to.contain('Rambox'); expect(title).to.contain('HumanistenBox');
return Promise.resolve(); return Promise.resolve();
}); });
}) })

Loading…
Cancel
Save