Skip to content

Commit

Permalink
bgsync UI added
Browse files Browse the repository at this point in the history
  • Loading branch information
tanepiper committed May 9, 2011
1 parent d39eec5 commit fb6b61c
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 5 deletions.
17 changes: 13 additions & 4 deletions client/ext/filesystem/filesystem.js
Expand Up @@ -291,8 +291,15 @@ return ext.register("ext/filesystem/filesystem", {
return;

var path = node.getAttribute("path");
fs.readFile(path, function(data, state, extra) {
if (state != apf.SUCCESS) {

var callback = function(data, state, extra) {
if (state == apf.OFFLINE) {
ide.addEventListener("afteronline", function(e) {
fs.readFile(path, callback);
ide.removeEventListener("afteronline", arguments.callee);
});
}
else if (state != apf.SUCCESS) {
if (extra.status == 404) {
ide.dispatchEvent("filenotfound", {
node : node,
Expand All @@ -303,9 +310,11 @@ return ext.register("ext/filesystem/filesystem", {
}
else {
doc.setValue(data);
ide.dispatchEvent("afteropenfile", {doc: doc, node: node});
ide.dispatchEvent("afteropenfile", {doc: doc, node: node});
}
});
};

fs.readFile(path, callback);
});

ide.addEventListener("reload", function(e) {
Expand Down
1 change: 0 additions & 1 deletion client/ext/openfiles/openfiles.js
Expand Up @@ -16,7 +16,6 @@ return ext.register("ext/openfiles/openfiles", {
alone : true,
type : ext.GENERAL,
markup : markup,
offline : false,

hook : function(){
panels.register(this);
Expand Down
Binary file added client/style/images/sync.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions client/style/skins.xml
@@ -1,5 +1,30 @@
<?xml version='1.0'?>
<a:skin xmlns:a="http://ajax.org/2005/aml" xmlns="http://www.w3.org/1999/xhtml">
<a:checkbox name="checkbox">
<a:style><![CDATA[
.cboffline {
width: 55px;
height: 21px;
background: url(images/sync.png) no-repeat 0 -21px;
}
.cbofflineDown {
background-position : 0 0px;
}
.cbofflineChecked {
background-position : 0 0px;
}
]]></a:style>

<a:presentation>
<a:main>
<div class='cboffline'>

</div>
</a:main>
</a:presentation>
</a:checkbox>
<a:bar name="bar">
<a:style><![CDATA[
.bar{
Expand Down
25 changes: 25 additions & 0 deletions client/style/skins/checkbox.xml
Expand Up @@ -77,4 +77,29 @@
</a:main>
</a:presentation>
</a:checkbox>
<a:checkbox name="bgsync">
<a:style><![CDATA[
.cboffline {
width: 55px;
height: 21px;
background-image: url(images/checkbox.png) no-repeat;
}
.cbofflineDown .checkbox {
background-position : 0 -21px;
}
.cbofflineChecked .checkbox {
background-position : 0 -21px;
}
]]></a:style>

<a:presentation>
<a:main>
<div class='cboffline'>

</div>
</a:main>
</a:presentation>
</a:checkbox>
</a:skin>

0 comments on commit fb6b61c

Please sign in to comment.