Personalized Movie Channel JS

Source: Internet
Author: User

(function () {

var inmoviebtn = t.get (' in_movie_btn '), inindivibtn = T.get (' in_indivi_btn ');
var indivipop = T.query ('. Indivi-pop ') [0], indivipopclosebtn = T.get (' Indivi_pop_close ');

if (F.cookie.get (' Hideindivipop ') | | F.cookie.get (' Indivi ')) {
T.hide (Indivipop);
}

var hideindivipop = function () {
T.hide (Indivipop);
F.cookie.set (' Hideindivipop ', ' 1 ');
};

var Addindivicookie = function () {
if (! F.cookie.get (' Indivi ')) {
F.cookie.set (' Indivi ', ' 1 ');
}
};

var Delindivicookie = function () {
F.cookie.del (' Indivi ');
};


var lovebtns = T.query ('. info-layout. Addmovie '), Indivichange = T.query ('. Indivi-change ');

Click the Delete icon
T.each (Indivichange, function (ele, index) {
var Infocon = t.q (' Info-con ', ele);
if (Infocon) var length = Infocon.length;
if (Infocon) var delbtns = t.q (' Removemovie ', ele);
T.each (Delbtns, function (i, b) {
T.on (i, ' click ', Function (e) {
E = T.event.get (e);
T.event.stop (e);
Length--;
if (T.dom.hasclass (Infocon[b], ' last ')) {
var prevdom = T.dom.prev (Infocon[b]);
Prevdom && t.dom.addclass (prevdom, ' last ');
}
T.dom.remove (Infocon[b]);

if (length > 4) t.observer.send (' Remove.change ');

If there is no content hidden chunks
if (length <= 0) {
T.hide (ele);
}

Delete escalation
var mid = t.dom.getattr (i, ' ref ');
F.tool.stat.eventstat ({type: "event", Name: "Media_dele", ext: [' media= ' + mid]});

});
});
});

Click the heart icon
T.each (Lovebtns, function (item, index) {

var itemem = t.q (' ISTR ', item) [0];
var $timer = 0, ttl = (t.browser.ie >= 9)? 2000:600;

T.on (item, ' Click ', Function (e) {
E = T.event.get (e);
T.event.stop (e);

var title = ' Like this movie ', Curtitle = ' Cancel like ';
var iscurrent = T.dom.hasclass (item, ' Current ');

var isstrong = t.q (' strong ', item);
var mid = T.dom.getattr (item, ' ref ');

if (!iscurrent) {
T.addclass (item, ' Current ');
T.dom.setattr (item, ' title ', Curtitle);
T.dom.setstyle (Itemem, ' visibility ', ' visible ');
T.dom.setstyle (Itemem, ' opacity ', ' 1 ');

Cleartimeout ($timer);
$timer = SetTimeout (function () {
T.addclass (item, ' Timeout ');
T.dom.setstyle (Itemem, ' visibility ', ' hidden ');
T.dom.setstyle (Itemem, ' opacity ', ' 0 ');
},TTL);

Click Like escalate
F.tool.stat.eventstat ({type: "event", Name: "Media_ding", ext: [' media= ' + mid]});

}else{
Cleartimeout ($timer);
T.removeclass (item, ' Current ');
T.removeclass (item, ' Timeout ');
T.dom.setattr (item, ' title ', title);

Don't like to report
F.tool.stat.eventstat ({type: "event", Name: "Media_cai", ext: [' media= ' + mid]});
}

});

});

Click the Bubble Close button
if (indivipopclosebtn) T.on (indivipopclosebtn, ' click ', Hideindivipop);

Click the left and right personalization buttons
if (inmoviebtn) T.on (inmoviebtn, ' click ', Delindivicookie);
if (inindivibtn) T.on (inindivibtn, ' click ', Addindivicookie);

})();

Toggle Effect
(function () {

var bodynode = t.q (' Indivi-change ');
F.load (["Tween", "slidetool"], function () {

T.each (Bodynode, function (ele) {
var BODY = t.q ("Info-layout", Ele) [0],
Prev = t.q ("Indivi-btn-prev", Ele) [0],
Next = t.q ("Indivi-btn-next", Ele) [0],
nodes = t.q ("Info-con", ele). length;

var actnum = function () {
if (T.dom.hasclass (ele, ' small ')) {
return 3;
}
Return t.query (' body.w960 '). Length? 5:6;
}

if (!body | |!prev | |!next | | nodes < 5) {
T.hide (prev);
T.hide (next);
Return
};

var slider = new F.tool.slidetool ({
Body:body,
Prev:prev,
Next:next,
Actnum:actnum ()//switch several at a time
Margin:t.dom.hasclass (Ele, ' small ')? 16:20,
timer:500
});

var Updatesliderhandler = function (e) {
var num = Actnum ();
Slider.updateparam (num, ' change ');
};
if (! T.dom.hasclass (Ele, ' small ')) {
T.observer.add (' Response.change ', updatesliderhandler);
T.observer.add (' Remove.change ', updatesliderhandler);
}
});


Featured Themes
var indivifeatureinfo = T.query ('. Indivi-feature. Indivi-wrap ');
var indiviinnerhtml = T.query ('. Indivi-feature. inner-html ');
var timer = 0, timers = 0;
var ie = t.browser.ie;

T.each (Indivifeatureinfo, function (item, index) {
Item.timer = null;
var nextjt = t.q (' INDIVI-RIGHT-JT ', item) [0];
var prevjt = t.q (' INDIVI-LEFT-JT ', item) [0];
T.on (item, ' MouseOver ', function (e) {
Cleartimeout (Item.timer);
Cleartimeout (timers);

if (ie < 8 && t.dom.hasclass (item, ' Indiv-1 ') | | IE < 8 && t.dom.hasclass (item, ' Indiv-2 ') | | IE < 8 && T.dom.hasclass (item, ' indiv-3 ')) {
T.dom.setstyle (item, ' Z-index ', ' 5 ');
}
if (T.dom.getstyle (Indiviinnerhtml[index], ' visibility ') = = ' visible ') return;
T.each (indiviinnerhtml, function (Ele, i) {
T.dom.setstyle (ele, ' visibility ', ' hidden ');
});
T.addclass (item, ' Tween ');
Timers = SetTimeout (function () {
F.tool.tween.add (Indiviinnerhtml[index], {
Prop: ' Width ',
Method:f.math.tweener.easeoutquint,
TIME:300,
START:200,
end:580,
Oncomplete:function () {
}
});
T.dom.setstyle (Indiviinnerhtml[index], ' visibility ', ' visible ');
if (PREVJT) {T.dom.setstyle (PREVJT, ' visibility ', ' visible ');}
if (NEXTJT) {T.dom.setstyle (NEXTJT, ' visibility ', ' visible ');}
},300);
});
T.on (item, ' Mouseout ', function () {
if (ie < 8 && t.dom.hasclass (item, ' Indiv-1 ') | | IE < 8 && t.dom.hasclass (item, ' Indiv-2 ') | | IE < 8 && T.dom.hasclass (item, ' indiv-3 ')) {
T.dom.setstyle (item, ' Z-index ', ' 0 ');
}
Item.timer = SetTimeout (function () {
T.dom.setstyle (Indiviinnerhtml[index], ' visibility ', ' hidden ');
T.removeclass (Indiviinnerhtml[index].parentnode, ' tween ');
if (PREVJT) {T.dom.setstyle (PREVJT, ' visibility ', ' hidden ');}
if (NEXTJT) {T.dom.setstyle (NEXTJT, ' visibility ', ' hidden ');}
T.dom.setstyle (Indiviinnerhtml[index], ' width ', 200);
}, 100);
});
T.on (Item.parentNode.parentNode, ' mouseout ', function () {
Cleartimeout (timers);
});
});
});
})();

Popular Guess Click escalation
(function () {
var indivimod = T.query ('. Indivi-mod ');
var stp = null;
T.each (Indivimod, function (item, index) {
F.event.delegate (item, ' A ', ' MouseDown ', function (e) {
STP = t.getattr (item, ' STP ');
if (!STP | | stp = = NULL) return;
var href = this.getattribute (' href ');
if (href) var match = Href.match (/\d+/g);
if (match) var mediaid = String (match[0]);
if (STP && mediaid) f.tool.stat.guessevent ({mid:mediaid, et: ' 1 ', STP:STP});
});
});
})();

Personalized Movie Channel JS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.