Skip to content

added AnimateDoneEvent #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off


if exist build.bat goto start
goto wrongdir

Expand All @@ -21,15 +22,16 @@ del jo_core.js
del jo_data.js
del jo_ui.js

for %%J in (jsmin.exe) do set JSMIN=%%~dp$PATH:Jjsmin.exe
REM for %%J in (jsmin.exe) do set JSMIN=%%~dp$PATH:jsmin.exe
set JSMIN=jsmin.exe
if not "%JSMIN%"=="" goto minify
echo "jsmin not found, skipping minification."
cd ..
goto end

:minify
echo "Minifying js\jo.js -> js\jo_min.js"
%JSMIN% < jo.js > jo_min.js
..\%JSMIN% < jo.js > jo_min.js
cd ..
goto end

Expand Down
38 changes: 33 additions & 5 deletions js/data/filesource.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ joFileSource.extend(joDataSource, {

- `timeout` is an optional parameter which tells joFile to wait, in seconds,
for a response before throwing an error.

- `isPOST` is an optional parameter true if you need to do a post,

- `formData` parameters in a object to pass to POST,

Use
---

Expand All @@ -91,7 +94,7 @@ joFileSource.extend(joDataSource, {
console.log(data);
});
*/
joFile = function(url, call, context, timeout) {
joFile = function(url, call, context, timeout, postData) {
var req = new XMLHttpRequest();

if (!req)
Expand All @@ -102,11 +105,36 @@ joFile = function(url, call, context, timeout) {
timeout = 60 * SEC;

var timer = (timeout > 0) ? setTimeout(onerror, timeout) : null;

req.open('GET', url, true);
if( postData){
req.open('POST', url, true);
}else{
req.open('GET', url, true);
}
req.onreadystatechange = onchange;
req.onError = onerror;
req.send(null);
if( postData ){
var parmsStr="" ;
var parmCount=1;
for (var key in postData) {
if (postData.hasOwnProperty(key)) {
if(parmCount==1){
parmsStr=key+"="+encodeURIComponent(postData[key]);
}else{
parmsStr=parmsStr+"&"+key+"="+encodeURIComponent(postData[key]);
}
parmCount++;
}
}
//Send the proper header information along with the request
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", parmStr.length);
req.setRequestHeader("Origin", document.location.origin);

req .setRequestHeader("Connection", "close");
req.send(parmsStr);
}else{ //simple Get
req.send(null);
}

function onchange(e) {
if (timer)
Expand Down
2 changes: 2 additions & 0 deletions js/ui/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ joStack = function(data) {
this.hideEvent = new joSubject(this);
this.backEvent = new joSubject(this);
this.forwardEvent = new joSubject(this);
this.animateDoneEvent = new joSubject(this);

joContainer.call(this, data || []);

Expand Down Expand Up @@ -181,6 +182,7 @@ joStack.extend(joContainer, {

if (oldclass && oldchild)
joDOM.addCSSClass(oldchild, oldclass);
this.animateDoneEvent.fire();
}

function cleanup() {
Expand Down
Binary file added jsmin.exe
Binary file not shown.