Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
nemo.travel.frontend
Advanced tools
Readme
Виджет nemo.travel.frontend встраивается в уже существующий сайт, позволяет осуществлять поиск авиабилетов и отелей, и призван облегчить интеграцию с системой Nemo.travel.
Для начала, необходимо получить файлы виджета. Сделать это можно несколькими путями:
npm install -S nemo.travel.frontend
Далее, необходимо инициализировать виджет на странице.
Подключите на страницу файлы, необходимые для работы виджета:
<link rel="stylesheet" href="{путь_до_файлов_виджета}/css/style.css">
<link rel="stylesheet" href="{путь_до_файлов_виджета}/js/lib/lightslider/dist/css/lightslider.min.css">
<!--[if IE 9]>
<link rel="stylesheet" href="{путь_до_файлов_виджета}/css/ie9.css">
<![endif]-->
<script src="{путь_до_файлов_виджета}/js/lib/requirejs/v.2.1.15/require.js"></script>
Добавьте на страницу HTML-код, указанный ниже (он необходим для инициализации виджета и является его контейнером):
<div class="nemo-root nemo-widget nemo-widget_flights js-nemoApp">
<!-- ko if: component() -->
<div data-bind="component: {
name: component,
params: {
route: componentRoute(),
additional: componentAdditionalParams()
}
}">
<div class="nemo-common-appLoader"></div>
</div>
<!-- /ko -->
<!-- ko if: !component() && !globalError() -->
<div class="nemo-common-appLoader"></div>
<!-- /ko -->
<!-- ko if: globalError() -->
<div class="nemo-common-appError" data-bind="text: globalError"></div>
<!-- /ko -->
</div>
Объявите глобальную JavaScript
переменную nemoSourceHost
, поместите в неё URL-адрес,
который будет являться корневым для виджета и подключите файл {путь_до_файлов_виджета}/main.js
(переменная nemoSourceHost
используется в {путь_до_файлов_виджета}/main.js
).
Если не создавать переменную, то в качестве корневого URL будет использоваться document.location.origin
.
Чаще всего, в неё необходимо помещать URL-адрес на котором находятся файлы виджета, или не создавать переменную вовсе.
Пример создания переменной и её заполнение с использованием языка PHP
:
<script>
var nemoSourceHost = '<?php echo "http" . (isset($_SERVER["HTTPS"]) ? "s" : "") . "://" . $_SERVER["HTTP_HOST"]; ?>';
</script>
<script src="{путь_до_файлов_виджета}/main.js"></script>
Последний этап - инициализация виджета:
<script>
require(
['initWidget'],
function (initWidget) {
var initConfig = {
dataURL: 'http://demo.nemo.travel/api',
staticInfoURL: '//demo.nemo.travel'
},
controller = initWidget(document.getElementsByClassName('js-nemoApp')[0], initConfig);
}
);
</script>
FAQs
Nemo.travel flights and hotels search widget.
The npm package nemo.travel.frontend receives a total of 2 weekly downloads. As such, nemo.travel.frontend popularity was classified as not popular.
We found that nemo.travel.frontend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.