Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
add media-example test app
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Oct 25, 2016
1 parent 4441655 commit 5dadf97
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ npm-debug.log
/build
/webapp/webapp-bundle*
/webapp/tests/testing-bundle*
/examples/media-editor/built/
18 changes: 8 additions & 10 deletions Makefile
Expand Up @@ -65,23 +65,21 @@ test-watch:
webapp:
@$(WEBPACK) -p --config webapp/webpack.config.js

deploy: test-app webapp
media-editor:
@$(WEBPACK) -p --config examples/media-editor/webpack.config.js

deploy: webapp media-editor
mkdir -p tmp/
rm -rf tmp/*
mkdir -p tmp/tests
mkdir -p tmp/media-editor
cp webapp/index.html tmp/
cp webapp/style.css tmp/
cp webapp/webapp-bundle.js tmp/
cp $(TESTAPP_DIR)/index.html tmp/tests
cp $(TESTAPP_DIR)/mocha.css tmp/tests
cp $(TESTAPP_DIR)/mocha.js tmp/tests
cp $(TESTAPP_DIR)/testing-bundle.js tmp/tests
cp examples/media-editor/index.html tmp/media-editor
cp examples/media-editor/app.css tmp/media-editor
cp -rf examples/media-editor/built/ tmp/media-editor/built
git checkout gh-pages
cp -rf tmp/* .
git add ./ -v
git commit -m "built"
git push origin gh-pages
git checkout -


.PHONY: standalone test test-all node_modules lint eslint webapp compile
117 changes: 117 additions & 0 deletions examples/media-editor/app.css
@@ -0,0 +1,117 @@
body {
font-family: sans-serif;
color: #444;
font-size: 12px;
}

input[type=text] {
width: 300px;
height: 12px;
line-height: 12px;
padding: 1px;
}
label {
display: inline-block;
width: 200px;
}

h3 {
text-align: center;
height: 40px;
line-height: 40px;
margin: -10px -10px 10px;
background: #aaa;
height: 24px;
line-height: 24px;
color: white;
font-size: 10px;
text-transform: uppercase;
}

.revision-history-container {
width: 200px;
float: left;
}

.history-original {
margin: 0 10px 10px;
border: 1px solid #bbb;
padding: 10px;
font-size: 12px;
background-color: white;
}

.history-original img {
width: 100%;
}

#revision-history-wrapper {
border: 1px solid #aaa;
margin: 10px;
}

#revision-history-wrapper h3 {
margin: 0 0 10px;
}

#revision-history .image-container {
margin: 5px 5%;
width: 90%;
box-sizing: border-box;
}

#revision-history {
overflow-y: auto;
height: 400px;
}

#revision-history img {
width: 100%;
min-height: 50px;
}

.image-container {
border: 1px solid #eee;
background-color: #fafafa;
padding: 9px;
margin-left: 15px;
float: left;
}

.image-container {
position: relative;
width: 300px;
}

.image-container .image-summary {
}

.image-container .image-summary span {
display: block;
font-size: 10px;
}

.image-container .image-summary span.image-revision-number {
font-size: 10px;
font-weight: bold;
position: absolute;
top: 1px;
left: 1px;
background-color: white;
padding: 0 3px;
border: 1px solid #eee;
border-radius: 3px;
height: 20px;
line-height: 20px;
text-align: center;
}

#image-node {
border: 1px solid #f0f0f0;
background-position: 50% 50%;
width: 100%;
height: 300px;
background-size: contain;
background-repeat: no-repeat;
background-color: white;
}
65 changes: 65 additions & 0 deletions examples/media-editor/index.html
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<title>wpcom.js over iframe proxy Media Upload Test Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="app.css">
</head>

<body>
<div>
<label>site ID</label>
<input type="text" id="site-node" value="" />
<br />

<label>image ID</label>
<input type="text" id="image-node-id"/>
<br />

<label>Title</label>
<input type="text" id="image-node-title" />
<br />

<label>Caption</label>
<input type="text" id="image-node-caption" />
<br />

<label>Description</label>
<input type="text" id="image-node-description" />

<hr />

<input type="file" id="file" disabled />
</div>
<hr />


<div class="revision-history-container">
<div class="history-original">
<h3>Original</h3>
<img id="revision-history-original" />
<div id="revision-history-details"></div>
</div>

<div id="revision-history-wrapper">
<h3>Revision History</h3>
<div id="revision-history">
<div class="revision-history-container"></div>
</div>
</div>
</div>

<div class="image-container" id="image-container">
<h3>Current media</h3>
<div id="image-node"></div>
<div id="image-details"></div>
<div id="image-actions">
<a href="#" id="image-delete">delete</a>
</div>
</div>

<script src="built/app.js"></script>
<script>
</script>
</body>
</html>

0 comments on commit 5dadf97

Please sign in to comment.