cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

hardcode in jsloader.js #524

Closed zj831007 closed 10 years ago

zj831007 commented 12 years ago

why to hardcode like this: que.push('main.js'); if do this, I dont change my dir of main.js.

linshun commented 12 years ago

It is only for application entry, and it can be adjusted if needed.

What is your requirement?

Do you have any suggestion?

kirbysayshi commented 12 years ago

This is totally a drive-by comment, but something like this might work well:


// around line 111
var $c = d.querySelector('#cocos2d-html5')
  , c = $c.c;

// around line 150
que.push( $c.getAttribute('data-main') || 'main.js');

I could make a pull request for this, but I honestly haven't used cocos2d yet!

robrechtclaeys commented 12 years ago

I had the same issue. Now i'm bypassing this by ignoring the main.js mentioned in jsloader (the file just is not on the root of my site) and adding my own main.js in the appFiles.

The suggestion of kirbysayshi feels like a more correct solution.