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
}
[1000] Fix | Delete
[1001] Fix | Delete
self.$tabList.add( self.$content ).find( '.active' ).removeClass( 'active' );
[1002] Fix | Delete
$t.add( self.$content.find( '.section-content:eq(' + index + ')' ) ).addClass( 'active' );
[1003] Fix | Delete
[1004] Fix | Delete
if (index !== 0) {
[1005] Fix | Delete
self.$form.removeClass('stream-view-visible');
[1006] Fix | Delete
} else {
[1007] Fix | Delete
if (self.$form.find('#streams-cont [data-view-mode="streams-update"].view-visible').length) {
[1008] Fix | Delete
self.$form.addClass('stream-view-visible');
[1009] Fix | Delete
}
[1010] Fix | Delete
}
[1011] Fix | Delete
[1012] Fix | Delete
self.activeTabIndex = index;
[1013] Fix | Delete
sessionStorage.setItem('as_active_tab', index);
[1014] Fix | Delete
[1015] Fix | Delete
return false;
[1016] Fix | Delete
});
[1017] Fix | Delete
[1018] Fix | Delete
$backupsForm.on('click', '.create_backup', this.createBackup);
[1019] Fix | Delete
$backupsForm.on('click', '.restore_backup', this.restoreBackup);
[1020] Fix | Delete
$backupsForm.on('click', '.delete_backup', this.deleteBackup);
[1021] Fix | Delete
[1022] Fix | Delete
this.$form.delegate('.admin-button.submit-button', 'click', function (e) {
[1023] Fix | Delete
var $t = $(this);
[1024] Fix | Delete
var $contentInput;
[1025] Fix | Delete
var $cont;
[1026] Fix | Delete
var $licenseCont;
[1027] Fix | Delete
var invalid, promise;
[1028] Fix | Delete
var opts = {
[1029] Fix | Delete
doReload: false,
[1030] Fix | Delete
doSubscribe: false
[1031] Fix | Delete
}
[1032] Fix | Delete
[1033] Fix | Delete
// validate activation form
[1034] Fix | Delete
if ($t.is('#user-settings-sbmt')) {
[1035] Fix | Delete
$licenseCont = $('#envato_license');
[1036] Fix | Delete
[1037] Fix | Delete
if ($licenseCont.is('.plugin-activated')) {
[1038] Fix | Delete
promise = self.popup('Are you sure?');
[1039] Fix | Delete
promise.then(function success(){
[1040] Fix | Delete
$licenseCont.find('input').val('');
[1041] Fix | Delete
$licenseCont.find(':checkbox').prop('checked', false);
[1042] Fix | Delete
opts.doReload = true;
[1043] Fix | Delete
submitForm(opts);
[1044] Fix | Delete
}, function(){
[1045] Fix | Delete
// do nothing
[1046] Fix | Delete
});
[1047] Fix | Delete
return;
[1048] Fix | Delete
} else {
[1049] Fix | Delete
// validation
[1050] Fix | Delete
if (!self.validateEmail($licenseCont.find('#company_email').val())) {
[1051] Fix | Delete
$licenseCont.find('#company_email').addClass('validation-error');
[1052] Fix | Delete
invalid = true;
[1053] Fix | Delete
}
[1054] Fix | Delete
[1055] Fix | Delete
if (!self.validateCode($licenseCont.find('#purchase_code').val())) {
[1056] Fix | Delete
$licenseCont.find('#purchase_code').addClass('validation-error');
[1057] Fix | Delete
invalid = true;
[1058] Fix | Delete
}
[1059] Fix | Delete
[1060] Fix | Delete
if (invalid) {
[1061] Fix | Delete
return;
[1062] Fix | Delete
} else {
[1063] Fix | Delete
opts.attemptToActivate = true;
[1064] Fix | Delete
opts.doReload = true;
[1065] Fix | Delete
}
[1066] Fix | Delete
}
[1067] Fix | Delete
}
[1068] Fix | Delete
[1069] Fix | Delete
if ($t.is('#user-settings-sbmt-2')) {
[1070] Fix | Delete
$('#news_subscription').prop('checked', true);
[1071] Fix | Delete
opts.doReload = true;
[1072] Fix | Delete
opts.doSubscribe = true;
[1073] Fix | Delete
}
[1074] Fix | Delete
[1075] Fix | Delete
submitForm(opts);
[1076] Fix | Delete
[1077] Fix | Delete
function submitForm(opts) {
[1078] Fix | Delete
$t.addClass('button-in-progress');
[1079] Fix | Delete
self.makeOverlayTo('show');
[1080] Fix | Delete
$t.closest('form').trigger('submit', opts);
[1081] Fix | Delete
sessionStorage.setItem('section-submit', $t.attr('id'));
[1082] Fix | Delete
}
[1083] Fix | Delete
});
[1084] Fix | Delete
[1085] Fix | Delete
this.$form.on('click', 'a[href*="#"]', function (e) {
[1086] Fix | Delete
if (this.hash) {
[1087] Fix | Delete
FlowFlow.makeOverlayTo('hide');
[1088] Fix | Delete
self.$form.find(this.hash).click();
[1089] Fix | Delete
}
[1090] Fix | Delete
return false
[1091] Fix | Delete
})
[1092] Fix | Delete
[1093] Fix | Delete
this.$form.on('submit', function(e, opts){
[1094] Fix | Delete
// console.time('submit')
[1095] Fix | Delete
e.preventDefault();
[1096] Fix | Delete
[1097] Fix | Delete
var serialized, data;
[1098] Fix | Delete
var $inputs = self.$form.find('.section-content').not('#streams-cont, #campaigns-cont, #sources-cont').find(':input');
[1099] Fix | Delete
//Serialize form as array
[1100] Fix | Delete
serialized = $inputs.serializeArray();
[1101] Fix | Delete
//trim values
[1102] Fix | Delete
for(var i =0, len = serialized.length;i<len;i++){
[1103] Fix | Delete
serialized[i]['value'] = $.trim(serialized[i]['value']);
[1104] Fix | Delete
}
[1105] Fix | Delete
[1106] Fix | Delete
//turn it into a string if you wish
[1107] Fix | Delete
serialized = $.param(serialized);
[1108] Fix | Delete
[1109] Fix | Delete
$inputs.filter('input[type=checkbox]:not(:checked)').each(
[1110] Fix | Delete
function () {
[1111] Fix | Delete
if (name != 'mod-roles') {
[1112] Fix | Delete
serialized += '&' + encodeURIComponent(this.name) + '=nope';
[1113] Fix | Delete
}
[1114] Fix | Delete
})
[1115] Fix | Delete
[1116] Fix | Delete
data = {
[1117] Fix | Delete
action: la_plugin_slug_down + '_ff_save_settings',
[1118] Fix | Delete
settings: serialized,
[1119] Fix | Delete
doSubcribe: opts.doSubscribe,
[1120] Fix | Delete
security: vars.nonce
[1121] Fix | Delete
};
[1122] Fix | Delete
[1123] Fix | Delete
$.post( vars.ajaxurl, data, function( response ) {
[1124] Fix | Delete
console.log('Got this from the server: ' , response )
[1125] Fix | Delete
var $fb_token, $submitted;
[1126] Fix | Delete
if ( response == -1 || response.error ) {
[1127] Fix | Delete
var promise = FlowFlow.popup('Nay! Something went wrong, if it repeats please contact support.', false, 'alert');
[1128] Fix | Delete
FlowFlow.makeOverlayTo('hide');
[1129] Fix | Delete
return;
[1130] Fix | Delete
}
[1131] Fix | Delete
else{
[1132] Fix | Delete
// Do something on success
[1133] Fix | Delete
console.log(response.settings)
[1134] Fix | Delete
if (typeof response === 'string' && response.indexOf('curl')) {
[1135] Fix | Delete
var promise = FlowFlow.popup('Please set DISABLE CURL_FOLLOW_LOCATION setting to YES under General tab', false, 'alert');
[1136] Fix | Delete
FlowFlow.makeOverlayTo('hide');
[1137] Fix | Delete
return;
[1138] Fix | Delete
}
[1139] Fix | Delete
[1140] Fix | Delete
if (opts.attemptToActivate && response.activated !== true) {
[1141] Fix | Delete
alert(response.activated);
[1142] Fix | Delete
self.makeOverlayTo('hide');
[1143] Fix | Delete
return;
[1144] Fix | Delete
}
[1145] Fix | Delete
[1146] Fix | Delete
$fb_token = $('input[name="flow_flow_fb_auth_options[facebook_access_token]"]').parent();
[1147] Fix | Delete
if (response.fb_extended_token == false){
[1148] Fix | Delete
$fb_token.find('.desc').remove();
[1149] Fix | Delete
$fb_token.find('textarea').remove();
[1150] Fix | Delete
$fb_token.append('<p class="desc fb-token-notice" style="margin: 10px 0 5px; color: red !important">! Extended token is not generated, Facebook feeds might not work</p>');
[1151] Fix | Delete
$fb_token.removeClass('fb-empty');
[1152] Fix | Delete
}
[1153] Fix | Delete
else if (response.settings.flow_flow_fb_auth_options.facebook_access_token == response.fb_extended_token){
[1154] Fix | Delete
[1155] Fix | Delete
}
[1156] Fix | Delete
else {
[1157] Fix | Delete
if (response.settings && response.settings.flow_flow_fb_auth_options && response.settings.flow_flow_fb_auth_options.facebook_access_token == '') {
[1158] Fix | Delete
$fb_token.addClass('fb-empty');
[1159] Fix | Delete
} else {
[1160] Fix | Delete
if (response.fb_extended_token && !$fb_token.find('textarea').length) {
[1161] Fix | Delete
$fb_token.find('.desc').remove();
[1162] Fix | Delete
$fb_token.append('<p class="desc" style="margin: 30px 0 5px">Generated long-life token, it should be different from that you entered above then FB auth is OK</p><textarea disabled rows=3>' + response.fb_extended_token + '</textarea>');
[1163] Fix | Delete
}
[1164] Fix | Delete
$fb_token.removeClass('fb-empty');
[1165] Fix | Delete
}
[1166] Fix | Delete
}
[1167] Fix | Delete
[1168] Fix | Delete
if (!opts.doReload) self.makeOverlayTo('hide');
[1169] Fix | Delete
[1170] Fix | Delete
$submitted = $('#' + sessionStorage.getItem('section-submit'));
[1171] Fix | Delete
$submitted.addClass('updated-button').html('<i class="flaticon-check_mark" data-action="edit"></i>&nbsp;&nbsp;Updated');
[1172] Fix | Delete
$submitted.removeClass('button-in-progress');
[1173] Fix | Delete
[1174] Fix | Delete
setTimeout( function () {
[1175] Fix | Delete
$submitted.html('Save changes').removeClass('updated-button');
[1176] Fix | Delete
}, 2500);
[1177] Fix | Delete
}
[1178] Fix | Delete
[1179] Fix | Delete
if (opts.doReload) location.reload();
[1180] Fix | Delete
[1181] Fix | Delete
}, 'json' ).fail( function( d ){
[1182] Fix | Delete
console.log( d.responseText );
[1183] Fix | Delete
console.log( d );
[1184] Fix | Delete
alert('Error occurred. ' + d.responseText);
[1185] Fix | Delete
self.makeOverlayTo('hide');
[1186] Fix | Delete
});
[1187] Fix | Delete
[1188] Fix | Delete
return false
[1189] Fix | Delete
});
[1190] Fix | Delete
[1191] Fix | Delete
this.$form.delegate('input', 'keydown', function (e){
[1192] Fix | Delete
var $t = $(this);
[1193] Fix | Delete
if ($t.is('.validation-error')) {
[1194] Fix | Delete
$t.removeClass('validation-error');
[1195] Fix | Delete
}
[1196] Fix | Delete
if (e.which == 13) {
[1197] Fix | Delete
//console.log('enter')
[1198] Fix | Delete
}
[1199] Fix | Delete
});
[1200] Fix | Delete
[1201] Fix | Delete
this.$form.find('#facebook_use_own_app').change(function(){
[1202] Fix | Delete
var $t = $(this);
[1203] Fix | Delete
var $p = $t.closest('dl');
[1204] Fix | Delete
var checked = this.checked;
[1205] Fix | Delete
[1206] Fix | Delete
$p.find('dd, dt').not('.ff-toggler').find('input')[ checked ? 'removeClass' : 'addClass' ]('disabled')
[1207] Fix | Delete
$p[ checked ? 'addClass' : 'removeClass' ]('ff-own-app');
[1208] Fix | Delete
$('#facebook-auth')[this.checked ? 'hide' : 'show']();
[1209] Fix | Delete
[1210] Fix | Delete
}).change();
[1211] Fix | Delete
[1212] Fix | Delete
this.$form.find('.extension__cta--disabled').click(function(e){
[1213] Fix | Delete
e.preventDefault();
[1214] Fix | Delete
});
[1215] Fix | Delete
[1216] Fix | Delete
$( window ).on('beforeunload', function (e) {
[1217] Fix | Delete
sessionStorage.setItem('as_scroll', $('body').scrollTop() || $('html').scrollTop());
[1218] Fix | Delete
});
[1219] Fix | Delete
[1220] Fix | Delete
this.$errorPopup.on('mouseleave', function(e){
[1221] Fix | Delete
self.$errorPopup.removeClass('visible')
[1222] Fix | Delete
})
[1223] Fix | Delete
[1224] Fix | Delete
this.$form.find('#boosts .extension__cta.grey-button').on( 'click', function ( e ) {
[1225] Fix | Delete
[1226] Fix | Delete
e.preventDefault();
[1227] Fix | Delete
var hr = this.href;
[1228] Fix | Delete
[1229] Fix | Delete
var promise = FlowFlow.popup( 'You are about to cancel subscription. All active boosted feeds and cloud streams will become self-hosted. Are you sure?');
[1230] Fix | Delete
[1231] Fix | Delete
promise.then(function yes(){
[1232] Fix | Delete
window.location.replace( hr )
[1233] Fix | Delete
}, function no ( reason ) {
[1234] Fix | Delete
[1235] Fix | Delete
})
[1236] Fix | Delete
});
[1237] Fix | Delete
[1238] Fix | Delete
this.$popupBanner.on( 'click', function () {
[1239] Fix | Delete
self.$popupBanner.removeClass( 'banner-visible' );
[1240] Fix | Delete
} )
[1241] Fix | Delete
[1242] Fix | Delete
this.$form.on( 'click', '.show-debug', function ( e ) {
[1243] Fix | Delete
e.preventDefault();
[1244] Fix | Delete
$('#debug-info').toggle();
[1245] Fix | Delete
})
[1246] Fix | Delete
[1247] Fix | Delete
// show popup tutorial
[1248] Fix | Delete
if ( window.FF_Cookie ) {
[1249] Fix | Delete
[1250] Fix | Delete
if ( window.FF_Cookie.get( 'ff_first_time' ) ) {
[1251] Fix | Delete
$( '.tutorial-first-time' ).hide();
[1252] Fix | Delete
} else {
[1253] Fix | Delete
$( '.tutorial-link' ).click();
[1254] Fix | Delete
window.FF_Cookie.set( 'ff_first_time', '1', { expires: 356 });
[1255] Fix | Delete
}
[1256] Fix | Delete
[1257] Fix | Delete
}
[1258] Fix | Delete
[1259] Fix | Delete
// coupon
[1260] Fix | Delete
$('.coupon-apply').on( 'click', function () {
[1261] Fix | Delete
$( '#general-settings-sbmt' ).click();
[1262] Fix | Delete
})
[1263] Fix | Delete
$('.coupon-clear').on( 'click', function () {
[1264] Fix | Delete
$( '#boosts_coupon' ).val( '' );
[1265] Fix | Delete
$( '#general-settings-sbmt' ).click();
[1266] Fix | Delete
})
[1267] Fix | Delete
[1268] Fix | Delete
// boost custom plan
[1269] Fix | Delete
[1270] Fix | Delete
$( '#boosts').on( 'click', '[data-plan="custom"] .extension__cta--secured', function ( e ) {
[1271] Fix | Delete
[1272] Fix | Delete
e.preventDefault();
[1273] Fix | Delete
[1274] Fix | Delete
var prompt = self.popup( '<label>Enter plan ID</label>&nbsp;&nbsp;&nbsp;<input id="boosts_custom_plan_id" name="boosts_custom_plan_id" type="text">', 'neutral', false, { right: 'Go To Payment', left: 'cancel'} )
[1275] Fix | Delete
[1276] Fix | Delete
prompt.then( function yes ( value ) {
[1277] Fix | Delete
[1278] Fix | Delete
var id = $( '#boosts_custom_plan_id' ).val();
[1279] Fix | Delete
var coupon = $('#boosts_coupon').val();
[1280] Fix | Delete
[1281] Fix | Delete
window.location.replace( 'https://social-streams.com/boosts/?intent=' + id + '&domain=' + encodeURIComponent( location.href + '&subscription=1') + ( coupon ? '&coupon=' + coupon : '' ) + '&ajax=' + vars.ajaxurl );
[1282] Fix | Delete
[1283] Fix | Delete
}, function cancel ( reason ) {
[1284] Fix | Delete
[1285] Fix | Delete
})
[1286] Fix | Delete
})
[1287] Fix | Delete
[1288] Fix | Delete
// boost manual activation
[1289] Fix | Delete
[1290] Fix | Delete
$( '#boosts').on( 'click', '#boosts_manual', function ( e ) {
[1291] Fix | Delete
[1292] Fix | Delete
e.preventDefault();
[1293] Fix | Delete
[1294] Fix | Delete
var prompt = self.popup( '<div class="boost_custom_wrap"><label>Checkout email</label>&nbsp;&nbsp;&nbsp;<input id="boosts_manual_email" name="boosts_manual_email" type="text"><br><label>Checkout ID</label>&nbsp;&nbsp;&nbsp;<input id="boosts_manual_id" name="boosts_manual_id" type="text"></div>', 'neutral', false, { right: 'Activate', left: 'cancel'} )
[1295] Fix | Delete
[1296] Fix | Delete
prompt.then( function yes ( value ) {
[1297] Fix | Delete
[1298] Fix | Delete
var email = $( '#boosts_manual_email' ).val();
[1299] Fix | Delete
var id = $('#boosts_manual_id').val();
[1300] Fix | Delete
[1301] Fix | Delete
if ( email && id ) {
[1302] Fix | Delete
window.location.replace( vars.ajaxurl + "?action=flow_flow_payment_success&email=" + email + "&checkout_id=" + id );
[1303] Fix | Delete
} else {
[1304] Fix | Delete
self.popup( 'Please enter both email and ID', false, 'alert' );
[1305] Fix | Delete
}
[1306] Fix | Delete
[1307] Fix | Delete
[1308] Fix | Delete
}, function cancel ( reason ) {
[1309] Fix | Delete
[1310] Fix | Delete
})
[1311] Fix | Delete
})
[1312] Fix | Delete
[1313] Fix | Delete
this.initFacebookAuth();
[1314] Fix | Delete
this.initFoursquareAuth();
[1315] Fix | Delete
this.initInstagramAuth();
[1316] Fix | Delete
},
[1317] Fix | Delete
[1318] Fix | Delete
showNotification: function ( html ) {
[1319] Fix | Delete
[1320] Fix | Delete
var timeout = this.$popupBanner.data( 'timeout' );
[1321] Fix | Delete
[1322] Fix | Delete
this.$popupBanner.find( 'div' ).html( html ).end().addClass( 'banner-visible' );
[1323] Fix | Delete
[1324] Fix | Delete
if ( timeout ) { // current
[1325] Fix | Delete
clearTimeout( timeout );
[1326] Fix | Delete
}
[1327] Fix | Delete
[1328] Fix | Delete
// new
[1329] Fix | Delete
timeout = setTimeout( function () {
[1330] Fix | Delete
FlowFlow.$popupBanner.removeClass( 'banner-visible' );
[1331] Fix | Delete
}, 8000 );
[1332] Fix | Delete
[1333] Fix | Delete
this.$popupBanner.data( 'timeout', timeout );
[1334] Fix | Delete
},
[1335] Fix | Delete
[1336] Fix | Delete
backUrl: vars.backUrl,
[1337] Fix | Delete
[1338] Fix | Delete
initFacebookAuth: function () {
[1339] Fix | Delete
//https://www.facebook.com/dialog/oauth
[1340] Fix | Delete
[1341] Fix | Delete
var f = "https://flow.looks-awesome.com/service/auth/facebook-instagram.php?" + $.param({
[1342] Fix | Delete
back: this.backUrl
[1343] Fix | Delete
});
[1344] Fix | Delete
$("#facebook-auth").click(function(){
[1345] Fix | Delete
var $t = $(this);
[1346] Fix | Delete
if ($(this).html() === 'Log Out') {
[1347] Fix | Delete
$('#facebook_access_token').val('');
[1348] Fix | Delete
$('#fb-auth-settings-sbmt').click();
[1349] Fix | Delete
$("#facebook-auth").html('Connect');
[1350] Fix | Delete
return
[1351] Fix | Delete
}
[1352] Fix | Delete
document.location.href = f;
[1353] Fix | Delete
});
[1354] Fix | Delete
[1355] Fix | Delete
$("#fb-refresh-token").click(function(){
[1356] Fix | Delete
document.location.href = f;
[1357] Fix | Delete
});
[1358] Fix | Delete
[1359] Fix | Delete
if ($('#facebook_access_token').val() !== '') {
[1360] Fix | Delete
$("#facebook-auth").html('Log Out')
[1361] Fix | Delete
}
[1362] Fix | Delete
},
[1363] Fix | Delete
[1364] Fix | Delete
initFoursquareAuth: function () {
[1365] Fix | Delete
[1366] Fix | Delete
var j = "https://foursquare.com/oauth2/authenticate?" + $.param({
[1367] Fix | Delete
client_id: "22XC2KJFR2SFU4BNF4PP1HMTV3JUBSEEVTQZCSCXXIERVKA3",
[1368] Fix | Delete
redirect_uri: "http://flow.looks-awesome.com/service/auth/foursquare.php?back=" + this.backUrl,
[1369] Fix | Delete
response_type: "code"
[1370] Fix | Delete
});
[1371] Fix | Delete
[1372] Fix | Delete
$("#foursquare-auth").click(function(){
[1373] Fix | Delete
var $t = $(this);
[1374] Fix | Delete
if ($(this).html() === 'Log Out') {
[1375] Fix | Delete
$('#foursquare_access_token').val('');
[1376] Fix | Delete
$('#fq-auth-settings-sbmt').click();
[1377] Fix | Delete
$("#foursquare-auth").html('Authorize');
[1378] Fix | Delete
return
[1379] Fix | Delete
}
[1380] Fix | Delete
document.location.href = j;
[1381] Fix | Delete
});
[1382] Fix | Delete
[1383] Fix | Delete
if ($('#foursquare_access_token').val() !== '') {
[1384] Fix | Delete
$("#foursquare-auth").html('Log Out')
[1385] Fix | Delete
}
[1386] Fix | Delete
[1387] Fix | Delete
if ($('#foursquare_client_id').val() === '') {
[1388] Fix | Delete
var $par = $('#foursquare_client_id').parent();
[1389] Fix | Delete
$par.add($par.prev('dt').first()).hide();
[1390] Fix | Delete
}
[1391] Fix | Delete
if ($('#foursquare_client_secret').val() === '') {
[1392] Fix | Delete
var $par = $('#foursquare_client_secret').parent();
[1393] Fix | Delete
$par.add($par.prev('dt').first()).hide();
[1394] Fix | Delete
}
[1395] Fix | Delete
},
[1396] Fix | Delete
[1397] Fix | Delete
initInstagramAuth: function () {
[1398] Fix | Delete
[1399] Fix | Delete
//http://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url/7297873#7297873
[1400] Fix | Delete
if (window.location.hash && window.location.hash == '#_=_') {
[1401] Fix | Delete
window.location.hash = '';
[1402] Fix | Delete
}
[1403] Fix | Delete
[1404] Fix | Delete
var h = "https://api.instagram.com/oauth/authorize/?" + $.param({
[1405] Fix | Delete
client_id: "94072d7b728f47b68bc7fc86767b3ebe",
[1406] Fix | Delete
redirect_uri: "http://social-streams.com/services/auth/instagram.php?back=" + this.backUrl,
[1407] Fix | Delete
response_type: "code",
[1408] Fix | Delete
scope: "basic public_content"
[1409] Fix | Delete
});
[1410] Fix | Delete
[1411] Fix | Delete
$("#inst-auth").click(function(){
[1412] Fix | Delete
var $t = $(this);
[1413] Fix | Delete
if ($(this).html() === 'Log Out') {
[1414] Fix | Delete
$('#instagram_access_token').val('');
[1415] Fix | Delete
$('#inst-auth-settings-sbmt').click();
[1416] Fix | Delete
$("#inst-auth").html('Authorize');
[1417] Fix | Delete
return
[1418] Fix | Delete
}
[1419] Fix | Delete
document.location.href = h;
[1420] Fix | Delete
});
[1421] Fix | Delete
[1422] Fix | Delete
if ($('#instagram_access_token').val() !== '') {
[1423] Fix | Delete
$("#inst-auth").html('Log Out');
[1424] Fix | Delete
}
[1425] Fix | Delete
},
[1426] Fix | Delete
[1427] Fix | Delete
checkScrollbar : function () {
[1428] Fix | Delete
this.bodyIsOverflowing = document.body.scrollHeight > document.body.clientHeight
[1429] Fix | Delete
this.scrollbarWidth = this.measureScrollbar();
[1430] Fix | Delete
},
[1431] Fix | Delete
[1432] Fix | Delete
setScrollbar : function () {
[1433] Fix | Delete
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
[1434] Fix | Delete
if (this.bodyIsOverflowing) {
[1435] Fix | Delete
this.$body.css('padding-right', bodyPad + this.scrollbarWidth);
[1436] Fix | Delete
this.$popupBanner.css('margin-right', bodyPad + this.scrollbarWidth);
[1437] Fix | Delete
}
[1438] Fix | Delete
},
[1439] Fix | Delete
[1440] Fix | Delete
resetScrollbar : function () {
[1441] Fix | Delete
this.$body.css('padding-right', '');
[1442] Fix | Delete
this.$popupBanner.css('margin-right', '');
[1443] Fix | Delete
},
[1444] Fix | Delete
[1445] Fix | Delete
measureScrollbar : function () { // thx walsh
[1446] Fix | Delete
var scrollDiv = document.createElement('div')
[1447] Fix | Delete
scrollDiv.className = 'ff-modal-scrollbar-measure'
[1448] Fix | Delete
this.$body.append(scrollDiv)
[1449] Fix | Delete
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
[1450] Fix | Delete
this.$body[0].removeChild(scrollDiv);
[1451] Fix | Delete
return scrollbarWidth;
[1452] Fix | Delete
},
[1453] Fix | Delete
[1454] Fix | Delete
switchToView: function (view) {
[1455] Fix | Delete
[1456] Fix | Delete
var self = this;
[1457] Fix | Delete
this.$streamsContainer.find('.view-visible').removeClass('view-visible');
[1458] Fix | Delete
this.setHeight(view);
[1459] Fix | Delete
// setTimeout(function(){
[1460] Fix | Delete
if (view === 'list') {
[1461] Fix | Delete
self.$streamsContainer.find('#streams-' + view).addClass('view-visible');
[1462] Fix | Delete
self.$form.removeClass('stream-view-visible');
[1463] Fix | Delete
} else {
[1464] Fix | Delete
self.$streamsContainer.find('#stream-view-' + view).addClass('view-visible');
[1465] Fix | Delete
self.$form.addClass('stream-view-visible');
[1466] Fix | Delete
}
[1467] Fix | Delete
// },0)
[1468] Fix | Delete
[1469] Fix | Delete
console.log('switch to view', view)
[1470] Fix | Delete
[1471] Fix | Delete
sessionStorage.setItem('ff_stream', view);
[1472] Fix | Delete
},
[1473] Fix | Delete
[1474] Fix | Delete
setHeight : function (id) {
[1475] Fix | Delete
var self = this;
[1476] Fix | Delete
[1477] Fix | Delete
var heights = [];
[1478] Fix | Delete
var maxH;
[1479] Fix | Delete
//
[1480] Fix | Delete
if (id && !isNaN(parseInt(id))) {
[1481] Fix | Delete
self.$streamsContainer.find('#stream-view-' + id + ', #streams-list').each(function(){
[1482] Fix | Delete
heights.push($(this).outerHeight());
[1483] Fix | Delete
});
[1484] Fix | Delete
} else {
[1485] Fix | Delete
self.$streamsContainer.find('.section-stream[data-view-mode="streams-update"], #streams-list').each(function(){
[1486] Fix | Delete
heights.push($(this).outerHeight());
[1487] Fix | Delete
});
[1488] Fix | Delete
}
[1489] Fix | Delete
[1490] Fix | Delete
maxH = Math.max.apply(Math, heights);
[1491] Fix | Delete
self.$streamsContainer.css('minHeight', maxH);
[1492] Fix | Delete
},
[1493] Fix | Delete
[1494] Fix | Delete
setupTabsAndContainer: function () {
[1495] Fix | Delete
var self = this;
[1496] Fix | Delete
var $activeTab;
[1497] Fix | Delete
[1498] Fix | Delete
$activeTab = $('.section-tabs li:eq(' + this.activeTabIndex +')');
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function