-
Notifications
You must be signed in to change notification settings - Fork 107
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
93 changed files
with
5,136 additions
and
520 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
engines: | ||
duplication: | ||
enabled: true | ||
config: | ||
languages: | ||
php: | ||
mass_threshold: 50 | ||
fixme: | ||
enabled: true | ||
phpmd: | ||
enabled: true | ||
exclude_fingerprints: | ||
- 908ad3f93985ff14c44615cee6966c72 # View have a lot of public methods. Deal with it. | ||
checks: | ||
Naming/ShortVariable: | ||
enabled: false # because of on() and js() and $ui | ||
Naming/ShortMethodName: | ||
enabled: false # because of on() and js() and $ui | ||
CleanCode/ElseExpression: | ||
enabled: false # gives many incorrect suggestions | ||
Design/CouplingBetweenObjects: | ||
enabled: false # because we always allow to inject overrides! | ||
Controversial/CamelCaseClassName: | ||
enabled: false # because jQuery.php and similar class names | ||
Controversial/CamelCasePropertyName: | ||
enabled: false # becasue we use _xx for private properties (that must remain public) | ||
Controversial/CamelCaseMethodName: | ||
enabled: false # methods start with _xx for private methods (that must remain public) | ||
Design/WeightedMethodCount: | ||
enabled: false # because we solve complex task, our classes may be complex | ||
Design/NpathComplexity: | ||
enabled: false # our code is complex so that your code wouldn't be! | ||
Design/LongMethod: | ||
enabled: false # our code is long so that your code wouldn't be! | ||
CyclomaticComplexity: | ||
enabled: false # our code is complex so that your code wouldn't be! | ||
Controversial/CamelCaseVariableName: | ||
enabled: false # because we call variables $f_login, $m_user for better readability. | ||
radon: | ||
enabled: true | ||
ratings: | ||
paths: | ||
- "src/**" | ||
exclude_paths: | ||
- "docs/**" | ||
- "tests/**" | ||
- "vendor/**" |
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,8 +1,11 @@ | ||
/config.codekit | ||
/phpunit.xml | ||
/.idea | ||
/public/semantic | ||
/public/jquery | ||
/vendor | ||
docs/build | ||
/composer.lock | ||
/build | ||
.DS_Store | ||
*.codekit3 |
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,23 @@ | ||
|
||
## 0.3 | ||
|
||
* Implemented js() and on() #20 | ||
* Implemented Server-Side JS calls #28 | ||
* Implemented Form #29 and #30 | ||
* Enhanced documentation | ||
|
||
## 0.2 | ||
|
||
* Implemented Render Tree | ||
* Implemented Template-based Rendering #15 | ||
* Implemented Basic View #16 | ||
* Implemented Button (based around Semantic UI) | ||
* Implemented JavaScript events | ||
* Advanced JSChains (enclosing, etc) #18 | ||
* Implemented Very Basic Layouts | ||
|
||
## 0.1 | ||
|
||
* Initial Release | ||
* Bootstraped Documentation (sphinx-doc) | ||
* Implemented CI |
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 |
---|---|---|
@@ -1,41 +1,86 @@ | ||
<?php | ||
/** | ||
* Demonstrates how to use layouts | ||
* Demonstrates how to use layouts. | ||
*/ | ||
require '../vendor/autoload.php'; | ||
use \atk4\ui\Button; | ||
use \atk4\ui\Buttons; | ||
use \atk4\ui\H2; | ||
use \atk4\ui\Icon; | ||
use \atk4\ui\Label; | ||
use \atk4\ui\Template; | ||
use \atk4\ui\View; | ||
|
||
require'../vendor/autoload.php'; | ||
use \atk4\ui\Button; | ||
use \atk4\ui\Buttons; | ||
use \atk4\ui\Label; | ||
use \atk4\ui\Icon; | ||
use \atk4\ui\View; | ||
use \atk4\ui\Template; | ||
try { | ||
$layout = new \atk4\ui\Layout\App(['defaultTemplate'=>'./templates/layout2.html']); | ||
|
||
$layout->add(new H2('Basic Button')); | ||
$layout->add(new Button())->set('Click me'); | ||
|
||
$layout->add(new H2('Properties')); | ||
|
||
$b1 = new Button(); | ||
$b2 = new Button(); | ||
$b3 = new Button(); | ||
|
||
try { | ||
$b1->set(['Load', 'primary']); | ||
$b2->set(['Load', 'labeled', 'icon'=>'pause']); | ||
$b3->set(['Next', 'right labeled', 'icon'=>'right arrow']); | ||
$layout->add($b1); | ||
$layout->add($b2); | ||
$layout->add($b3); | ||
|
||
$layout = new \atk4\ui\Layout\App(['template'=>'./templates/layout2.html']); | ||
$button = new Button(); | ||
$button->set('Click me'); | ||
$button->set(['primary' => true]); | ||
$button->set(['icon'=>'check']); | ||
$button->set(['size big'=>true]); | ||
|
||
$layout->add(new H2('Big Button')); | ||
|
||
$view = new View(['template'=>new Template('Hello, {$tag1}, my name is {$tag2}')]); | ||
$layout->add($button); | ||
|
||
$view->add(new Button('World'), 'tag1'); | ||
$view->add(new Button(['Agile UI', 'blue']), 'tag2'); | ||
$layout->add(new H2('Button Intent')); | ||
|
||
$b_yes = new Button(['Yes', 'positive basic']); | ||
$b_no = new Button(['No', 'negative basic']); | ||
$layout->add($b_yes); | ||
$layout->add($b_no); | ||
|
||
$layout->add(new H2('Combining Buttons')); | ||
$bar = new Buttons('vertical'); // NOTE: class called Buttons, not Button | ||
$bar->add(new Button(['Play', 'icon'=>'play'])); | ||
$bar->add(new Button(['Pause', 'icon'=>'pause'])); | ||
$bar->add(new Button(['Shuffle', 'icon'=>'shuffle'])); | ||
|
||
$layout->add($bar); | ||
|
||
$layout->add($view); | ||
$layout->add(new H2('Icon Bar')); | ||
$bar = new Buttons('blue big'); | ||
$bar->add(new Button(['icon'=>'file'])); | ||
$bar->add(new Button(['icon'=>['save', 'yellow']])); | ||
$bar->add(new Button(['icon'=>'upload', 'disabled'=>true])); | ||
$layout->add($bar); | ||
|
||
$layout->add(new H2('Forks')); | ||
$forks = new Button(['labeled'=> true]); // Button, not Buttons! | ||
$forks->add(new Button(['Forks', 'blue']))->add(new Icon('fork')); | ||
$forks->add(new Label(['1,048', 'basic blue left pointing'])); | ||
$layout->add($forks); | ||
|
||
echo $layout->render(); | ||
$layout->add(new H2('Custom Template')); | ||
$view = new View(['template'=>new Template('Hello, {$tag1}, my name is {$tag2}')]); | ||
|
||
$view->add(new Button('World'), 'tag1'); | ||
$view->add(new Button(['Agile UI', 'blue']), 'tag2'); | ||
|
||
}catch(\atk4\core\Exception $e){ | ||
var_Dump($e->getMessage()); | ||
$layout->add($view); | ||
|
||
var_Dump($e->getParams()); | ||
echo $layout->render(); | ||
} catch (\atk4\core\Exception $e) { | ||
var_dump($e->getMessage()); | ||
|
||
var_dump($e->getParams()); | ||
var_dump($e->getTrace()); | ||
throw $e; | ||
} | ||
|
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,41 @@ | ||
<?php | ||
/** | ||
* Demonstrates how to use interractive buttons. | ||
*/ | ||
require '../vendor/autoload.php'; | ||
use \atk4\ui\Button; | ||
use \atk4\ui\Buttons; | ||
use \atk4\ui\H2; | ||
|
||
try { | ||
$layout = new \atk4\ui\Layout\App(['defaultTemplate'=>'./templates/layout2.html']); | ||
|
||
$layout->js(true, new \atk4\ui\jsExpression('$.fn.api.settings.successTest = function(response) { | ||
if(response && response.eval) { | ||
var result = function(){ eval(response.eval); }.call(this.obj); | ||
} | ||
return false; | ||
}')); | ||
|
||
$layout->add(new H2('Basic Button')); | ||
|
||
$b = $layout->add(new Button(['id'=>'b1']))->set('Hidden Button'); | ||
$b->js(true)->hide(); | ||
|
||
$b = $layout->add(new Button(['id'=>'b2']))->set('Hide on click Button'); | ||
$b->js('click')->hide(); | ||
|
||
$layout->add(new H2('Callbacks')); | ||
|
||
$b = $layout->add(new Button(['id'=>'b3']))->set('Callback Test'); | ||
$b->on('click', function ($b) { | ||
return $b->text(rand(1, 20)); | ||
}); | ||
|
||
echo $layout->render(); | ||
} catch (\atk4\core\Exception $e) { | ||
var_dump($e->getMessage()); | ||
|
||
var_dump($e->getParams()); | ||
throw $e; | ||
} |
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,30 @@ | ||
<?php | ||
/** | ||
* Testing fields. | ||
*/ | ||
require '../vendor/autoload.php'; | ||
|
||
try { | ||
$layout = new \atk4\ui\Layout\App(['defaultTemplate'=>'./templates/layout2.html']); | ||
|
||
$layout->add(new \atk4\ui\H2('Checkboxes')); | ||
|
||
$layout->add(new \atk4\ui\FormField\Checkbox('Make my profile visible')); | ||
|
||
$layout->add(new \atk4\ui\View(['ui'=>'divider'])); | ||
$layout->add(new \atk4\ui\FormField\Checkbox(['Accept terms and conditions', 'slider'])); | ||
|
||
$layout->add(new \atk4\ui\View(['ui'=>'divider'])); | ||
$layout->add(new \atk4\ui\FormField\Checkbox(['Subscribe to weekly newsletter', 'toggle'])); | ||
|
||
$layout->add(new \atk4\ui\View(['ui'=>'divider'])); | ||
$layout->add(new \atk4\ui\FormField\Checkbox(['Custom setting?']))->js(true)->checkbox('set indeterminate'); | ||
|
||
echo $layout->render(); | ||
} catch (\atk4\core\Exception $e) { | ||
var_dump($e->getMessage()); | ||
|
||
var_dump($e->getParams()); | ||
var_dump($e->getTrace()); | ||
throw $e; | ||
} |
Oops, something went wrong.