-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from Automattic/update/update-site-media
Add Site.Media.Edit() method
- Loading branch information
Showing
15 changed files
with
681 additions
and
165 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
env: { | ||
browser: true, | ||
mocha: true, | ||
node: true | ||
}, | ||
rules: { | ||
'array-bracket-spacing': [ 1, 'always' ], | ||
'brace-style': [ 1, '1tbs' ], | ||
// REST API objects include underscores | ||
camelcase: 0, | ||
'comma-spacing': 1, | ||
curly: 1, | ||
'dot-notation': 1, | ||
'computed-property-spacing': [ 1, 'always' ], | ||
indent: [ 1, 'tab', { SwitchCase: 1 } ], | ||
'jsx-quotes': [ 1, 'prefer-double' ], | ||
'key-spacing': 1, | ||
'keyword-spacing': 1, | ||
'max-len': [ 1, { code: 140 } ], | ||
'new-cap': [ 1, { capIsNew: false, newIsCap: true } ], | ||
'no-console': 1, | ||
'no-else-return': 1, | ||
'no-extra-semi': 1, | ||
'no-lonely-if': 1, | ||
'no-multiple-empty-lines': [ 1, { max: 1 } ], | ||
'no-multi-spaces': 1, | ||
'no-nested-ternary': 1, | ||
'no-new': 1, | ||
'no-process-exit': 1, | ||
'no-shadow': 1, | ||
'no-spaced-func': 1, | ||
'no-trailing-spaces': 1, | ||
// Allows Chai `expect` expressions | ||
'no-unused-expressions': 0, | ||
'no-var': 1, | ||
'object-curly-spacing': [ 1, 'always' ], | ||
'operator-linebreak': [ 1, 'after', { overrides: { | ||
'?': 'before', | ||
':': 'before' | ||
} } ], | ||
'padded-blocks': [ 1, 'never' ], | ||
'prefer-const': 1, | ||
'quote-props': [ 1, 'as-needed', { keywords: true } ], | ||
quotes: [ 1, 'single', 'avoid-escape' ], | ||
semi: 1, | ||
'semi-spacing': 1, | ||
'space-before-blocks': [ 1, 'always' ], | ||
'space-before-function-paren': [ 1, 'never' ], | ||
'space-in-parens': [ 1, 'always' ], | ||
'space-infix-ops': [ 1, { int32Hint: false } ], | ||
'space-unary-ops': [ 1, { | ||
overrides: { | ||
'!': true | ||
} | ||
} ], | ||
'template-curly-spacing': [ 1, 'always' ], | ||
'valid-jsdoc': [ 1, { requireReturn: false } ], | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ npm-debug.log | |
/build | ||
/webapp/webapp-bundle* | ||
/webapp/tests/testing-bundle* | ||
/examples/media-editor/built/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.