Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit c23101b

Browse files
config.js, base/pjax, endpoint
1 parent 2de7f0e commit c23101b

File tree

8 files changed

+40
-5
lines changed

8 files changed

+40
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ mojo/log/
88
.idea/
99
binary-static.iml
1010
scripts/local
11+
src/javascript/binary_pack.js

build/concat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
'src/javascript/autogenerated/idd_codes.js',
1616
'src/javascript/autogenerated/texts.js',
1717
'src/javascript/autogenerated/*.js',
18-
'src/javascript/modules.js',
18+
'src/javascript/binary_pack.js',
1919
'src/javascript/binary/base/*.js',
2020
'src/javascript/binary/**/*.js',
2121
'src/javascript/binary_japan/**/*.js',

build/webpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function (grunt) {
66
},
77
output: {
88
path: './src/javascript',
9-
filename: 'modules.js',
9+
filename: 'binary_pack.js',
1010
},
1111
}
1212
}

src/javascript/binary/base.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ $(function(){
88
});
99
});
1010

11-
var onLoad = new PjaxExecQueue();
12-
var onUnload = new PjaxExecQueue();
13-
1411
var SessionStore, LocalStore;
1512
if (isStorageSupported(window.localStorage)) {
1613
LocalStore = new Store(window.localStorage);

src/javascript/binary/base/pjax.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,17 @@ var pjax_config_page_require_auth = function(url, exec) {
164164
pjax_config_page(url, newExecFn);
165165
};
166166

167+
var onLoad = new PjaxExecQueue();
168+
var onUnload = new PjaxExecQueue();
169+
167170
init_pjax(); //Pjax-standalone will wait for on load event before attaching.
168171
$(function() { onLoad.fire(); });
172+
173+
module.exports = {
174+
pjax_config_page_require_auth: pjax_config_page_require_auth,
175+
pjax_config_page: pjax_config_page,
176+
load_with_pjax: load_with_pjax,
177+
PjaxExecQueue: PjaxExecQueue,
178+
onLoad: onLoad,
179+
onUnload: onUnload,
180+
};

src/javascript/binary/static_pages/endpoint.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
var getAppId = require('../../config').getAppId;
2+
var getSocketURL = require('../../config').getSocketURL;
3+
var pjax_config_page = require('../base/pjax').pjax_config_page;
4+
15
pjax_config_page("endpoint", function(){
26
return {
37
onLoad: function() {

src/javascript/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ function getSocketURL() {
4040
}
4141
return 'wss://' + server_url + '/websockets/v3';
4242
}
43+
44+
module.exports = {
45+
getAppId: getAppId,
46+
getSocketURL: getSocketURL,
47+
};

src/javascript/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var config = require('./config');
2+
var pjax = require('./binary/base/pjax');
3+
4+
require('./binary/static_pages/endpoint');
5+
6+
// TODO: to be remove after webpack finalized
7+
var exportAllFunctions = function exportAllFunctions(obj) {
8+
for ( var key in obj ) {
9+
if ( obj.hasOwnProperty(key) ) {
10+
window[key] = obj[key];
11+
}
12+
}
13+
};
14+
15+
exportAllFunctions(config);
16+
exportAllFunctions(pjax);

0 commit comments

Comments
 (0)