diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c99835 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# NOTE: Thinking about adding files created by your operating system, IDE, +# or text editor here? Don't! Add them to your per-user .gitignore instead. + + +/src/.phutil_module_cache diff --git a/rsrc/css/light-rtl.css b/rsrc/css/light-rtl.css new file mode 100644 index 0000000..4a2474e --- /dev/null +++ b/rsrc/css/light-rtl.css @@ -0,0 +1,19 @@ +/** + * @provides light-rtl + */ + + +.light-rtl-righttoleft .phabricator-remarkup { + text-align: right; + direction: rtl; +} + +.light-rtl-righttoleft .phabricator-remarkup ul.remarkup-list, +.light-rtl-righttoleft .phabricator-remarkup ol.remarkup-list { + margin: 12px 30px 12px 0; +} + + +.light-rtl-righttoleft div.phabricator-remarkup > *:last-child { + margin-bottom: 0; +} diff --git a/src/__phutil_library_init__.php b/src/__phutil_library_init__.php new file mode 100644 index 0000000..f743ae5 --- /dev/null +++ b/src/__phutil_library_init__.php @@ -0,0 +1,3 @@ + 2, + 'class' => array( + 'LightweightRTLApplication' => 'application/LightweightRTLApplication.php', + 'LightweightRTLCelerityResources' => 'celerity/LightweightRTLCelerityResources.php', + 'LightweightRTLMainMenuBarExtension' => 'engineextension/LightweightRTLMainMenuBarExtension.php', + ), + 'function' => array(), + 'xmap' => array( + 'LightweightRTLApplication' => 'PhabricatorApplication', + 'LightweightRTLCelerityResources' => 'CelerityResourcesOnDisk', + 'LightweightRTLMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension', + ), +)); diff --git a/src/application/LightweightRTLApplication.php b/src/application/LightweightRTLApplication.php new file mode 100644 index 0000000..004746d --- /dev/null +++ b/src/application/LightweightRTLApplication.php @@ -0,0 +1,13 @@ +getPath('../rsrc'); + } + public function getPathToMap() { + return $this->getPath('celerity/map.php'); + } + + private function getPath($to_file) { + return (phutil_get_library_root('light-rtl')).'/'.$to_file; + } +} diff --git a/src/celerity/map.php b/src/celerity/map.php new file mode 100644 index 0000000..3a514eb --- /dev/null +++ b/src/celerity/map.php @@ -0,0 +1,17 @@ + array( + 'css/light-rtl.css' => 'ef50d5d5', + ), + 'symbols' => array( + 'light-rtl' => 'ef50d5d5', + ), + 'requires' => array(), + 'packages' => array(), +); diff --git a/src/engineextension/LightweightRTLMainMenuBarExtension.php b/src/engineextension/LightweightRTLMainMenuBarExtension.php new file mode 100644 index 0000000..46d8f90 --- /dev/null +++ b/src/engineextension/LightweightRTLMainMenuBarExtension.php @@ -0,0 +1,30 @@ +setHref('#') + ->setTag('a') + ->addClass('phabricator-core-login-button') + ->setText(pht('Right-To-Left')) + ->setNoCSS(true) + + ->addSigil('has-tooltip') + ->addSigil('jx-toggle-class') + ->setMetadata(array( + 'tip' => pht('Switch text direction'), + 'map' => array( + 'phabricator-standard-page' => 'light-rtl-righttoleft', + ))), + ); + } + +}