Browse Source

sachen

pull/943/head
phischdev 8 years ago
parent
commit
cc038c53e2
  1. 76
      .sencha/app/Boot.js
  2. 17
      .sencha/app/Microloader.js
  3. 27
      .sencha/app/build-impl.xml
  4. 6
      .sencha/app/init-impl.xml
  5. 28
      .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. 201
      package.json
  14. 2
      test/tests/app/example.spec.js

76
.sencha/app/Boot.js

@ -537,9 +537,27 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
init: function () {
var scriptEls = doc.getElementsByTagName('script'),
script = scriptEls[0],
len = scriptEls.length,
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
// anyway, we track them in _scripts so we don't have to ask for them all
@ -552,12 +570,8 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
state = script.readyState || null;
// If we find a script file called "ext-*.js", then the base path is that file's base path.
if (!baseUrl) {
if (re.test(src)) {
Boot.hasReadyState = ("readyState" in script);
Boot.hasAsync = ("async" in script) || !Boot.hasReadyState;
baseUrl = src;
}
if (!baseUrl && re.test(src)) {
baseUrl = src;
}
if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
@ -578,8 +592,6 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
if (!baseUrl) {
script = scriptEls[scriptEls.length - 1];
baseUrl = script.src;
Boot.hasReadyState = ('readyState' in script);
Boot.hasAsync = ("async" in script) || !Boot.hasReadyState;
}
Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
@ -1394,27 +1406,36 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
createLoadElement: function(callback) {
var me = this,
el = me.getElement(),
readyStateChange = function(){
el = me.getElement();
me.preserve = true;
el.onerror = function() {
me.error = true;
if (callback) {
callback();
callback = null;
}
};
if (Boot.isIE10m) {
el.onreadystatechange = function() {
if (this.readyState === 'loaded' || this.readyState === 'complete') {
if(callback) {
if (callback) {
callback();
callback = this.onreadystatechange = this.onerror = null;
}
}
},
errorFn = function() {
me.error = true;
if(callback) {
callback();
}
};
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
el[me.prop] = me.getLoadUrl();
},
@ -1541,8 +1562,11 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
// for async modes, we have some options
if (!sync) {
// if cross domain, just inject the script tag and let the onload
// events drive the progression
if(me.isCrossDomain()) {
// events drive the progression.
// 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();
}
// for IE, use the readyStateChange allows us to load scripts in parallel

17
.sencha/app/Microloader.js

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

27
.sencha/app/build-impl.xml

@ -463,6 +463,33 @@ this file in most cases.
depends="init,-before-publish,-publish,-after-publish"
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.rhino" value="false"/>
<property name="app.sass.dynamic" value="false"/>
<property name="app.sass.generated.var" value="${app.sass.save}"/>
</target>
<target name="-after-init"/>
@ -403,7 +405,9 @@
defaultSassFile="${app.out.scss}"
defaultCssFile="${app.out.css}"
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}">
<mapping name="~cmd" path="${cmd.dir}"/>
<mapping name="" path="${build.web.root}"/>

28
.sencha/app/page-impl.xml

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

1
.sencha/app/refresh-impl.xml

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

59
.sencha/app/sass-impl.xml

@ -209,17 +209,74 @@
compress="${build.css.compress}"
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>
fashion
-config=${build.out.json.path}
-compress=${build.css.compress}
-split=${build.css.selector.limit}
-saveFile=${app.dir}/${app.sass.save}
-saveFile=${app.dir}/${app.sass.generated.var}
${app.out.scss}
${app.out.css}
</x-sencha-command>
<x-update-css-array input="${app.out.css}"
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>
</if>
</then>

2
.sencha/app/sencha.cfg

@ -42,4 +42,4 @@ app.resource.paths=${app.dir}/resources
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[
slicer-manifest
-exclude=${manifest.root.excludes}
-jsonp=Ext.Microloader.setManifest
-removeBootstrapCssEntries=${remove.slicer.css.bootstrap.entries}
+ignoreDisabled
-basePath=${bootstrap.base.path}

8
app/Application.js

@ -26,7 +26,9 @@ Ext.define('Rambox.Application', {
,getStoredServices: function () {
var stored = Ext.getStore('Services').load();
stored = stored.data.items;
stored = stored.map(g => g.data);
stored = stored.map( function (g) {
return g.data;
});
return stored;
}
,defaultServices: function () {
@ -423,9 +425,9 @@ Ext.define('Rambox.Application', {
,updateTotalNotifications: function( newValue, oldValue ) {
newValue = parseInt(newValue);
if ( newValue > 0 ) {
document.title = 'Rambox (' + Rambox.util.Format.formatNumber(newValue) + ')';
document.title = 'HumanistenBox (' + Rambox.util.Format.formatNumber(newValue) + ')';
} 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;
// Clear counter for unread messaging
document.title = 'Rambox';
document.title = 'HumanistenBox';
if ( btn ) {
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();
if ( Ext.isFunction(callback) ) callback();
Ext.cq1('app-main').resumeEvent('remove');
document.title = 'Rambox';
document.title = 'HumanistenBox';
}
});
} else {
@ -119,7 +119,7 @@ Ext.define('Rambox.view.main.MainController', {
Ext.getStore('Services').load();
if ( Ext.isFunction(callback) ) callback();
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.setToolTip('Rambox');
appIcon.setToolTip('HumanistenBox');
appIcon.setContextMenu(contextMenu);
appIcon.on('click', () => {
if ( !win.isVisible() ) {

201
package.json

@ -1,102 +1,103 @@
{
"private": true,
"scripts": {
"start": "electron electron/main.js",
"start:debug": "electron electron/main.js --enable-logging",
"test": "./node_modules/.bin/mocha test/tests/**/*.spec.js",
"sencha:clean": "rm -rf ./build/production",
"sencha:compile": "sencha app build && cp app/package.json build/production/Rambox/ && npm --prefix ./build/production/Rambox/ install ./build/production/Rambox/",
"sencha:compile:build": "sencha app build && cp app/package.json build/production/Rambox/ && cp -R build/production/Rambox/* ../rambox-build",
"clean": "rm -rf ./dist",
"clean:osx": "rm -rf ./dist/Rambox-darwin-*",
"clean:win": "rm -rf ./dist/Rambox-win32-*",
"pack": "npm run pack:osx && npm run pack:win",
"pack:osx": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=darwin --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.icns --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:win": "npm run pack:win32 && npm run pack:win64",
"pack:win32": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=win32 --arch=ia32 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=32-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:win64": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=win32 --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:linux": "npm run pack:linux32 && npm run pack:linux64",
"pack:linux32": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=linux --arch=ia32 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:linux64": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=linux --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"build": "npm run build:linux && npm run build:osx && npm run build:win",
"build:osx": "build --macos",
"build:linux": "npm run build:linux32 && npm run build:linux64",
"build:linux32": "build --linux --ia32",
"build:linux64": "build --linux --x64",
"build:win32": "build --win --ia32",
"build:win64": "build --win --x64",
"setup:osx": "npm run sencha:clean && npm run sencha:compile && npm run clean:osx && npm run pack:osx && npm run build:osx",
"setup:win": "npm run sencha:clean && npm run sencha:compile && npm run clean:win && npm run pack:win && npm run build:win",
"all:win": "npm run sencha:clean && npm run sencha:compile && npm run clean:win && npm run pack:win && npm run zip:win32 && npm run zip:win64 && npm run build:win",
"all:linux": "npm run sencha:clean && npm run sencha:compile && npm run build:linux"
},
"build": {
"productName": "Rambox",
"appId": "com.saenzramiro.rambox",
"asar": true,
"mac": {
"category": "public.app-category.productivity",
"target": [
"default"
]
},
"dmg": {
"title": "Rambox",
"iconSize": 128,
"contents": [
{
"x": 355,
"y": 125,
"type": "link",
"path": "/Applications"
},
{
"x": 155,
"y": 125,
"type": "file"
}
]
},
"squirrelWindows": {
"iconUrl": "https://raw.githubusercontent.com/saenzramiro/rambox/master/resources/Icon.ico"
},
"win": {
"target": [
"squirrel",
"zip"
]
},
"linux": {
"category": "Office",
"target": [
"AppImage",
"deb",
"rpm",
"zip",
"tar.gz"
]
},
"directories": {
"buildResources": "resources/installer/",
"output": "dist/",
"app": "build/production/Rambox/"
}
},
"devDependencies": {
"asar": "^0.12.1",
"electron": "^1.6.1",
"electron-builder": "^14.5.3",
"electron-builder-squirrel-windows": "15.0.0",
"electron-squirrel-startup": "^1.0.0",
"chai": "3.5.0",
"mocha": "3.2.0",
"spectron": "3.4.0"
},
"dependencies": {
"auto-launch": "4.0.0",
"tmp": "0.0.28",
"mime": "^1.3.4",
"electron-is-dev": "^0.1.1",
"electron-config": "0.2.1"
}
"private": true,
"scripts": {
"start": "electron electron/main.js",
"start:debug": "electron electron/main.js --enable-logging",
"test": "./node_modules/.bin/mocha test/tests/**/*.spec.js",
"sencha:clean": "rm -rf ./build/production",
"sencha:compile": "sencha app build && cp app/package.json build/production/Rambox/ && npm --prefix ./build/production/Rambox/ install ./build/production/Rambox/",
"sencha:compile:build": "sencha app build && cp app/package.json build/production/Rambox/ && cp -R build/production/Rambox/* ../rambox-build",
"clean": "rm -rf ./dist",
"clean:osx": "rm -rf ./dist/Rambox-darwin-*",
"clean:win": "rm -rf ./dist/Rambox-win32-*",
"pack": "npm run pack:osx && npm run pack:win",
"pack:osx": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=darwin --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.icns --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:win": "npm run pack:win32 && npm run pack:win64",
"pack:win32": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=win32 --arch=ia32 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=32-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:win64": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=win32 --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:linux": "npm run pack:linux32 && npm run pack:linux64",
"pack:linux32": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=linux --arch=ia32 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"pack:linux64": "electron-packager \"./build/production/Rambox/\" \"Rambox\" --out=dist --platform=linux --arch=x64 --version=1.3.4 --icon=resources/installer/Icon.ico --app-version=0.2.0 --build-version=64-bit --version-string.CompanyName=\"Rambox\" --version-string.ProductName=\"Rambox\" --asar --prune --overwrite",
"build": "npm run build:linux && npm run build:osx && npm run build:win",
"build:osx": "build --macos",
"build:linux": "npm run build:linux32 && npm run build:linux64",
"build:linux32": "build --linux --ia32",
"build:linux64": "build --linux --x64",
"build:win32": "build --win --ia32",
"build:win64": "build --win --x64",
"setup:osx": "npm run sencha:clean && npm run sencha:compile && npm run clean:osx && npm run pack:osx && npm run build:osx",
"setup:win": "npm run sencha:clean && npm run sencha:compile && npm run clean:win && npm run pack:win && npm run build:win",
"all:win": "npm run sencha:clean && npm run sencha:compile && npm run clean:win && npm run pack:win && npm run zip:win32 && npm run zip:win64 && npm run build:win",
"all:linux": "npm run sencha:clean && npm run sencha:compile && npm run build:linux"
},
"build": {
"productName": "Rambox",
"appId": "com.saenzramiro.rambox",
"asar": true,
"mac": {
"category": "public.app-category.productivity",
"target": [
"default"
]
},
"dmg": {
"title": "Rambox",
"iconSize": 128,
"contents": [
{
"x": 355,
"y": 125,
"type": "link",
"path": "/Applications"
},
{
"x": 155,
"y": 125,
"type": "file"
}
]
},
"squirrelWindows": {
"iconUrl": "https://raw.githubusercontent.com/saenzramiro/rambox/master/resources/Icon.ico"
},
"win": {
"target": [
"squirrel",
"zip"
]
},
"linux": {
"category": "Office",
"target": [
"AppImage",
"deb",
"rpm",
"zip",
"tar.gz"
]
},
"directories": {
"buildResources": "resources/installer/",
"output": "dist/",
"app": "build/production/Rambox/"
}
},
"devDependencies": {
"asar": "^0.12.1",
"electron": "^1.6.1",
"electron-builder": "^14.5.3",
"electron-builder-squirrel-windows": "15.0.0",
"electron-squirrel-startup": "^1.0.0",
"chai": "3.5.0",
"mocha": "3.2.0",
"spectron": "3.4.0"
},
"dependencies": {
"auto-launch": "4.0.0",
"electron": "^1.6.6",
"electron-config": "0.2.1",
"electron-is-dev": "^0.1.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 () {
return ramboxTestHelper.app.client.browserWindow.getTitle().then(function(title) {
expect(title).to.contain('Rambox');
expect(title).to.contain('HumanistenBox');
return Promise.resolve();
});
})

Loading…
Cancel
Save