Skip to content

Commit

Permalink
Added loading.html
Browse files Browse the repository at this point in the history
  • Loading branch information
shd101wyy committed Jul 13, 2017
1 parent ae4f84e commit fabaf60
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 14 deletions.
Binary file added assets/octocat-spinner-128.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions html/loading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="stylesheet" href="../styles/loading.css">
</head>
<body>
<div class="markdown-spinner"> Loading Preview... </div>
</body>
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions out/src/content-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const atom_1 = require("atom");
const path = require("path");
const mume = require("@shd101wyy/mume");
// TODO: presentation PDF export.
// TODO: <!-- @import [toc] -->
/**
* Key is editor.getPath()
* Value is temp html file path.
Expand Down Expand Up @@ -45,6 +46,7 @@ class MarkdownPreviewEnhancedView {
this.iframe.style.width = '100%';
this.iframe.style.height = '100%';
this.iframe.style.border = 'none';
this.iframe.src = path.resolve(__dirname, '../../html/loading.html');
this.element.appendChild(this.iframe);
}
getURI() {
Expand Down
5 changes: 4 additions & 1 deletion src/content-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as mume from "@shd101wyy/mume"
import {MarkdownPreviewEnhancedConfig} from "./config"

// TODO: presentation PDF export.
// TODO: <!-- @import [toc] -->

/**
* Key is editor.getPath()
Expand Down Expand Up @@ -48,6 +49,8 @@ export class MarkdownPreviewEnhancedView {
this.iframe.style.width = '100%'
this.iframe.style.height = '100%'
this.iframe.style.border = 'none'
this.iframe.src = path.resolve(__dirname, '../../html/loading.html')

this.element.appendChild(this.iframe)
}

Expand Down Expand Up @@ -144,7 +147,7 @@ export class MarkdownPreviewEnhancedView {
* 2. Write preview html template
* 3. this.iframe will load that *.html file.
*/
public async loadPreview() {
public async loadPreview() {
const editorFilePath = this.editor.getPath()

// create temp html file for preview
Expand Down
19 changes: 19 additions & 0 deletions styles/loading.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

html, body {
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
}

body {
background-color: #fff;
}

body .markdown-spinner {
margin: 48px auto;
background-image: url(../assets/octocat-spinner-128.gif);
background-repeat: no-repeat;
background-size: 64px;
background-position: top center;
padding-top: 70px;
text-align: center;
font-size: 16px;
}
13 changes: 0 additions & 13 deletions styles/loading.less

This file was deleted.

0 comments on commit fabaf60

Please sign in to comment.