💥 Función located() pasa a at() en activos

This commit is contained in:
Manuel Cillero 2023-07-11 18:45:02 +02:00
parent a9a70fca46
commit 44550edafa
10 changed files with 13 additions and 13 deletions

View file

@ -24,7 +24,7 @@ impl ThemeTrait for Aliner {
fn before_prepare_page(&self, page: &mut Page) {
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")))
.alter_context(ContextOp::AddStyleSheet(
StyleSheet::located("/aliner/css/styles.css").with_weight(-99),
StyleSheet::at("/aliner/css/styles.css").with_weight(-99),
));
}
}

View file

@ -46,12 +46,12 @@ impl ThemeTrait for Bootsier {
fn before_prepare_page(&self, page: &mut Page) {
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")))
.alter_context(ContextOp::AddStyleSheet(
StyleSheet::located("/bootsier/css/bootstrap.min.css")
StyleSheet::at("/bootsier/css/bootstrap.min.css")
.with_version("5.1.3")
.with_weight(-99),
))
.alter_context(ContextOp::AddJavaScript(
JavaScript::located("/bootsier/js/bootstrap.bundle.min.js")
JavaScript::at("/bootsier/js/bootstrap.bundle.min.js")
.with_version("5.1.3")
.with_weight(-99),
));

View file

@ -34,7 +34,7 @@ impl ThemeTrait for Bulmix {
fn before_prepare_page(&self, page: &mut Page) {
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")))
.alter_context(ContextOp::AddStyleSheet(
StyleSheet::located("/bulmix/css/bulma.min.css")
StyleSheet::at("/bulmix/css/bulma.min.css")
.with_version("0.9.4")
.with_weight(-99),
));

View file

@ -35,7 +35,7 @@ impl ModuleTrait for HomeDemo {
async fn demo(request: service::HttpRequest) -> ResultPage<Markup, FatalError> {
Page::new(request)
.with_title(L10n::t("page_title", &LOCALE_HOMEDEMO))
.with_context(ContextOp::AddStyleSheet(StyleSheet::located(
.with_context(ContextOp::AddStyleSheet(StyleSheet::at(
"/homedemo/css/styles.css",
)))
.with_body_classes(ClassesOp::AddFirst, "default-homepage")

View file

@ -47,7 +47,7 @@ impl JQuery {
fn before_render_page(page: &mut Page) {
if let Some(true) = page.context().get_param::<bool>(PARAM_JQUERY) {
page.context().alter(ContextOp::AddJavaScript(
JavaScript::located("/jquery/jquery.min.js")
JavaScript::at("/jquery/jquery.min.js")
.with_version("3.6.0")
.with_weight(isize::MIN)
.with_mode(ModeJS::Normal),

View file

@ -194,13 +194,13 @@ impl ComponentTrait for MegaMenu {
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
cx.alter(ContextOp::AddStyleSheet(
StyleSheet::located("/megamenu/css/menu.css").with_version("1.1.1"),
StyleSheet::at("/megamenu/css/menu.css").with_version("1.1.1"),
))
.alter(ContextOp::AddStyleSheet(
StyleSheet::located("/megamenu/css/menu-clean.css").with_version("1.1.1"),
StyleSheet::at("/megamenu/css/menu-clean.css").with_version("1.1.1"),
))
.alter(ContextOp::AddJavaScript(
JavaScript::located("/megamenu/js/menu.min.js").with_version("1.1.1"),
JavaScript::at("/megamenu/js/menu.min.js").with_version("1.1.1"),
));
JQuery.enable_jquery(cx);

View file

@ -30,7 +30,7 @@ impl ComponentTrait for Icon {
fn before_prepare_component(&mut self, cx: &mut Context) {
cx.alter(ContextOp::AddStyleSheet(
StyleSheet::located("/minimal/icons/bootstrap-icons.css").with_version("1.8.2"),
StyleSheet::at("/minimal/icons/bootstrap-icons.css").with_version("1.8.2"),
));
}

View file

@ -30,7 +30,7 @@ impl ThemeTrait for Basic {
fn before_prepare_page(&self, page: &mut Page) {
page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico")))
.alter_context(ContextOp::AddStyleSheet(
StyleSheet::located("/theme/css/normalize.min.css").with_version("8.0.1"),
StyleSheet::at("/theme/css/normalize.min.css").with_version("8.0.1"),
));
}
}

View file

@ -40,7 +40,7 @@ impl AssetsTrait for JavaScript {
}
impl JavaScript {
pub fn located<S>(path: S) -> Self
pub fn at<S>(path: S) -> Self
where
S: Into<String>,
{

View file

@ -38,7 +38,7 @@ impl AssetsTrait for StyleSheet {
}
impl StyleSheet {
pub fn located<S>(path: S) -> Self
pub fn at<S>(path: S) -> Self
where
S: Into<String>,
{