Esempio n. 1
0
			user.logined(function() {
				if (!user.get('commentPlatInfo')) {
					Ajax.getJSON(Y.domains.commentSite + '/comment/get-platform-info', '', function(json) {
						user.set('commentPlatInfo', json);
						self.renderPlatInfo(json);
					})
				} else {
					self.renderPlatInfo(user.get('commentPlatInfo'))
				}
			});
Esempio n. 2
0
	/*
	 * @param isFirst 是否播放器初始化时,此时提示不能关闭;缓冲时如果用户安装了p2p且是最新版才提示用户切换码流
	 */
	function jsGetPromptMsg(isFirst) {
		var p2pPlugin = document.getElementById("yinyuetai"),
				player = document.getElementById('yinyuetaiplayer');
		var down_url = p2pInfo.url;
		var template = _.template("<p align='left'><font size='15' face='微软雅黑' color = '#ffffff'><%= text0 %></font><font size='15' face='微软雅黑' color = '#99cc33'><a href='" +
				'<%= down_url %>' + "' target='_blank'><u><%= text1 %></u></a></font></p>");
		var downPageUrl = "<font size='15' color = '#99cc33' face='微软雅黑'> <a href='http://www.yinyuetai.com/apps/yinyue_p2p' target='_blank'><b>音悦加速器</b></a> </font>";

		var tip = '';
		var showTip = function() {
			if (tip) {
				var autohide = isFirst ? false : true;
				try {
					player.displaySetupP2PMsg({message : tip, autohide : autohide});
				} catch (e) {}
			}
		};
		if (p2pPlugin != null) {
			Ajax.getJSON('http://v.yinyuetai.com/p2p/get-version', '', function(result) {
				p2pInfo.version = result.clientPublish.versionInfo;
				if (isPluginWorks(p2pInfo.version) < 0) {
					tip = template({
						text0 : "建议您立即更新" + downPageUrl + ",享受极速高清体验。",
						text1 : '立即更新',
						down_url : down_url
					});
				} else if (!isFirst) {
					try {
						//卡的时候切清晰度,如果已经安装了加速器,而且也不用升级
						player.displaySwitchBitrateMsg({autohide : true});
					} catch (e) {}
				}
				showTip();
			});
		} else {
			if (!isFirst) {//todo 暂时去掉没装p2p时的默认提示
				var text0 = isFirst ? "推荐安装" + downPageUrl + ",体验极速观影快感!" : "您的网速不太给力,下载" + downPageUrl + "享受极速高清体验。";
				tip = template({
					text0 : text0,
					text1 : '立即安装',
					down_url : down_url
				});
				showTip();
			}
		}
	}
Esempio n. 3
0
var qr = require('qr-code');
var ajax = require('ajax');
var currency = require('currency');

ajax.getJSON('/campaign', function(res){
  campaigns[0].pledged = res.usd;
  campaigns[0].target = res.targetUsd;
  campaigns[0].wallets.bitcoin.address = res.wallets.btc;
  campaigns[0].wallets.dogecoin.address = res.wallets.doge;
  updateCampaigns();
});

var campaigns = [
  {
    name: 'milestone I',
    pledged: 0,
    target: 2000,
    wallets: {
      bitcoin: {
        address: ''
      },
      dogecoin: {
        address: ''
      }
    },
    dogetails: "many modules ,such abstract! import wow !! plerdge woof!",
    details:
        "help fund the development of milestone I to enable:<br> "
      + "user profiles, project saving & sharing, module library, "
      + "audio record & download, code export, debug console and settings."
Esempio n. 4
0
 function callGiphy(endpoint, params, callback) {
     params.api_key = 'dc6zaTOxFJmzC';
     Ajax.getJSON(
         'http://api.giphy.com/v1/gifs/' + endpoint + '?' + Ajax.param(params),
         callback);
 }