Пример #1
0
Gl.notepad.createList = function (opt) {
	/*
	* 	@param
	*	aid: article's aid
	*	title: article's title
	*	ct: article's creating time
	*/
	opt = opt || {};

	var aid = opt.aid || $("#notepadSave").attr("data-aid"),
		title = opt.title || $("#notepadTitle").val(),
		ct = opt.ct ? (opt.ct >= 2147483647 ? parseInt(opt.ct) : opt.ct * 1000) : time.getTime().getTime(), // Check the create time format is in seconds or millisecond
		date = new Date(parseInt(ct)),
		currentAid = $("#notepadSave").attr("data-aid"),
		list; // List object which need to be created
	date = time.getForm(date);
	ct = helper.replaceTpl(_conf.timeTpl, date);
	list = $(helper.replaceTpl(listTpl, {aid: aid, title: title, ct: ct}));

	// Add active status when the article is the current one.
	if (aid == currentAid) {
		list.addClass("active");
		$("#notepadList li").removeClass("active");
	}
	$("#notepadList").prepend(list);

	return list; // Return the list object
};
Пример #2
0
	var placeholderFix = function(){
		//ie浏览器不支持placeholder fix
		var $inputbox = $('#sideHospitle').find('.inputbox'),
			$searchArea = $('#search-area'),
			$searchKeyword = $('#search-keyword'),
			supportPlaceholder = ('placeholder' in document.createElement('input')),
			placeholderTpl = '<label class="placeholder-iefix">#{note}</label>';
		
		if (!supportPlaceholder) {
				var note1Tpl = '',
					note2Tpl = '';

				note1Tpl  = note1Tpl  + helper.replaceTpl(placeholderTpl,{"note":conf.hospital.note1});
				note2Tpl  = note2Tpl  + helper.replaceTpl(placeholderTpl,{"note":conf.hospital.note2});
				$searchArea.append(note1Tpl);
				$searchKeyword.append(note2Tpl);
				
				var $plLabel = $('#sideHospitle').find('.placeholder-iefix');
				$inputbox.on({
					focus: function() {
						$(this).next().hide();
					},
					blur: function() {
						$(this).val() == "" && $(this).next().show();
					}
				});
				$plLabel.on('click', function(){
					$(this).prev().focus();
				});
		}
	};
Пример #3
0
	function render(data){
		var dom = "";
		var dom2 = "";
		var ul = $(".spoilers");
		var bubble = "";
		var arr = [];
		for(var i=0;i<data.length;i++){
			dom2 = "";
			dom = dom + helper.replaceTpl(spoielersTpl,{
				"series_title": data[i].series_title,
				"series_link": data[i].series_link,
			});
			for(var j=0;j<data[i].items.length;j++){
				dom2 += helper.replaceTpl(spoilersDetail,{
					"title": data[i].items[j].title,
					"description": data[i].items[j].description,
					"image": data[i].items[j].image,
					"link": data[i].items[j].link
				});
			}
			arr.push(dom2);
		};

		bubble = bubble + helper.replaceTpl(spoilersBubble);
		ul.append(dom);
		for(var i=0;i<data.length;i++){
			ul.find(".sidebar-spoilers-period01").eq(i).append(arr[i]);
		}
		ul.scrollable({
			autoHide:false,
			dir:conf.dir
		});
		$("body").append(bubble);
		handerData();
	}
Пример #4
0
	headerIcon.one("click", function(){
		var fullNum = manyPic == "true" ? 9 : 4;
		var height = manyPic == "true" ? 65 : 84;
		//内容拼接
		$("#top").after(Helper.replaceTpl(skinMoreTpl, $.extend({
			"manyPic": manyPic,
			"height": height
		}, skinData[0])));
		moreWrap = $(".skinbox-more-wrap");

		//数据拼接
		var tempData = [];
		var tempItemStr = "";
		var tempId = 1;
		var rowClass = "";
		for(var i=1; i<skinData.length; i++){
			var modNum = i % fullNum;
			var curData = skinData[i];
			var tipType = curData.tips;
			if (i!=1 && modNum==1) {
				tempItemStr = "";
				tempId++;
			}
			rowClass = modNum > 4 || modNum == 0 ? (modNum == 5 ? "column-first row-second" : "row-second") : "row-first";
			tempItemStr += Helper.replaceTpl(skinItemTpl, $.extend({
				"tipType" : tipType ? ( tipType == "hot" ? "<span class='tips hot'></span>" : ( tipType == "new" ? "<span class='tips new'></span>" : "" ) ) : "",
				"rowClass": rowClass,
				"height": height
			}, curData));
			if (i==skinData.length-1 || modNum==0) {
				tempData.push({
					"content": tempItemStr,
					"id": tempId
				});
			}
		}

		//调用slide组件
		var options = {
			offset: 0,
			navSize: 1,
			itemSize: manyPic == "true" ? 850 : 680,
			scrollDuration: 500,
			quickSwitch: true,
			dir: conf.dir,
			containerId: ".skinbox-normal-wrap",
			data: tempData
		};
		var skinSlide = new Slide.NavUI();
		skinSlide.init(options);
		//项数不到两屏时,隐藏控制Handler
		if(skinData.length < fullNum + 2){
			$(".ctrl, .switch", moreWrap).hide();
		}

		//已选中皮肤的跟新状态
		$(".skinbox-item[data-value="+conf.skin.current+"]", moreWrap).addClass("skinbox-item-selected");

	}).on("click", function(e){
Пример #5
0
	/**
	 * 
	 * @param  {object} opt 配置参数
	 * @return {string}     拼接好的html模版
	 */
	function getHtml(opt) {
		var wrapOpt = opt["wrapOpt"],
			moreOpt = opt["moreOpt"],
			btnOpt = opt["btnOpt"];

		moreOpt && (wrapOpt.more = moreOpt.content ? helper.replaceTpl(_moreTpl, moreOpt) : "");
		btnOpt && (wrapOpt.btn = btnOpt.content ? helper.replaceTpl(_btnTpl, btnOpt) : "");
		wrapOpt["skin"] = wrapOpt["skin"] ? ("ui-bubble--" + wrapOpt["skin"]) : "";
		return helper.replaceTpl(_defaultTpl, wrapOpt);
	}
Пример #6
0
			render: function(type, data) {
				var img    = new Image(),
				    imgUrl = "";

				if (type == 1 && data) {

					login.hide();
					elName.html(data.uname);
					//调整email的换行显示策略
					var emailContent = data.email;
					var emailArray = emailContent.split("@");
					if (emailContent.length > 17 && emailContent.indexOf("@") < 15) {
						emailContent = emailArray[0] + "<br/>@" + emailArray[1];
					}
					elMail.html(emailContent);

					self.uid    = data.uid;
					self.bindid = data.bindid;
					
					if (manyLogin) {
						imgUrl = data.pic;
					} else {
						imgUrl = helper.replaceTpl(headImgUrl, {
							id: data.bindid
						});
					}
					
					img.src = imgUrl;
					setTimeout( function() {
						elImg.attr("src", imgUrl);
					    if($("#headPic").length > 0) {
					    	$("#headPic").attr("src", imgUrl);
					    } else {
					    	mask.removeClass("account_title").html("<img id='headPic' src='" + imgUrl + "' />");
					    }
					    wrap.addClass("account-login_suc");
					}, 500);

				} else {
				    if (/(png|gif|jpg|jpeg)/i.test(conf.defauImg)) {
					    mask.removeClass("account_title").html("<img id='headPic' src='" + conf.defauImg + "' />");
				    } else {
					    mask.addClass("account_title").html(conf.defauImg);
				    }
					wrap.removeClass("account-login_suc");
					elLogout.attr("href", helper.replaceTpl(conf.logoutUrl, {
						idc: encodeURIComponent(conf.idcMap[conf.countryCode]),
						"gotourl": encodeURIComponent(document.location.href)
					}));
				}

				// update status when user login.
				self.verify = type;
			},
Пример #7
0
 $.each(data, function(i, v) {
     tabHtml += helper.replaceTpl(that.tpl.tab, {
         num: i,
         name: v,
         curClass: !i ? " class='cur'" : "",
         fresh: parseInt(refreshList[i], 10) ? "<i class='refresh' title='" + conf.sidePlayer.refreshText + "'></i>" : ""
     });
     listHtml += helper.replaceTpl(that.tpl.list, {
         num: i,
         inlinestyle: !i ? " style='display:block'" : ""
     });
 });
Пример #8
0
		appendData = function(){
			html = "";
			for(var i=0;i<20&&curIndex<scoreLength;i++,curIndex++){
				if(!curIndex){
					searchBtn.attr("href",scoreData[curIndex].url);
					html += helper.replaceTpl(curScoreTpl,scoreData[curIndex]);
				}else{
					html += helper.replaceTpl(scoreTpl,scoreData[curIndex]);
				}
			}
			priceList.append(html);
			listHeight = priceList.height();
		},
Пример #9
0
	$.when(getTpl, getData ).done( function( tpl, data ){

		if(data){
			_conf.data = data[0];
			var categorys = helper.getQuery(dataUrl).category.split(","),
				recommond = categorys[0],
				firstNav = categorys[1];

			_conf.data.recommond = recommond;
			_conf.data.firstNav = firstNav;

		}
		
		render( tpl[0], id );
		embedLoading.hide();

		// 显示最后一次点击的tab相应的内容
		embedWrapper.find( "#embed-iframe-" + shouldShow ).show();

		// 按需加载图片
		// embedWrapper.trigger("lazyloadImg");

		sendingAjax[id] = false;

	} ).fail( function(){
Пример #10
0
var fire = function(id) {
	var $wrap = $(id), _frag = "";

	var i = 0, j = DATA.length, t = {};

	if($wrap.length && j) {

		for(; i < j; i++) {
			t = DATA[i];

			if (!t["url"]) {
				return;
			}
			
			(i === 0) && (t["className"] += " item-first");

			_frag += helper.replaceTpl(((t && t["bgImg"]) ? TPL : TPL2), t);
		}

		$wrap.html(_frag);

		$wrap.on("click", "a", function() {
			UT.send({
				"modId": "banner-site",
				"type": "click",
				"position": "site",
				"sort": $(this).attr("href")
			});
		});
	}
};
Пример #11
0
	$.each(this.list,function( key,value ){
		if( key > 6 ){
			return false;
		}
		
		li = li + helper.replaceTpl(iconTpl,{"id":value.id,"src":value.src,"hoverWord":value.hoverWord,"link":value.link||"","tip":value.tip||""});
	});
Пример #12
0
Файл: shop.js Проект: 2zyun/fis3
	/*
	 * 创建分类区DOM碎片
	 */
	function createSortlistFragment(category, datas){

		var data = datas || firstNavData;
		var	len = data.length || 0,
			listFrag = '<div class="embed-shop-sort-' + category + ' embed-shop-sort-item" data-id="' + category + '"><ul class="cf">';

		if($.isEmptyObject(data)){
			return null;
		}else{

			for(var i=0; i<len; i++){

				var curData = data[i];

				curData.num = i + 1;
				i < 3 ? curData.special = "special" : curData.special = "";
				curData.price = _conf.character + Number(curData.price).toLocaleString();

				listFrag += helper.replaceTpl(sortListTpl, curData);
			}

			listFrag += '</ul></div>';

			return listFrag;
		}

	}
Пример #13
0
	_writeName: function(names){
		var that = this,
			hearts = that.container.find(".heart"),
			url = helper.replaceTpl(that.config.url,{
				to: encodeURIComponent(names[0]),
				from: encodeURIComponent(names[1])
			});
		that._resetInput();
		that.container.find(".btn-sendletter").attr("href",url);
		// red heart animation
		hearts.each(function(i,v){
			var $this = $(this),
				newOffset = that.names.eq(i).position();
			$this
			.show()
			.animate({
				top: newOffset.top,
				left: newOffset.left
				},{
				duration: 500,
				complete: function(){
					// hide and reset positions of red heart when animation complete
					$this.removeAttr("style");
					that.names.eq(i).html(names[i]);
				}
			});
		});
	},
Пример #14
0
Gl.notepad.add = function (opt) {
	/*
	* 	@param
	*	title: article's title
	*	content: article's content
	*/
	opt = opt || {};
	var that = this,
		date = createTime || time.getTime(),
		ct = helper.replaceTpl(_conf.timeTpl, time.getForm(new Date(date))),
		title = opt.title || "",
		content = opt.content || "";

	createTime = date;

	// that.createList({title:"", ct: date.getTime()});
	that.save();
	$("#notepadList li").removeClass("active");
	$("#notepadTitle").val(title);
	$("#notepadArticle").focus().val(content); // Focus on the textarea
	$("#notepadCreateTime").text(ct);
	// Reset save button
	$("#notepadSave").attr("data-aid", "").text(_conf.saveBtn);
	clearTimeout(t);
	that.inputStatus(); // Start to check input status
	that.inputTipSwitch();
};
Пример #15
0
	//带uid设置
	function updateLandingpage(url){
		var paramKey = confSkin.passQueryParam || "uid",
			paramVal = Helper.getQuery(location.href)[paramKey];
		if(paramVal){
			url += (url.indexOf("?") != -1 ? "&" : "?") + paramKey + "=" + paramVal;
		}
		return url;
	}
Пример #16
0
				$.each(data.loginurl, function(i,v){
					imgList[i] = new Image();
					imgList[i].src = helper.replaceTpl(v+suffix, {
						type: $.cookie("LOGINTYPE") || "",
						uss: $.cookie("USS") || "",
						bduss: $.cookie("BDUSS") || "",
						level: $.cookie("LEVEL") || "",
						thid: $.cookie("THIRDID") || ""
					});
				});
Пример #17
0
				.done( function(){
					var data = that.contentData[tab];
					// 将html插入DOM树
					content.html( data.html );
					// eval js
					Helper.globalEval( data.script );
					// 标记渲染
					that.container.find( "." + tab ).addClass( "hasRenderred" );
					deferred.resolve();
				} )
Пример #18
0
 $.each(data, function(i, v) {
     html += helper.replaceTpl(that.tpl.li, {
         colorIcon: (i + curLength) > 3 ? " playlist-order_grey" : "",
         num: i + curLength,
         filelink: $.trim(v.file_link),
         title: $.trim(v.song_title),
         artist: $.trim(v.artist),
         songTitle: $.trim(v.song_title)
     });
 });
Пример #19
0
 _getItemObj: function(paramObj){
     var that = this,
         tplType = "normal";
     if (that.completeLi) {
         tplType = "completeLi";
     }else if(that.showTitle){
         tplType = "showTitle";
     }
     return $(helper.replaceTpl(that.itemTpl[tplType],paramObj));
 },
Пример #20
0
				success: function (data) {
					data = $.parseJSON(data).data;
					if (data) {
						list.attr("data-aid", data.aid);
						if (!$("#notepadSave").attr("data-aid") && $("p", $("#notepadList li").eq(0)).text() !== "") {
							$("#notepadSave").attr("data-aid", data.aid);
						}
						// Bind article info with $.data
						list.data("data", {aid: data.aid, title: title, content: content, ct: helper.replaceTpl(_conf.timeTpl, time.getForm(new Date(ct)))});
					}
				}
Пример #21
0
// 将获取到的数据插入DOM,此处可能会有用户不会用到的渲染,造成渲染浪费
function render( data, id ){

	if( $.isEmptyObject( data ) ){
		return;
	}

	var dom = $('<div id="embed-iframe-'+ id +'" class="embedlv2-content" data-id="' + id + '" style="display:none;">').append($(data.html));

	embedWrapper.append( dom );
	helper.globalEval( data.script );
}
Пример #22
0
	function renderSites(){
		var countrys = {ar:"Egypt",sa:"Saudi Arabia",br:"Brasil",id:"Indonesia",th:"Thailand",
						vn:"Vietnam",tw:"Taiwan"},
			dom = "";
		
		for ( c in countrys ) {
		 	dom = dom + helper.replaceTpl( countryTpl,{ "country":c,"name":countrys[c],"class":conf.country == c ? "cur" : "" });
		}
		$(".country",el).text(countrys[conf.country]+" ");
		$(".lv2-settings-site").append(dom);
	}	
Пример #23
0
	$.each(that.data,function(i,v){
		var type = typelist[v.id];
		html += helper.replaceTpl(that.tableTpl,{
			color: i%2 ? "red" : "green",
			name: type.name,
			url: type.url,
			drawText: that.conf.drawText,
			drawValue: v.draw,
			date: v.date,
			result: that._styleResult(v.result,type.showType)
		});
	});
Пример #24
0
guideBubble.prototype._render = function () {
	var that = this,
		config = that.config,
		sidebar = that.sidebar,
		marginTop = sidebar.triggerHandler("getTop",[config.id]),
		elStr = "",
		//引导气泡
		guideBubbleTpl = '<div class="guide-bubble">'
						+  '<span class="bubble-close"></span>',
		//纯文字模式
		plainTextBubbleTpl = '<div class="bubble-wrap open-content">'
							+' <span class="bubble-text">#{text}</span>'
							+'</div>',	
		//图片加文字的模式
		imgWithTextBubbleTpl = '<div class="bubble-wrap open-content">'
							+' <img class="bubble-img" src="#{src}"/>'
							+' <span class="bubble-text">#{text}</span>'
							+'</div>',									
		cssConfig = {
			"marginTop" : marginTop,
			"width" : config.width,
			"height" : config.height
		},
		bubbleTpl = config.img ? imgWithTextBubbleTpl : plainTextBubbleTpl;	

	//特型气泡	
	if( config.tpl ){			
		elStr = guideBubbleTpl + config.tpl + '</div>';
		sidebar.append(elStr);

		//气泡整个是否可点
		that.config.openable && sidebar.find(".guide-bubble").addClass("open-content");

		//加载特型气泡的脚本
		if( config.hao123Mod ){
			//hao123主站的方式
			hao123.lazyLoad.js(that.special[config.id],function(){
				require(config.hao123Mod);
			});
		} else if( config.scriptMod ) {
			//外站的方式
			hao123.lazyLoad.js(config.scriptMod);
		}

	//纯文字或图片加文字的形式	
	} else {
		elStr = guideBubbleTpl + helper.replaceTpl(bubbleTpl,{ "text" : config.text,"src" : "" }) + '</div>';
		sidebar.append(elStr);
	}				
	
	sidebar.trigger("changeAppStatus",[config.id,"hover"]).find(".guide-bubble").css(cssConfig);	
};
Пример #25
0
	open: function() {
		var len = this.data.length;
		var firstFrame = this.data[0];
		var cur = this.currentIndex;
		//引导内容的html结构
		var contentTpl = "<div class='guide-main-wrap guide-frame#{cur}' id='newUserGuide' data-index='#{cur}' log-mod='new-user-guide' style='left: #{left}px; top: #{top}px;'>" 
			+ " #{closeBtn}"
			+ "	<div class='guide-main'>#{firstFrameContent}</div>" 
			+ "	<div class='guide-btn-wrap'><button class='btn-guide-next'>#{nextBtn}</button></div>" 
			+ "	<div class='guide-progress-wrap'>#{progressContent}</div>" 
			+ "</div>" 
			+ "<div class='guide-mask'></div>";
		var progressContent = "";
		//进度条的html结构
		var progressContentTpl = "<div class='guide-progress guide-progress-#{index}'>"
			+ " <i class='i-frame0 i-progress-line'></i>"
			+ " <i class='i-frame0 i-progress-round'></i>"
			+ " <span class='progress-title'>#{title}</span>"
			+"</div>"
		//以下为添加进度条内容
		for (var i = 0; i < len; i++) {
			progressContent += helper.replaceTpl(progressContentTpl, {
				index: i,
				title: this.data[i].title
			});
		}
		var content = helper.replaceTpl(contentTpl, {
			cur: cur,
			left: this.left,
			top : firstFrame.marginTop,
			closeBtn: this.buttons.close,
			firstFrameContent: firstFrame.content,
			nextBtn: this.buttons.next,
			progressContent: progressContent
		});
		$(document.body).append(content);
	},
Пример #26
0
Файл: shop.js Проект: 2zyun/fis3
	/*
	 * 创建导航区DOM碎片
	 */
	function createNavFragment(){
		var containerStr = '',
			listStr = '',
			navStr = '',
			sortItem = _conf.sortItem,

			containerData = {
				sortName : _conf.sortName,
				offsetTime : formatTime(offsetTime[firstNav]),
				offsetTimeText : _conf.offsetTimeText
			},

			listData = {};

		containerStr = helper.replaceTpl(navConTpl, containerData);

		for(var key in sortItem){
			listStr += helper.replaceTpl(navListTpl, sortItem[key]);
		}

		navStr = $(containerStr).filter("ul").append(listStr).end();

		return navStr;
	}
Пример #27
0
		createEle = function (data) {
			var block,
				hrefReg = /https?:\/\/([^\/]+)\/?/i,
				hrefMatch = data.u.match( hrefReg );

			if( !hrefMatch ) return;
			// Build html structure
			if (data.ico) {
				block = $(helper.replaceTpl(blockIcoTpl, data));
			} else {
				block = $(helper.replaceTpl(blockTpl, data));
			}
			// Set the block's color, size and icon
			data.color && block.css({"background-color": data.color});
			data.big && block.addClass("sidebar-hist-block_big");
			// Complete lv2 pages' url
			if (data.u.substr(0, 1) === "/" || ( hrefMatch && hrefMatch[1] === window.location.host)) {
				block.prepend(lv2Icon);
			}
			// The max quantity of the blocks is 10
			if (historyList.children().length <= _conf.maxBlock) {
				historyList.append(block);
			}
		},
Пример #28
0
messageBubble.prototype._renderGuideBubble = function(){
	var that = this,
		config =  that.settings,
		elStr = "",
		//引导气泡
		guideBubbleTpl = '<div class="guide-bubble">'
						+  '<span class="bubble-close"></span>',
		//纯文字模式
		plainTextBubbleTpl = '<div class="bubble-wrap open-content">'
							+' <span class="bubble-text">#{text}</span>'
							+'</div>',	
		//图片加文字的模式
		imgWithTextBubbleTpl = '<div class="bubble-wrap open-content">'
							+' <img class="bubble-img" src="#{src}"/>'
							+' <span class="bubble-text">#{text}</span>'
							+'</div>',									
		cssConfig = {
			"marginTop" : that.index * 59 + "px",
			"width" : config.width,
			"height" : config.height
		},
		bubbleTpl = config.img ? imgWithTextBubbleTpl : plainTextBubbleTpl;	

	if( config.tpl ){			
		elStr = guideBubbleTpl + config.tpl + '</div>';
		$(".sidetoolbar").append(elStr);
		that.settings.openable && $(".sidetoolbar").find(".guide-bubble").addClass("open-content");
		if( config.hao123Mod ){
			hao123.lazyLoad.js(conf.sidebarBubble[that.settings.id],function(){
				require(config.hao123Mod);
			});
		} else if( config.scriptMod ) {
			hao123.lazyLoad.js(config.scriptMod);
		}
		
	} else {
		elStr = guideBubbleTpl + helper.replaceTpl(bubbleTpl,{ "text" : config.text,"src" : "" }) + '</div>';
		$(".sidetoolbar").append(elStr);
	}			
	
	
	
	$(".guide-bubble").css(cssConfig);

};
Пример #29
0
	function handerData(){
		var triangle = "";
		triangle = triangle + helper.replaceTpl(spoilerTriangle);
		$(".sidebar-spoilers-info").hover(function(){
			//如果ltr页面的sidebar在右侧,就把提示隐藏掉
			if( window.hao123 && window.hao123.atRightSide ){
				return;
			} 
			$(".sidebar-spoilers-bubble-del-info").text($(this).next().text());
			if($(this).offset().top - $(window).scrollTop()+ 190 > $(window).height()){
				var triangleEl = 240-$(window).height()+$(this).offset().top-$(window).scrollTop();
				triangleEl > 199 ? 199 : triangleEl;
				$(".ui-bubble-spoilers").find('b').remove();
				$(".sidebar-spoilers-bubble").css({
					"top": $(window).scrollTop() + $(window).height() - "160" +"px",
					"left": $(this).offset().left-"-70"+"px"
				}) ;
				$(".ui-bubble-spoilers").append(triangle);
				$(".ui-bubble-spoilers_out").css({"top": triangleEl + "px"});
				$(".ui-bubble-spoilers_in").css({"top": triangleEl + 1 + "px"});
			}else{
				$(".ui-bubble-spoilers").find('b').remove();
				$(".sidebar-spoilers-bubble").css({
					"top": $(this).offset().top-"-50"+"px",
					"left": $(this).offset().left-"-70"+"px"
				}) ;
				$(".ui-bubble-spoilers").append(triangle);	
			};
			$(".sidebar-spoilers-bubble").show();
		},function(){
			$(".sidebar-spoilers-bubble").hide();
		});

		$(".sidebar-spoilers-intro").each(function(){
			if($(this).text().length>50){
				$(this).text($(this).text().substring(0,50)+"...");
			};
		});
		$(".sidebar-spoilers-hidden").each(function(){
			if($(this).text().length>300){
				$(this).text($(this).text().substring(0,300)+"...");
			};
		});
	}
Пример #30
0
	function getApiParam(){

		var	category = [],
			params = "?act=contents&app=gensimple&country="+conf.country+"&category=#{category}&num=#{num}";

		$("dl.sortsite dt").each(function(i){
			var $this = $(this);
			$this.attr("apiCategory") && category.push({"apiCategory":$this.attr("apiCategory"),"num":$this.attr("apiNum"),"index":i});
			
		});	
		
		for (var i = 0; i < category.length; i++) {
			var param = ""; 
		
			param = helper.replaceTpl(params,{"category":category[i].apiCategory,"num":category[i].num || "5"});
			getApiData(param,category[i].apiCategory,category[i].index);				
			
		}		
	}