|
|
|
@ -165,51 +165,49 @@ function HomeTabFile({ plugin }: HomeTabFileProps) { |
|
|
|
|
<label style={{ fontSize: '1.2rem' }}> |
|
|
|
|
<FormattedMessage id="home.files" /> |
|
|
|
|
</label> |
|
|
|
|
<div className="d-flex flex-column"> |
|
|
|
|
<div className="d-flex flex-row"> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.newFileTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<button className="btn btn-primary text-nowrap p-2 mr-2 border my-1" data-id="homeTabNewFile" style={{ width: 'fit-content' }} onClick={async () => { |
|
|
|
|
_paq.push(['trackEvent', 'hometab', 'filesSection', 'newFile']) |
|
|
|
|
await plugin.call('menuicons', 'select', 'filePanel') |
|
|
|
|
await plugin.call('filePanel', 'createNewFile') |
|
|
|
|
}}> |
|
|
|
|
<i className="far fa-file pl-1 pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.newFile" /> |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.openFileTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<span> |
|
|
|
|
<label className="btn text-nowrap p-2 mr-2 border my-1" style={{ width: 'fit-content', cursor: 'pointer' }} htmlFor="openFileInput"> |
|
|
|
|
<i className="far fa-upload pl-1 pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.openFile" /> |
|
|
|
|
</label> |
|
|
|
|
<input |
|
|
|
|
title="open file" |
|
|
|
|
type="file" |
|
|
|
|
id="openFileInput" |
|
|
|
|
onChange={async (event) => { |
|
|
|
|
event.stopPropagation() |
|
|
|
|
await plugin.call('menuicons', 'select', 'filePanel') |
|
|
|
|
uploadFile(event.target) |
|
|
|
|
}} |
|
|
|
|
multiple |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.gistTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3" |
|
|
|
|
> |
|
|
|
|
<button className="btn text-nowrap p-2 mr-2 border my-1" data-id="landingPageImportFromGistButton" onClick={() => importFromGist()}> |
|
|
|
|
<i className="fab fa-github pl-1 pr-2"></i> |
|
|
|
|
<div className="d-flex flex-row"> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.newFileTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<button className="btn btn-primary text-nowrap p-2 mr-2 border my-1" data-id="homeTabNewFile" style={{ width: 'fit-content' }} onClick={async () => { |
|
|
|
|
_paq.push(['trackEvent', 'hometab', 'filesSection', 'newFile']) |
|
|
|
|
await plugin.call('menuicons', 'select', 'filePanel') |
|
|
|
|
await plugin.call('filePanel', 'createNewFile') |
|
|
|
|
}}> |
|
|
|
|
<i className="far fa-file pl-1 pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.newFile" /> |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.openFileTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<span> |
|
|
|
|
<label className="btn text-nowrap p-2 mr-2 border my-1" style={{ width: 'fit-content', cursor: 'pointer' }} htmlFor="openFileInput"> |
|
|
|
|
<i className="far fa-upload pl-1 pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.openFile" /> |
|
|
|
|
</label> |
|
|
|
|
<input |
|
|
|
|
title="open file" |
|
|
|
|
type="file" |
|
|
|
|
id="openFileInput" |
|
|
|
|
onChange={async (event) => { |
|
|
|
|
event.stopPropagation() |
|
|
|
|
await plugin.call('menuicons', 'select', 'filePanel') |
|
|
|
|
uploadFile(event.target) |
|
|
|
|
}} |
|
|
|
|
multiple |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.gistTooltip" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3" |
|
|
|
|
> |
|
|
|
|
<button className="btn text-nowrap p-2 mr-2 border my-1" data-id="landingPageImportFromGistButton" onClick={() => importFromGist()}> |
|
|
|
|
<i className="fab fa-github pl-1 pr-2"></i> |
|
|
|
|
Gist |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.connectToLocalhost" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<button className="btn text-nowrap p-2 border my-1" onClick={() => connectToLocalhost()}> |
|
|
|
|
<i className="fa-regular fa-desktop pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.accessFileSystem" /> |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
</div> |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
<CustomTooltip placement={'top'} tooltipId="overlay-tooltip" tooltipClasses="text-nowrap" tooltipText={<FormattedMessage id="home.connectToLocalhost" />} tooltipTextClasses="border bg-light text-dark p-1 pr-3"> |
|
|
|
|
<button className="btn text-nowrap p-2 border my-1" onClick={() => connectToLocalhost()}> |
|
|
|
|
<i className="fa-regular fa-desktop pr-2"></i> |
|
|
|
|
<FormattedMessage id="home.accessFileSystem" /> |
|
|
|
|
</button> |
|
|
|
|
</CustomTooltip> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|