Skip to content

Commit

Permalink
Merge pull request #87 from withanage/master
Browse files Browse the repository at this point in the history
Add title to webpage when editing texture
  • Loading branch information
withanage authored Oct 11, 2020
2 parents d1f18b7 + 91e4dba commit 43225f1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
8 changes: 6 additions & 2 deletions TextureHandler.inc.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function editor($args, $request) {
if (!$submissionId || !$stageId || !$fileId) {
fatalError('Invalid request');
}

$submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
$submissionFile = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION_FILE);
$filePath = $submissionFile->getFilePath();
$manuscriptXml = file_get_contents($filePath);
Expand All @@ -333,16 +333,20 @@ public function editor($args, $request) {
array(
'submissionId' => $submissionId,
'fileId' => $fileId,
'stageId' => $stageId,
'stageId' => $stageId
)
);

AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_MANAGER);
$templateMgr = TemplateManager::getManager($request);
$publication = $submission->getCurrentPublication();
$title = $publication->getLocalizedData('title') ?? __('plugins.generic.texture.name');

$templateMgr->assign(array(
'documentUrl' => $documentUrl,
'textureUrl' => $this->_plugin->getTextureUrl($request),
'texturePluginUrl' => $this->_plugin->getPluginUrl($request),
'title' => $title
));
return $templateMgr->fetch($editorTemplateFile);
}
Expand Down
3 changes: 3 additions & 0 deletions locale/en_US/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ msgstr "Extract DAR"
msgid "plugins.generic.texture.links.extractZipArchive"
msgstr "Extract ZIP Archive"

msgid "plugins.generic.texture.name"
msgstr "Texture"

msgid "plugins.generic.texture.notification.noManuscript"
msgstr "No manuscript file available"

Expand Down
3 changes: 2 additions & 1 deletion templates/editor.tpl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<head>
<meta charset="UTF-8">
<meta name="jobId" content="{$documentUrl|escape}">
<title>{$title|escape}</title>

{* Texture dependencies (see index.html in Texture distribution) *}
<link href="{$textureUrl|escape}/texture.css" rel="stylesheet" type="text/css"/>
Expand All @@ -29,7 +30,7 @@
<script type="text/javascript" src="{$textureUrl|escape}/substance/substance.min.js"></script>
<script type="text/javascript" src="{$textureUrl|escape}/katex/katex.min.js"></script>
<script type="text/javascript" src="{$textureUrl|escape}/texture.js"></script>
<script type="text/javascript" src="{$textureUrl|escape}/vfs.js"></script>
<!--script type="text/javascript" src="{$textureUrl|escape}/vfs.js"></script-->

{* Texture plugin additions *}
<script type="text/javascript" src="{$texturePluginUrl|escape}/editor.js"></script>
Expand Down
12 changes: 6 additions & 6 deletions texture/texture.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion texture/texture.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions texture/texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -21309,9 +21309,9 @@
el.append(
$$(ResourceComponent, props).ref('resource')
);
if (substance.platform.inBrowser && !substance.platform.isChromium && !substance.platform.inElectron) {
if (substance.platform.inBrowser && !substance.platform.isChromium && !substance.platform.inElectron && !substance.platform.isFF) {
el.append(
$$(PinnedMessage, { icon: 'fa-warning', label: 'Attention! Current version of Texture supports only Chrome browser.' })
$$(PinnedMessage, { icon: 'fa-warning', label: 'This editor may may not work fully in your browser. If you experience problems, please try loading the editor in Firefox or Chrome.' })
);
}
return el
Expand Down

0 comments on commit 43225f1

Please sign in to comment.