Skip to content

Commit

Permalink
Getting folder path
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyelton committed Apr 5, 2016
1 parent 41e9dd0 commit 73bd1b7
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
25 changes: 25 additions & 0 deletions Cortex.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
<Content Include="bower_components\react\LICENSE" />
<Content Include="bower_components\react\PATENTS" />
<Content Include="build\index.html" />
<Content Include="build\themes\basic\assets\fonts\icons.eot" />
<Content Include="build\themes\basic\assets\fonts\icons.svg" />
<Content Include="build\themes\basic\assets\fonts\icons.ttf" />
<Content Include="build\themes\basic\assets\fonts\icons.woff" />
<Content Include="build\themes\default\assets\fonts\icons.eot" />
<Content Include="build\themes\default\assets\fonts\icons.svg" />
<Content Include="build\themes\default\assets\fonts\icons.ttf" />
<Content Include="build\themes\default\assets\fonts\icons.woff" />
<Content Include="build\themes\default\assets\fonts\icons.woff2" />
<Content Include="build\themes\default\assets\images\flags.png" />
<Content Include="build\themes\github\assets\fonts\octicons-local.ttf" />
<Content Include="build\themes\github\assets\fonts\octicons.svg" />
<Content Include="build\themes\github\assets\fonts\octicons.ttf" />
<Content Include="build\themes\github\assets\fonts\octicons.woff" />
<Content Include="package.json" />
<Content Include="semantic.json" />
<Content Include="README.md" />
Expand Down Expand Up @@ -429,6 +443,17 @@
<Folder Include="bower_components\react\" />
<Folder Include="build\" />
<Folder Include="build\lib\" />
<Folder Include="build\themes\" />
<Folder Include="build\themes\basic\" />
<Folder Include="build\themes\basic\assets\" />
<Folder Include="build\themes\basic\assets\fonts\" />
<Folder Include="build\themes\default\" />
<Folder Include="build\themes\default\assets\" />
<Folder Include="build\themes\default\assets\fonts\" />
<Folder Include="build\themes\default\assets\images\" />
<Folder Include="build\themes\github\" />
<Folder Include="build\themes\github\assets\" />
<Folder Include="build\themes\github\assets\fonts\" />
<Folder Include="semantic" />
<Folder Include="semantic\dist\" />
<Folder Include="semantic\dist\components\" />
Expand Down
38 changes: 37 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,46 @@
<link rel="stylesheet" type="text/css" href="css/semantic.min.css">
</head>
<body>
<div>asdf</div>
<div class="ui center aligned basic segment">
<div class="ui fluid action input">
<input type="text" placeholder="Image Folder" id="FindInDirectoryInput" />
<button class="ui blue right labeled icon button" id="FindInDirectoryButton">
<i class="folder icon"></i>
Search
</button>
</div>
<div class="ui horizontal divider">
And
</div>
<div class="ui fluid action input">
<input type="text" placeholder="Output Folder" id="FindOutDirectoryInput" />
<button class="ui blue right labeled icon button" id="FindOutDirectoryButton">
<i class="folder icon"></i>
Search
</button>
</div>
</div>
<script type="text/javascript">
// Workaround: https://github.com/electron/electron/issues/254
window.$ = window.jQuery = require('./lib/jquery.min.js');
$(function () {
$('#FindInDirectoryButton').click(function () {
const dialog = require('electron').remote.dialog;
var fs = require('fs');
var folderPath = dialog.showOpenDialog({ properties: ['openDirectory'] });
if (!folderPath) return;
folderPath = folderPath[0];
try {
fs.accessSync(folderPath, fs.R_OK);
} catch (e) {
// It isn't accessible
console.log(e);
folderPath = false;
}
if (!folderPath) return;
$("#FindInDirectoryInput").val(folderPath);
});
});
</script>
<script src="lib/react-with-addons.min.js"></script>
<script src="lib/react-dom.min.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ gulp.task("run", function () {
return gulp.src("build").pipe(runElectron());
});

gulp.task("default", ["watch", "build", "run"], function () {
gulp.task("default", ["build", "run"], function () {
});

gulp.task('bower', function() {
bower();
gulp.src("semantic/dist/*.min.js").pipe(gulp.dest("build/lib"));
gulp.src("semantic/dist/themes/**/*").pipe(gulp.dest("build/css/themes"));
gulp.src("semantic/dist/*.min.css").pipe(gulp.dest("build/css"));
gulp.src("bower_components/jquery/dist/*.min.js").pipe(gulp.dest("build/lib"));
return gulp.src("bower_components/react/*.min.js").pipe(gulp.dest("build/lib"));
Expand Down

0 comments on commit 73bd1b7

Please sign in to comment.