Skip to content

Commit

Permalink
Add error page if brackets index.html can't be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
gruehle committed Jun 20, 2012
1 parent 2ecf061 commit 426b138
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
Binary file modified bin/mac/Brackets.app/Contents/MacOS/Brackets
Binary file not shown.
35 changes: 35 additions & 0 deletions bin/mac/Brackets.app/Contents/Resources/load_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<style>
body {
font-family: helvetica, sans-serif;
}
li {
margin-top: 5px;
}
.small {
font-size: small;
}
</style>
</head>
<body>
<h2>Oops! I can't find the brackets index.html file</h2>
<p>The "brackets" folder that contains the HTML/CSS/JS source code for Brackets might be missing. Here are some tips for troubleshooting:</p>
<ul>
<li>If you downloaded Brackets from GitHub, you might have clicked the "Download as ZIP" button, which doesn't work. Instead, go to https://github.com/adobe/brackets/downloads and choose the newest ZIP file link under "Download Packages".</li>
<li>If you cloned the brackets-app repo from GitHub, make sure your submodules are updated by running <br/><code>git submodule update --init --recursive</code> inside the brackets-app folder.</li>
<li>Don't move the Brackets.app file out of the bin/mac directory. (We'll make this a real package eventually.)</li>
<li>If all else fails, contact us at:
<ul>
<li>Twitter: @brackets</li>
<li>IRC: #brackets on freenode</li>
<li>Developer mailing list: http://groups.google.com/group/brackets-dev</li>
</ul>
</li>
</ul>
<p class="small">Sorry about the inconvenience. We're still really early in development and haven't had time to build an installer.</p>
</body>
</html>
6 changes: 6 additions & 0 deletions src/mac/Brackets.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
216AF0FF148EB75F00C276A2 /* brackets_extensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 216AF0FE148EB75F00C276A2 /* brackets_extensions.mm */; };
216AF102148ED3CB00C276A2 /* NSAlert+SynchronousSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 216AF101148ED3CB00C276A2 /* NSAlert+SynchronousSheet.m */; };
21EE1DCCE981949481DA0C73 /* xml_reader_ctocpp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2BA46880A45B53E0619E7D3D /* xml_reader_ctocpp.cc */; };
21F56BB615912DB0001D9301 /* load_error.html in Resources */ = {isa = PBXBuildFile; fileRef = 21F56BB415912D94001D9301 /* load_error.html */; };
21F56BB715912DB8001D9301 /* load_error.html in Resources */ = {isa = PBXBuildFile; fileRef = 21F56BB415912D94001D9301 /* load_error.html */; };
2D7E748057913B7B5DBB1FE7 /* request_ctocpp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 589CBD58B158D7DEC03412F5 /* request_ctocpp.cc */; };
2E9807FC9E60762D50A0D6C9 /* scheme_handler_factory_cpptoc.cc in Sources */ = {isa = PBXBuildFile; fileRef = E13D2FF5A086DEF87977DB8A /* scheme_handler_factory_cpptoc.cc */; };
2F8A3BAF1F6BC0BD6BFC73CD /* domevent_listener_cpptoc.cc in Sources */ = {isa = PBXBuildFile; fileRef = ED7DA8E7BE98EB9E02A3ABD8 /* domevent_listener_cpptoc.cc */; };
Expand Down Expand Up @@ -251,6 +253,7 @@
216AF0FE148EB75F00C276A2 /* brackets_extensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = brackets_extensions.mm; sourceTree = "<group>"; };
216AF100148ED3CA00C276A2 /* NSAlert+SynchronousSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSAlert+SynchronousSheet.h"; sourceTree = "<group>"; };
216AF101148ED3CB00C276A2 /* NSAlert+SynchronousSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSAlert+SynchronousSheet.m"; sourceTree = "<group>"; };
21F56BB415912D94001D9301 /* load_error.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = load_error.html; sourceTree = "<group>"; };
23098934F6E67E4F2B6BD40D /* content_filter_cpptoc.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = content_filter_cpptoc.cc; sourceTree = "<group>"; };
239F9D75664E57C517A57B9D /* scheme_handler_callback_ctocpp.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = scheme_handler_callback_ctocpp.cc; sourceTree = "<group>"; };
24001199D5BDC29ABD659D57 /* print_handler_cpptoc.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = print_handler_cpptoc.cc; sourceTree = "<group>"; };
Expand Down Expand Up @@ -591,6 +594,7 @@
isa = PBXGroup;
children = (
216AF0FD148EB75F00C276A2 /* brackets_extensions.h */,
21F56BB415912D94001D9301 /* load_error.html */,
216AF0FE148EB75F00C276A2 /* brackets_extensions.mm */,
0402CF6E14E20840003C9903 /* brackets_utils_mac.h */,
0402CF6F14E20886003C9903 /* brackets_utils_mac.mm */,
Expand Down Expand Up @@ -808,6 +812,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21F56BB715912DB8001D9301 /* load_error.html in Resources */,
214293C0149002FF006DE3C0 /* data in Resources */,
214293C1149002FF006DE3C0 /* InfoPlist.strings in Resources */,
214293C2149002FF006DE3C0 /* MainMenu.xib in Resources */,
Expand All @@ -819,6 +824,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21F56BB615912DB0001D9301 /* load_error.html in Resources */,
722590BF7D460B34C28BEA77 /* data in Resources */,
17FF91411719292777E00ED9 /* InfoPlist.strings in Resources */,
065343256D3AD56B20BA59F7 /* MainMenu.xib in Resources */,
Expand Down
5 changes: 5 additions & 0 deletions src/mac/cefclient/cefclient_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ - (void)createApp:(id)object {
filePath = appPath + "/../../../../brackets/src/index.html";
else
filePath = appPath + "/../../brackets/src/index.html";

// Make sure the index.html file exists. If not, show the error page
if (![[NSFileManager defaultManager] fileExistsAtPath: [NSString stringWithUTF8String:filePath.c_str()]]) {
filePath = [[[NSBundle mainBundle] pathForResource:@"load_error" ofType:@"html"] UTF8String];
}

initialUrl = "file://" + filePath;
}
Expand Down
35 changes: 35 additions & 0 deletions src/mac/cefclient/load_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<style>
body {
font-family: helvetica, sans-serif;
}
li {
margin-top: 5px;
}
.small {
font-size: small;
}
</style>
</head>
<body>
<h2>Oops! I can't find the brackets index.html file</h2>
<p>The "brackets" folder that contains the HTML/CSS/JS source code for Brackets might be missing. Here are some tips for troubleshooting:</p>
<ul>
<li>If you downloaded Brackets from GitHub, you might have clicked the "Download as ZIP" button, which doesn't work. Instead, go to https://github.com/adobe/brackets/downloads and choose the newest ZIP file link under "Download Packages".</li>
<li>If you cloned the brackets-app repo from GitHub, make sure your submodules are updated by running <br/><code>git submodule update --init --recursive</code> inside the brackets-app folder.</li>
<li>Don't move the Brackets.app file out of the bin/mac directory. (We'll make this a real package eventually.)</li>
<li>If all else fails, contact us at:
<ul>
<li>Twitter: @brackets</li>
<li>IRC: #brackets on freenode</li>
<li>Developer mailing list: http://groups.google.com/group/brackets-dev</li>
</ul>
</li>
</ul>
<p class="small">Sorry about the inconvenience. We're still really early in development and haven't had time to build an installer.</p>
</body>
</html>

0 comments on commit 426b138

Please sign in to comment.