Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing Screen API for convenient manipulation of the GUI Screen …
…model.
- Loading branch information
1 parent
d7440db
commit e978f17
Showing
15 changed files
with
230 additions
and
84 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
21 changes: 8 additions & 13 deletions
21
rapidoid-html/src/main/resources/rapidoid/partials/page-body.html
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,32 +1,27 @@ | ||
{{^error}} | ||
<body class="rapidoid" ng-controller="Main" ng-app="app"> | ||
|
||
<div ng-if="!ajaxBodyContent"> | ||
{{^error}}{{>page-content}}{{/error}} | ||
</div> | ||
<div ng-if="!ajaxBodyContent"> | ||
{{>page-content}} | ||
</div> | ||
|
||
<div compile="ajaxBodyContent" ng-if="ajaxBodyContent"></div> | ||
<div compile="ajaxBodyContent" ng-if="ajaxBodyContent"></div> | ||
|
||
{{>page-modal}} | ||
|
||
{{#dev}} | ||
{{^cdn}} | ||
<script src="/jquery-2.1.4.min.js"></script> | ||
<script src="/bootstrap/js/bootstrap-3.3.5.min.js"></script> | ||
<script src="/angular-1.4.3.min.js"></script> | ||
<script src="/rapidoid.min.js"></script> | ||
{{/dev}} | ||
{{^dev}} | ||
{{/cdn}} | ||
{{#cdn}} | ||
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script> | ||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> | ||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/rapidoid/{{version}}/rapidoid.min.js"></script> | ||
{{/dev}} | ||
{{/cdn}} | ||
|
||
<script src="/app.js"></script> | ||
{{#_js}}<script src="/{{req.name}}.js"></script>{{/_js}} | ||
|
||
{{>page-tail}} | ||
|
||
</body> | ||
{{/error}} | ||
{{#error}}{{>page-error}}{{/error}} |
2 changes: 1 addition & 1 deletion
2
rapidoid-html/src/main/resources/rapidoid/partials/page-brand.html
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 +1 @@ | ||
<a class="navbar-brand" href="{{home}}">{{title}}</a> | ||
<a class="navbar-brand" href="{{home}}">{{{brand}}}</a> |
2 changes: 1 addition & 1 deletion
2
rapidoid-html/src/main/resources/rapidoid/partials/page-embedded.html
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 +1 @@ | ||
{{^error}}{{>page-navbar}}{{{content}}}{{/error}}{{#error}}{{>page-error}}{{/error}} | ||
{{>page-navbar}}{{{content}}} |
20 changes: 0 additions & 20 deletions
20
rapidoid-html/src/main/resources/rapidoid/partials/page-error.html
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
rapidoid-html/src/main/resources/rapidoid/partials/page-modal.html
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
rapidoid-html/src/main/resources/rapidoid/templates/page-ajax.html
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,2 +1 @@ | ||
{{^error}}{{>page-content}}{{/error}} | ||
{{#error}}{{>page-error}}{{/error}} | ||
{{>page-content}} |
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
92 changes: 92 additions & 0 deletions
92
rapidoid-http-fast/src/main/java/org/rapidoid/http/Screen.java
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,92 @@ | ||
package org.rapidoid.http; | ||
|
||
/* | ||
* #%L | ||
* rapidoid-http-fast | ||
* %% | ||
* Copyright (C) 2014 - 2016 Nikolche Mihajlovski and contributors | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
|
||
import org.rapidoid.annotation.Since; | ||
|
||
/** | ||
* Response GUI Screen API.<br> | ||
* Provides a convenient access to some common GUI screen attributes of the underlying MVC model: <code>Resp#model()</code>. | ||
*/ | ||
@Since("5.1.0") | ||
public interface Screen { | ||
|
||
/** | ||
* Sets the "<b>title</b>" attribute in the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().put("title", title)</code>. | ||
*/ | ||
Screen title(String title); | ||
|
||
/** | ||
* Gets the "<b>title</b>" attribute from the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().get("title")</code>. | ||
*/ | ||
String title(); | ||
|
||
/** | ||
* Sets the "<b>brand</b>" attribute in the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().put("brand", brand)</code>. | ||
*/ | ||
Screen brand(Object brand); | ||
|
||
/** | ||
* Gets the "<b>brand</b>" attribute from the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().get("brand")</code>. | ||
*/ | ||
Object brand(); | ||
|
||
/** | ||
* Sets the "<b>menu</b>" attribute in the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().put("menu", menu)</code>. | ||
*/ | ||
Screen menu(Object menu); | ||
|
||
/** | ||
* Gets the "<b>menu</b>" attribute from the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().get("menu")</code>. | ||
*/ | ||
Object menu(); | ||
|
||
/** | ||
* Sets the "<b>search</b>" attribute in the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().put("search", search)</code>. | ||
*/ | ||
Screen search(boolean search); | ||
|
||
/** | ||
* Gets the "<b>search</b>" attribute from the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().get("search")</code>. | ||
*/ | ||
Boolean search(); | ||
|
||
/** | ||
* Sets the "<b>cdn</b>" attribute in the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().put("cdn", cdn)</code>. | ||
*/ | ||
Screen cdn(boolean cdn); | ||
|
||
/** | ||
* Gets the "<b>cdn</b>" attribute from the MVC model of the response, used for GUI screen rendering.<br> | ||
* Equivalent to <code>model().get("cdn")</code>. | ||
*/ | ||
Boolean cdn(); | ||
|
||
} |
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.