Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- 'use strict';
- var network = new Lampa.Reguest();
- var api_url = Lampa.Utils.protocol() + Lampa.Manifest.cub_domain + '/api/collections/';
- function full(params, oncomplete, onerror) {
- network.silent('http://www.kinopoisk.ru/user/2/movies/list/type/3575/sort/default/vector/desc/perpage/10/#list', function (data) {
- // var data1 = {
- // "secuses": true,
- // "page": 1,
- // "results": [
- // {
- // "poster_path": "http://st.kinopoisk.ru/images/film_big/602829.jpg", // https://imagetmdb.com/t/p/w200/
- // "overview": "Согласно календарю индейцев Майя, в 2012 году планеты солнечной системы окажутся на одной линии друг с другом, что приведет к глобальным природным катаклизмам: сильнейшие землетрясения, цунами и извержения вулканов превратят страны и целые континенты в руины. Недавно ученые подтвердили, что этот миф может стать реальностью.",
- // "release_date": "2009-10-10",
- // "id": "14161",
- // "original_title": "2012",
- // "original_language": "en",
- // "title": "2012",
- // "backdrop_path": "/pvxmYJcgrLiYC6G2IQTn1PPNems.jpg",
- // "popularity": "65.108",
- // "vote_count": "11442",
- // "vote_average": "7",
- // "imdb_id": "tt1190080",
- // "status": "Released",
- // "source": "tmdb"
- // },
- // ],
- // "total_pages": 1
- // }
- // console.log(data1);
- // data.total_pages = data.total_pages || 15;
- // oncomplete(data1);
- }, onerror);
- }
- function clear() {
- network.clear();
- }
- var Api = {
- full: full,
- clear: clear
- };
- function component(object) {
- var comp = new Lampa.InteractionCategory(object);
- object.url = 'top-filmov-pro-konets-sveta';
- comp.create = function () {
- Api.full(object, this.build.bind(this), this.empty.bind(this));
- };
- comp.nextPageReuest = function (object, resolve, reject) {
- Api.full(object, resolve.bind(comp), reject.bind(comp));
- };
- return comp;
- }
- function startPlugin() {
- var manifest = {
- type: 'video',
- version: '1.1.1',
- name: 'Кинопоиск',
- description: '',
- component: 'kinopoisk'
- };
- Lampa.Manifest.plugins = manifest;
- Lampa.Component.add('kinopoisk', component);
- function add() {
- var button = $("<li class=\"menu__item selector\">\n <div class=\"menu__ico\">\n <svg width=\"239\" height=\"239\" viewBox=\"0 0 239 239\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\"><path fill=\"currentColor\" d=\"M215 121.415l-99.297-6.644 90.943 36.334a106.416 106.416 0 0 0 8.354-29.69z\" /><path fill=\"currentColor\" d=\"M194.608 171.609C174.933 197.942 143.441 215 107.948 215 48.33 215 0 166.871 0 107.5 0 48.13 48.33 0 107.948 0c35.559 0 67.102 17.122 86.77 43.539l-90.181 48.07L162.57 32.25h-32.169L90.892 86.862V32.25H64.77v150.5h26.123v-54.524l39.509 54.524h32.169l-56.526-57.493 88.564 46.352z\" /><path d=\"M206.646 63.895l-90.308 36.076L215 93.583a106.396 106.396 0 0 0-8.354-29.688z\" fill=\"currentColor\"/></svg>\n </div>\n <div class=\"menu__text\">".concat(manifest.name, "</div>\n </li>"));
- button.on('hover:enter', function () {
- Lampa.Activity.push({
- url: '',
- title: manifest.name,
- component: 'kinopoisk',
- page: 1
- });
- });
- $('.menu .menu__list').eq(0).append(button);
- }
- if (window.appready) add();else {
- Lampa.Listener.follow('app', function (e) {
- if (e.type == 'ready') add();
- });
- }
- }
- if (!window.kinopoisk_ready) startPlugin();
- })();
Advertisement
Add Comment
Please, Sign In to add comment