-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
495 additions
and
107 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
@font-face { | ||
font-family: 'Open Sans'; | ||
src: url('/.theme/font/OpenSans-Regular.ttf'); | ||
src: url('./font/OpenSans-Regular.ttf'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Open Sans Italic'; | ||
src: url('/.theme/font/OpenSans-Italic.ttf'); | ||
src: url('./font/OpenSans-Italic.ttf'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Open Sans Lighter'; | ||
src: url('/.theme/font/OpenSans-Light.ttf'); | ||
font-family: 'Open Sans Light'; | ||
src: url('./font/OpenSans-Light.ttf'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Open Sans Bold'; | ||
src: url('/.theme/font/OpenSans-Bold.ttf'); | ||
src: url('./font/OpenSans-Bold.ttf'); | ||
} |
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,63 @@ | ||
<?php | ||
namespace app\events; | ||
|
||
use std; | ||
use std; | ||
use app; | ||
|
||
class FSTreeEvents | ||
{ | ||
public function onFileSystem (StandartFileSystem $provider, $path = null) | ||
{ | ||
$this->getForm()->fileInfoPanel->updateFilePath($path); | ||
|
||
$this->getForm()->fileInfoPanel->updateFileIcon($provider, $path); | ||
$this->getForm()->updateFileinfo($provider, $path); | ||
} | ||
|
||
public function onZipFileSystem (ZipFileSystem $provider, $zipPath, $path) | ||
{ | ||
$this->getForm()->fileInfoPanel->updateFilePath($zipPath); | ||
|
||
$zipPath = $this->normalizeZipPath($provider, $zipPath); | ||
|
||
$this->getForm()->fileInfoPanel->updateFileIcon($provider, $zipPath); | ||
|
||
if ($provider->isFile($zipPath)) { | ||
$provider->getZipInstance()->read($zipPath, function (array $stat, Stream $output) use ($zipPath) { | ||
$this->getForm()->showMeta($stat); | ||
|
||
$ext = $this->getForm()->getHighlightType(fs::ext($zipPath)); | ||
|
||
if ($this->getForm()->findOperation($zipPath, $output, $ext) === false) { | ||
$this->getForm()->showCodeInBrowser($output->readFully(), $ext); | ||
} | ||
}); | ||
|
||
$this->getForm()->updateFileinfo($provider, $zipPath); | ||
} else if ($provider->isDirectory($zipPath)) { | ||
$this->getForm()->fileInfoPanel->updateFileSize("unknown"); | ||
} | ||
} | ||
|
||
private function normalizeZipPath ($provider, $zipPath) | ||
{ | ||
if (!$provider->getZipInstance()->has($zipPath)) { | ||
$zipPath = str_replace('\\', '/', $zipPath); | ||
|
||
if (!$provider->getZipInstance()->has($zipPath)) { | ||
$zipPath = str_replace('/', '\\', $zipPath); | ||
} | ||
} | ||
|
||
return $zipPath; | ||
} | ||
|
||
/** | ||
* @return MainForm | ||
*/ | ||
private function getForm () | ||
{ | ||
return app()->form("MainForm"); | ||
} | ||
} |
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
Oops, something went wrong.