Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../js
File: admin.js
this.$el.addClass('stream-loading');
[2000] Fix | Delete
[2001] Fix | Delete
model = new StreamModel({id: id});
[2002] Fix | Delete
[2003] Fix | Delete
request = model.fetch();
[2004] Fix | Delete
request.done(
[2005] Fix | Delete
function (response, status, xhr) {
[2006] Fix | Delete
var view, attribute, value;
[2007] Fix | Delete
if (response.feeds && typeof response.feeds === 'string') {
[2008] Fix | Delete
response.feeds = JSON.parse(response.feeds);
[2009] Fix | Delete
}
[2010] Fix | Delete
[2011] Fix | Delete
for (attribute in response) {
[2012] Fix | Delete
value = response[attribute];
[2013] Fix | Delete
model.set(attribute, typeof value === 'string' ? stripslashes(value) : value)
[2014] Fix | Delete
}
[2015] Fix | Delete
[2016] Fix | Delete
console.log('new StreamView')
[2017] Fix | Delete
view = new StreamView({model: model});
[2018] Fix | Delete
streamModels.add(model);
[2019] Fix | Delete
[2020] Fix | Delete
FlowFlow.$streamsContainer.append(view.$el);
[2021] Fix | Delete
[2022] Fix | Delete
self.$el.removeClass('stream-loading');
[2023] Fix | Delete
[2024] Fix | Delete
defer.resolve(id);
[2025] Fix | Delete
[2026] Fix | Delete
setTimeout(function () {
[2027] Fix | Delete
if (!viewStays) FlowFlow.switchToView(id);
[2028] Fix | Delete
},100)
[2029] Fix | Delete
[2030] Fix | Delete
}
[2031] Fix | Delete
).fail (function () {
[2032] Fix | Delete
alert('Something went wrong, please try to reload page')
[2033] Fix | Delete
self.$el.removeClass('stream-loading');
[2034] Fix | Delete
defer.reject();
[2035] Fix | Delete
})
[2036] Fix | Delete
[2037] Fix | Delete
} else {
[2038] Fix | Delete
if (!viewStays) FlowFlow.switchToView(id);
[2039] Fix | Delete
defer.resolve(id);
[2040] Fix | Delete
}
[2041] Fix | Delete
[2042] Fix | Delete
return defer.promise()
[2043] Fix | Delete
},
[2044] Fix | Delete
destroy: function() {
[2045] Fix | Delete
var promise = FlowFlow.popup('Just checking for misclick. Delete stream?');
[2046] Fix | Delete
var self = this;
[2047] Fix | Delete
[2048] Fix | Delete
promise.then(function(){
[2049] Fix | Delete
var id = self.model.get('id');
[2050] Fix | Delete
var request = self.model.destroy();
[2051] Fix | Delete
FlowFlow.makeOverlayTo('show');
[2052] Fix | Delete
[2053] Fix | Delete
request.done(function( stream ){
[2054] Fix | Delete
if ( stream && stream.error ) return;
[2055] Fix | Delete
self.remove();
[2056] Fix | Delete
if (streamRowModels.length === 0) {
[2057] Fix | Delete
FlowFlow.$list.append(templates.streamRowEmpty);
[2058] Fix | Delete
}
[2059] Fix | Delete
}).always(function(){
[2060] Fix | Delete
FlowFlow.makeOverlayTo('hide');
[2061] Fix | Delete
}).fail(function(){
[2062] Fix | Delete
alert('Something went wrong, please try to reload page');
[2063] Fix | Delete
})
[2064] Fix | Delete
},function(){})
[2065] Fix | Delete
},
[2066] Fix | Delete
clone: function() {
[2067] Fix | Delete
var self = this;
[2068] Fix | Delete
var request = self.model.clone();
[2069] Fix | Delete
[2070] Fix | Delete
FlowFlow.makeOverlayTo('show');
[2071] Fix | Delete
request.done(function(stream){
[2072] Fix | Delete
var model = streamRowModels.get(stream.id)
[2073] Fix | Delete
var view = new StreamRowView({model: model});
[2074] Fix | Delete
FlowFlow.$list.append(view.$el);
[2075] Fix | Delete
view.render();
[2076] Fix | Delete
}).always(function(){
[2077] Fix | Delete
FlowFlow.makeOverlayTo('hide');
[2078] Fix | Delete
}).fail(function(){
[2079] Fix | Delete
alert('Something went wrong, please try to reload page');
[2080] Fix | Delete
})
[2081] Fix | Delete
},
[2082] Fix | Delete
[2083] Fix | Delete
getShortcodePages: function() {
[2084] Fix | Delete
[2085] Fix | Delete
var id = this.model.get('id');
[2086] Fix | Delete
[2087] Fix | Delete
var data = {
[2088] Fix | Delete
action: la_plugin_slug_down + '_get_shortcode_pages',
[2089] Fix | Delete
stream: id,
[2090] Fix | Delete
security: vars.nonce
[2091] Fix | Delete
}
[2092] Fix | Delete
[2093] Fix | Delete
var $hint = this.$el.find( '.shortcode-pages' );
[2094] Fix | Delete
[2095] Fix | Delete
$hint.html( '<span>.</span><span>.</span><span>.</span>' );
[2096] Fix | Delete
[2097] Fix | Delete
this.ajaxPages = $.post( vars.ajaxurl, data ).done(function( res ){
[2098] Fix | Delete
console.log( res );
[2099] Fix | Delete
var pages = '';
[2100] Fix | Delete
[2101] Fix | Delete
var data = JSON.parse( res );
[2102] Fix | Delete
var page;
[2103] Fix | Delete
[2104] Fix | Delete
if ( !data.length ) {
[2105] Fix | Delete
$hint.html( 'No pages found' );
[2106] Fix | Delete
return
[2107] Fix | Delete
}
[2108] Fix | Delete
[2109] Fix | Delete
for ( var i = 0, len = data.length; i < len; i++ ) {
[2110] Fix | Delete
page = data[ i ];
[2111] Fix | Delete
pages += '<a href="' + page.url + '" target="_blank">' + page.post_title + '</a><br>';
[2112] Fix | Delete
}
[2113] Fix | Delete
[2114] Fix | Delete
$hint.html( pages );
[2115] Fix | Delete
})
[2116] Fix | Delete
.fail(function() {
[2117] Fix | Delete
$hint.html( 'Something went wrong, please report error.' );
[2118] Fix | Delete
})
[2119] Fix | Delete
},
[2120] Fix | Delete
[2121] Fix | Delete
cancelGetShortcodePages: function () {
[2122] Fix | Delete
if ( this.ajaxPages ) this.ajaxPages.abort();
[2123] Fix | Delete
this.$el.find( '.shortcode-pages' ).html('');
[2124] Fix | Delete
},
[2125] Fix | Delete
[2126] Fix | Delete
selectShortcode: function(e){
[2127] Fix | Delete
var el = e.target;
[2128] Fix | Delete
var doc = window.document, sel, range;
[2129] Fix | Delete
if (window.getSelection && doc.createRange) {
[2130] Fix | Delete
sel = window.getSelection();
[2131] Fix | Delete
range = doc.createRange();
[2132] Fix | Delete
range.selectNodeContents(el);
[2133] Fix | Delete
sel.removeAllRanges();
[2134] Fix | Delete
sel.addRange(range);
[2135] Fix | Delete
} else if (doc.body.createTextRange) {
[2136] Fix | Delete
range = doc.body.createTextRange();
[2137] Fix | Delete
range.moveToElementText(el);
[2138] Fix | Delete
range.select();
[2139] Fix | Delete
}
[2140] Fix | Delete
}
[2141] Fix | Delete
});
[2142] Fix | Delete
[2143] Fix | Delete
StreamView = Backbone.View.extend({
[2144] Fix | Delete
tagname: "div",
[2145] Fix | Delete
template: _.template(templates.stream),
[2146] Fix | Delete
className: "section-stream",
[2147] Fix | Delete
streams: [],
[2148] Fix | Delete
rowModel: null,
[2149] Fix | Delete
rowView: null,
[2150] Fix | Delete
currentId: 'new',
[2151] Fix | Delete
$preview: null,
[2152] Fix | Delete
events: {
[2153] Fix | Delete
"click .admin-button.submit-button": "saveViaAjax",
[2154] Fix | Delete
"change input, textarea": "updateModel",
[2155] Fix | Delete
"input [type=range]": "updateModel",
[2156] Fix | Delete
"colorpicker-change input": "updateModel",
[2157] Fix | Delete
"change select:not(.stream-streams__select select)": "updateModel",
[2158] Fix | Delete
"click .disabled-button": "disableAction",
[2159] Fix | Delete
// "click .stream-streams__item": "showPreview",
[2160] Fix | Delete
"click .stream-feeds__item": "detachFeed",
[2161] Fix | Delete
"click .stream-feeds__block": "displayFeedsSelect",
[2162] Fix | Delete
"click .stream-feeds__btn": "connectFeed",
[2163] Fix | Delete
"change [id^=stream-layout]": "changeDesignMode",
[2164] Fix | Delete
"change .input-not-obvious input": "saveName",
[2165] Fix | Delete
"keyup .input-not-obvious input": "saveName",
[2166] Fix | Delete
"change .design-step-2 select[id*=align]" : "previewChangeAlign",
[2167] Fix | Delete
"change .design-step-2 select[id*=icons-style]" : "previewChangeIconsLook",
[2168] Fix | Delete
"change .design-step-2 select[id*=upic-pos]" : "previewChangeUpic",
[2169] Fix | Delete
"change .design-step-2 select[id*=upic-style]" : "previewChangeCorners",
[2170] Fix | Delete
"change .design-step-2 select[id*=icon-style]" : "previewChangeIcon",
[2171] Fix | Delete
"keyup .design-step-2 input[id*=bradius]" : "previewChangeBradius",
[2172] Fix | Delete
"keyup .design-step-2 [id*=width]" : "previewChangeWidth",
[2173] Fix | Delete
"change .layout-compact select[id*=compact-style]" : "previewChangeCompact",
[2174] Fix | Delete
//"change .style-choice select[id*=gc-style]" : "previewChangeStyle",
[2175] Fix | Delete
"change .theme-choice input" : "previewChangeTheme"
[2176] Fix | Delete
},
[2177] Fix | Delete
[2178] Fix | Delete
initialize: function() {
[2179] Fix | Delete
//this.listenTo(this.model, "change", this.render);
[2180] Fix | Delete
var self = this;
[2181] Fix | Delete
var rowModel, rowView;
[2182] Fix | Delete
var rendered = this.rendered;
[2183] Fix | Delete
[2184] Fix | Delete
this.model.view = this;
[2185] Fix | Delete
[2186] Fix | Delete
this.render();
[2187] Fix | Delete
[2188] Fix | Delete
this.model.listenTo(this, 'changeModel', function (data){
[2189] Fix | Delete
// console.log('changeModel event', data);
[2190] Fix | Delete
self.model.set(data.name, data.val);
[2191] Fix | Delete
})
[2192] Fix | Delete
[2193] Fix | Delete
if (this.model.isNew()) {
[2194] Fix | Delete
[2195] Fix | Delete
} else {
[2196] Fix | Delete
this.rowModel = streamRowModels.get(this.model.get('id'));
[2197] Fix | Delete
console.log('binding models..')
[2198] Fix | Delete
this.bindModels();
[2199] Fix | Delete
}
[2200] Fix | Delete
[2201] Fix | Delete
this.$preview = this.$el.find('.preview .ff-stream-wrapper');
[2202] Fix | Delete
[2203] Fix | Delete
self.on('preview-update', function () {
[2204] Fix | Delete
var $item = self.$preview.find('.ff-item')
[2205] Fix | Delete
if ($item.find('.ff-item-cont').children().first().is('.ff-item-meta')) {
[2206] Fix | Delete
$item.addClass('ff-meta-first')
[2207] Fix | Delete
} else {
[2208] Fix | Delete
$item.removeClass('ff-meta-first')
[2209] Fix | Delete
}
[2210] Fix | Delete
});
[2211] Fix | Delete
[2212] Fix | Delete
},
[2213] Fix | Delete
[2214] Fix | Delete
bindModels: function () {
[2215] Fix | Delete
var self = this;
[2216] Fix | Delete
[2217] Fix | Delete
this.model.listenTo(feedsModel, 'change', function(changedModel){
[2218] Fix | Delete
var streamFeeds = this.get('feeds');
[2219] Fix | Delete
var allFeeds = feedsModel.get('feeds');
[2220] Fix | Delete
var changedFeeds = changedModel.get('feeds_changed');
[2221] Fix | Delete
var triggerRender = false, indexToDelete = -1;
[2222] Fix | Delete
[2223] Fix | Delete
_.each(streamFeeds, function (feed, index) {
[2224] Fix | Delete
var changed = changedFeeds[feed.id];
[2225] Fix | Delete
if (changed) {
[2226] Fix | Delete
if (changed['state'] === 'changed') {
[2227] Fix | Delete
streamFeeds[index] = allFeeds[feed.id];
[2228] Fix | Delete
triggerRender = true;
[2229] Fix | Delete
} else if (changed['state'] === 'deleted') {
[2230] Fix | Delete
indexToDelete = index;
[2231] Fix | Delete
triggerRender = true;
[2232] Fix | Delete
}
[2233] Fix | Delete
}
[2234] Fix | Delete
});
[2235] Fix | Delete
[2236] Fix | Delete
if (indexToDelete > -1) streamFeeds.splice(indexToDelete, 1);
[2237] Fix | Delete
[2238] Fix | Delete
if (triggerRender) {
[2239] Fix | Delete
this.view.renderConnectedFeeds();
[2240] Fix | Delete
}
[2241] Fix | Delete
[2242] Fix | Delete
console.log('stream listening to feedsModel');
[2243] Fix | Delete
}, this);
[2244] Fix | Delete
[2245] Fix | Delete
this.rowModel.listenTo(this.model, 'stream-saved', function (model) {
[2246] Fix | Delete
var attrs = self.model.attributes;
[2247] Fix | Delete
for (var prop in attrs) {
[2248] Fix | Delete
if (self.rowModel['attributes'][prop] !== undefined) {
[2249] Fix | Delete
if (typeof attrs[prop] === 'object') {
[2250] Fix | Delete
self.rowModel.set(prop, _.clone(attrs[prop]));
[2251] Fix | Delete
} else {
[2252] Fix | Delete
self.rowModel.set(prop, attrs[prop]);
[2253] Fix | Delete
}
[2254] Fix | Delete
}
[2255] Fix | Delete
}
[2256] Fix | Delete
})
[2257] Fix | Delete
},
[2258] Fix | Delete
[2259] Fix | Delete
render: function() {
[2260] Fix | Delete
[2261] Fix | Delete
var id = this.model.get('id');
[2262] Fix | Delete
var self = this;
[2263] Fix | Delete
console.log('render stream view');
[2264] Fix | Delete
[2265] Fix | Delete
if ( !this.rendered || !this.currentId ) {
[2266] Fix | Delete
this.$el.attr('data-view-mode', 'streams-update').attr('id', 'stream-view-' + (id || 'new'));
[2267] Fix | Delete
[2268] Fix | Delete
this.$el.html(this.template({
[2269] Fix | Delete
id: id || 'new',
[2270] Fix | Delete
plugin_url: window.plugin_url,
[2271] Fix | Delete
header: id && id != 'new' ? 'Stream #' + id : 'Creating...',
[2272] Fix | Delete
version: window.plugin_ver,
[2273] Fix | Delete
TV: templates.tv ? _.template(templates.tv)({id:id}) : '',
[2274] Fix | Delete
TVtab: templates.tvTab || ''
[2275] Fix | Delete
}))
[2276] Fix | Delete
[2277] Fix | Delete
setTimeout(function () {
[2278] Fix | Delete
self.$el.find(".input-not-obvious input").autoresize({padding:1,minWidth:56,maxWidth:400});
[2279] Fix | Delete
})
[2280] Fix | Delete
FlowFlow.tabsCursor.initFor(this.$el, id);
[2281] Fix | Delete
[2282] Fix | Delete
setTimeout(function () {
[2283] Fix | Delete
self.$preview = self.$el.find('.preview .ff-stream-wrapper');
[2284] Fix | Delete
[2285] Fix | Delete
self.configDesign();
[2286] Fix | Delete
self.applySavedTemplate();
[2287] Fix | Delete
self.trigger('preview-update');
[2288] Fix | Delete
},0)
[2289] Fix | Delete
[2290] Fix | Delete
this.setupCloudToggle();
[2291] Fix | Delete
}
[2292] Fix | Delete
[2293] Fix | Delete
this.setInputsValue();
[2294] Fix | Delete
this.renderConnectedFeeds();
[2295] Fix | Delete
[2296] Fix | Delete
this.currentId = id;
[2297] Fix | Delete
this.rendered = true;
[2298] Fix | Delete
[2299] Fix | Delete
$(document).trigger('stream_view_built', this.$el);
[2300] Fix | Delete
[2301] Fix | Delete
},
[2302] Fix | Delete
[2303] Fix | Delete
saveName: function (e) {
[2304] Fix | Delete
[2305] Fix | Delete
var val = e.target.value;
[2306] Fix | Delete
var type = e.type;
[2307] Fix | Delete
var oldval
[2308] Fix | Delete
[2309] Fix | Delete
if (/*e.type === 'change' ||*/ e.type === 'keyup' && e.keyCode == 13) {
[2310] Fix | Delete
this.saveViaAjax();
[2311] Fix | Delete
}
[2312] Fix | Delete
},
[2313] Fix | Delete
[2314] Fix | Delete
saving: false,
[2315] Fix | Delete
[2316] Fix | Delete
configDesign: function () {
[2317] Fix | Delete
[2318] Fix | Delete
console.log('config design and cpickers');
[2319] Fix | Delete
var self = this;
[2320] Fix | Delete
this.$el.find('input[type="range"]').on('mouseup', function() {
[2321] Fix | Delete
this.blur();
[2322] Fix | Delete
}).on('change input', function () {
[2323] Fix | Delete
var $t = $(this);
[2324] Fix | Delete
var name = this.name.indexOf('-r-') + 1 ? 'row' : 'column';
[2325] Fix | Delete
var $v = $t.data('el') ? $t.data('el') : $t.next('.range-value');
[2326] Fix | Delete
[2327] Fix | Delete
if (!$v) {
[2328] Fix | Delete
$v = $t.parent().find('.range-value');
[2329] Fix | Delete
$t.data('el', $v)
[2330] Fix | Delete
}
[2331] Fix | Delete
[2332] Fix | Delete
$v.html(this.value + ' ' + name + (this.value > 1 ? 's' : ''));
[2333] Fix | Delete
$t = null;
[2334] Fix | Delete
}).change()/*.rangeslider()*/;
[2335] Fix | Delete
[2336] Fix | Delete
this.$el.find('input[data-color-format]').ColorPickerSliders( this.colorPickersConfig );
[2337] Fix | Delete
[2338] Fix | Delete
// trigger changes
[2339] Fix | Delete
this.$el.find('[id^=stream-layout]:checked, select[id*=upic-pos], select[id*=upic-style], select[id*=icon-style], select[id*=icons-style], .design-step-2 select[id*=align]').change();
[2340] Fix | Delete
this.$el.find('.design-step-2 input[id*=bradius]').keyup();
[2341] Fix | Delete
[2342] Fix | Delete
// make preview sortable
[2343] Fix | Delete
this.$el.find('.ff-item-cont').sortableCustom({
[2344] Fix | Delete
handle: '.ff-item__draggable',
[2345] Fix | Delete
animation: 200,
[2346] Fix | Delete
mimicBg: true,
[2347] Fix | Delete
draggable: '.ff-item__draggable',
[2348] Fix | Delete
onUpdate: function () {
[2349] Fix | Delete
var template = [];
[2350] Fix | Delete
var $preview = self.$el.find('.ff-item-cont');
[2351] Fix | Delete
[2352] Fix | Delete
$preview.children().each(function () {
[2353] Fix | Delete
var role = $(this).data('template');
[2354] Fix | Delete
if (role) template.push(role);
[2355] Fix | Delete
})
[2356] Fix | Delete
[2357] Fix | Delete
self.model.set('template', template);
[2358] Fix | Delete
[2359] Fix | Delete
$preview.find('.ff-label-wrapper').insertAfter($preview.find('.ff-item-meta'));
[2360] Fix | Delete
[2361] Fix | Delete
self.trigger('preview-update');
[2362] Fix | Delete
[2363] Fix | Delete
}
[2364] Fix | Delete
})
[2365] Fix | Delete
},
[2366] Fix | Delete
[2367] Fix | Delete
applySavedTemplate: function () {
[2368] Fix | Delete
var template = this.model.get('template');
[2369] Fix | Delete
var i, len;
[2370] Fix | Delete
var $cont = this.$el.find('.ff-item-cont');
[2371] Fix | Delete
[2372] Fix | Delete
var detached = {
[2373] Fix | Delete
'header': $cont.find('[data-template="header"]').detach(),
[2374] Fix | Delete
'text': $cont.find('[data-template="text"]').detach(),
[2375] Fix | Delete
'image': $cont.find('[data-template="image"]').detach(),
[2376] Fix | Delete
'meta': $cont.find('[data-template="meta"]').detach(),
[2377] Fix | Delete
}
[2378] Fix | Delete
[2379] Fix | Delete
for ( i = 0, len = template.length; i < len; i++ ) {
[2380] Fix | Delete
$cont.append( detached[template[i]] );
[2381] Fix | Delete
}
[2382] Fix | Delete
[2383] Fix | Delete
$cont.find('.ff-label-wrapper').insertAfter( detached.meta );
[2384] Fix | Delete
$cont.find('> .ff-item-bar').appendTo($cont);
[2385] Fix | Delete
},
[2386] Fix | Delete
[2387] Fix | Delete
setupCloudToggle: function () {
[2388] Fix | Delete
[2389] Fix | Delete
var self = this;
[2390] Fix | Delete
var cloud = this.model.get( 'cloud' );
[2391] Fix | Delete
var id = this.model.get( 'id' );
[2392] Fix | Delete
[2393] Fix | Delete
[2394] Fix | Delete
this.$el.find( '.section[data-tab="source"]' ).append( '<label for="stream-' + id + '-boosted" class="switcher cloud-switcher"><input id="stream-' + id + '-boosted" class="switcher cloud-switcher" type="checkbox" name="stream-' + id + '-cloud" value="yep"> <div><div></div></div></label><div class="ff-feeds-counter"><span class="ff-feeds-counter__loaded">.</span>/<span class="ff-feeds-counter__total">.</span> feeds<br><span class="dots-loading">boosted</span></div>' );
[2395] Fix | Delete
[2396] Fix | Delete
// this.$el.find( '#stream-' + id + '-boosted' ).prop( 'checked', cloud == 'yep' );
[2397] Fix | Delete
[2398] Fix | Delete
this.$el.find( '[for=stream-' + id + '-boosted]' ).on( 'click', function ( e ) {
[2399] Fix | Delete
[2400] Fix | Delete
e.preventDefault();
[2401] Fix | Delete
[2402] Fix | Delete
var $t = $( this );
[2403] Fix | Delete
var $inp = $t.find( 'input' );
[2404] Fix | Delete
var currentStreamFeeds = self.model.get('feeds');
[2405] Fix | Delete
[2406] Fix | Delete
if ( ! $inp.is( ":checked" ) ) { // intent to boost all feeds
[2407] Fix | Delete
[2408] Fix | Delete
if ( FlowFlow.availableBoosts !== null ) {
[2409] Fix | Delete
[2410] Fix | Delete
if ( FlowFlow.availableBoosts == 'not_active' ) {
[2411] Fix | Delete
[2412] Fix | Delete
FlowFlow.popup( 'No available boosts to access cloud service, please go to Extra tab for more info', 'neutral', false, { right: 'Learn more', left: 'cancel'} )
[2413] Fix | Delete
.then( function yes (value) {
[2414] Fix | Delete
[2415] Fix | Delete
$( '#addons-tab' ).click();
[2416] Fix | Delete
}, function cancel (reason) {
[2417] Fix | Delete
[2418] Fix | Delete
})
[2419] Fix | Delete
}
[2420] Fix | Delete
else if ( FlowFlow.availableBoosts < currentStreamFeeds.length ) {
[2421] Fix | Delete
[2422] Fix | Delete
FlowFlow.popup( 'Not enough available boosts, please free up boosts from other feeds or upgrade plan on Extra tab', 'neutral', false, { right: 'Go to extra', left: 'cancel'} )
[2423] Fix | Delete
.then( function yes (value) {
[2424] Fix | Delete
$( '#addons-tab' ).click();
[2425] Fix | Delete
}, function cancel (reason) {
[2426] Fix | Delete
[2427] Fix | Delete
})
[2428] Fix | Delete
[2429] Fix | Delete
} else {
[2430] Fix | Delete
[2431] Fix | Delete
// then check if feeds in other streams
[2432] Fix | Delete
// cancel if found
[2433] Fix | Delete
var streams = streamRowModels.models;
[2434] Fix | Delete
var found;
[2435] Fix | Delete
var cancelCloudChange;
[2436] Fix | Delete
var streamFeeds;
[2437] Fix | Delete
[2438] Fix | Delete
for ( var i = 0, len = streams.length; i < len; i++ ) {
[2439] Fix | Delete
[2440] Fix | Delete
if ( streams[ i ].cloud == 'yep' ) continue;
[2441] Fix | Delete
if ( streams[ i ].id == id ) continue; // current stream
[2442] Fix | Delete
[2443] Fix | Delete
streamFeeds = streams[ i ].get( 'feeds' );
[2444] Fix | Delete
[2445] Fix | Delete
found = _.find( streamFeeds, function ( streamFeed ) {
[2446] Fix | Delete
return _.find( currentStreamFeeds, function ( currentStreamFeed ) {
[2447] Fix | Delete
return currentStreamFeed.id == streamFeed.id;
[2448] Fix | Delete
} )
[2449] Fix | Delete
})
[2450] Fix | Delete
[2451] Fix | Delete
if ( found ) { // this feed in other stream
[2452] Fix | Delete
// show first found
[2453] Fix | Delete
var alert = FlowFlow.popup( 'One of this stream feeds ' + (found.content ? '("' + found.content + '")' : '' ) + ' is also connected to other stream (Stream #' + streams[ i ].get( 'id' ) + ( streams[ i ].get( 'name' ) ? ' "' + streams[ i ].get( 'name' ) + '"' : '' ) + '). Feed can\'t be in cloud and self-hosted stream simultaneously. Please disconnect feed from other stream first.', 'neutral', false, { right: 'Learn more', left: 'close'} )
[2454] Fix | Delete
.then( function yes (value) {
[2455] Fix | Delete
$( '#addons-tab' ).click();
[2456] Fix | Delete
}, function cancel (reason) {
[2457] Fix | Delete
[2458] Fix | Delete
});
[2459] Fix | Delete
[2460] Fix | Delete
cancelCloudChange = true;
[2461] Fix | Delete
[2462] Fix | Delete
break;
[2463] Fix | Delete
}
[2464] Fix | Delete
}
[2465] Fix | Delete
[2466] Fix | Delete
// сheck if WP feeds
[2467] Fix | Delete
var wpFeed = _.find( currentStreamFeeds, function ( feed ) {
[2468] Fix | Delete
return feed.type == 'wordpress';
[2469] Fix | Delete
})
[2470] Fix | Delete
[2471] Fix | Delete
if ( wpFeed ) {
[2472] Fix | Delete
// show first found
[2473] Fix | Delete
var alert = FlowFlow.popup( 'One of this stream feeds has Wordpress source. WordPress feeds can\'t be in cloud currently. Please disconnect feed from stream first.', 'neutral', false, { right: 'Learn more', left: 'close'} )
[2474] Fix | Delete
.then( function yes (value) {
[2475] Fix | Delete
$( '#addons-tab' ).click();
[2476] Fix | Delete
}, function cancel (reason) {
[2477] Fix | Delete
[2478] Fix | Delete
});
[2479] Fix | Delete
[2480] Fix | Delete
cancelCloudChange = true;
[2481] Fix | Delete
[2482] Fix | Delete
}
[2483] Fix | Delete
[2484] Fix | Delete
if ( ! cancelCloudChange ) {
[2485] Fix | Delete
[2486] Fix | Delete
var alert = FlowFlow.popup( 'You are about to enable cloud service for this stream, aka boosting all connected feeds. This process will be run in background, please wait for confirmation notification. Time to wait depends on number of connected feeds. Please don\'t reload browser', 'neutral', false, { right: 'ENABLE CLOUD', left: 'cancel'} )
[2487] Fix | Delete
.then( function yes (value) {
[2488] Fix | Delete
// todo https://www.webniraj.com/2018/10/08/making-ajax-calls-sequentially-using-jquery/
[2489] Fix | Delete
[2490] Fix | Delete
var delay = 0;
[2491] Fix | Delete
var $loaded = self.$el.find( '.ff-feeds-counter__loaded' );
[2492] Fix | Delete
[2493] Fix | Delete
self.$el.addClass( 'toggling-cloud' );
[2494] Fix | Delete
self.$el.find( '.ff-feeds-counter__total' ).html( currentStreamFeeds.length );
[2495] Fix | Delete
[2496] Fix | Delete
var requests = [];
[2497] Fix | Delete
[2498] Fix | Delete
$loaded.html( 0 ).data( 'current', 0);
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function