Add a "document" style to PHUIRemarkupPreviewPanel and use it in Legalpad and Phriction

Summary: Ref T3671. Depends on D6674. Continues work in D6673, D6674 and extends it into Legalpad and Phriction. Then deletes a bunch of dead code.

Test Plan: Edited documents in Legalpad and Phriction, verified I got reasonable looking previews.

Reviewers: btrahan, Firehed

Reviewed By: btrahan

CC: aran, chad

Maniphest Tasks: T3671

Differential Revision: https://secure.phabricator.com/D6675
This commit is contained in:
epriestley
2013-08-05 10:47:26 -07:00
parent b2fa1293a7
commit b712905dc1
18 changed files with 86 additions and 188 deletions

View File

@@ -229,24 +229,11 @@ final class PhrictionEditController
$header = id(new PhabricatorHeaderView())
->setHeader($panel_header);
$preview_content = hsprintf(
'<div class="phriction-document-preview-header plt pll">%s</div>
<div id="document-preview">
<div class="aphront-panel-preview-loading-text">%s</div>
</div>',
pht('Document Preview'),
pht('Loading preview...'));
$preview_panel = id(new PHUIDocumentView())
->appendChild($preview_content);
Javelin::initBehavior(
'phriction-document-preview',
array(
'preview' => 'document-preview',
'textarea' => 'document-textarea',
'uri' => '/phriction/preview/?draftkey='.$draft_key,
));
$preview = id(new PHUIRemarkupPreviewPanel())
->setHeader(pht('Document Preview'))
->setPreviewURI('/phriction/preview/')
->setControlID('document-textarea')
->setSkin('document');
$crumbs = $this->buildApplicationCrumbs();
if ($document->getID()) {
@@ -269,7 +256,7 @@ final class PhrictionEditController
$draft_note,
$error_view,
$form,
$preview_panel,
$preview,
),
array(
'title' => pht('Edit Document'),