PDA

View Full Version : create JSB3 file from url that can only be accessible by signing in



shiplu
28 Aug 2012, 8:19 AM
I want to generate jsb3 files from a url like http://website/home. This url is protected. Only signed in user can see this. People login in http://website/. The control panel (after login the '/home') is fully writen in ExtJS. Sencha tools can not access it as it does not have the cookie.


How can I create JSB3 file for such url?

scottmartin
28 Aug 2012, 10:10 AM
So you do not have direct access to the code?

Scott.

shiplu
28 Aug 2012, 12:43 PM
I have direct access to the code. I tried to feed the template to `sencha`, but it says,


Error thown from your application with message: TypeError: 'null' is not a constructor

Do you think just feeding the template file should work? And this error is shown because something is broken?

Here (http://pastebin.ca/2198830) is my code.

shiplu
29 Aug 2012, 1:46 AM
Okay.

I have fixed it manually. Here are the steps.
Get original template file. If it has raw php codes in it change it to js compatible. For example. If there is a php code
var data={id=<?echo $id; ?>}; change it to.
var data={id="<?echo $id; ?>"}; This will make it valid JavaScript code.
Include any javascript file that requires it. I had 'app-bootstrap.js' and obviously 'ext.js' file required by this template file. So I added this at the top of the template.
<script type="text/javascript" src="scripts/app-bootstrap.js"></script>
<script type="text/javascript" src="extjs/ext.js"></script>
Now execute `sencha`
sencha create jsb -a all.html -p all.jsb3