conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
const { ipcMain } = require('electron');
=======
const { protocol } = require('electron');
>>>>>>>
const { protocol } = require('electron');
const { ipcMain } = require('electron'); |
<<<<<<<
const staticFileGlobs = input.staticFileGlobs;
const globIgnores = input.globIgnores;
=======
const globPatterns = input.globPatterns;
const globIgnores = input.globIgnores ? input.globIgnores : [];
>>>>>>>
const staticFileGlobs = input.staticFileGlobs;
const globIgnores = input.globIgnores ? input.globIgnores : []; |
<<<<<<<
// XXX: 设置监控的对象,域名在此之外的,会做客户端监控报告,但不发往服务器。
// .alipay.com
// .sit.alipay.net
domain: ".sit.alipay.net",
=======
checkProtocol: "https:" == location.protocol,
>>>>>>>
// XXX: 设置监控的对象,域名在此之外的,会做客户端监控报告,但不发往服务器。
// .alipay.com
// .sit.alipay.net
domain: ".sit.alipay.net",
checkProtocol: "https:" == location.protocol,
<<<<<<<
// @see http://www.javascriptkit.com/jsref/image.shtml
var img = new Image(1,1);
=======
var img = new Image(1,1);
>>>>>>>
// @see http://www.javascriptkit.com/jsref/image.shtml
var img = new Image(1,1);
<<<<<<<
var list = [],
s = "",
len = window.monitor.url_len - JSON.toString(d).length - 10,
arr = [];
do{
if(encodeURIComponent(JSON.toString(arr.concat(data.htmlError[0]))).length < len){
arr.push(data.htmlError.shift());
=======
var list = [], s="", len=window.monitor.maxLength -
JSON.toString(d).length - 10,
arr = [];
for(var i=0,l=data.htmlError.length; i<l; i++){
if(JSON.toString(arr.concat(data.htmlError[i])).length < len){
arr.push(data.htmlError[i]);
>>>>>>>
var list = [],
s = "",
len = window.monitor.maxLength - JSON.toString(d).length - 10,
arr = [];
do{
if(encodeURIComponent(JSON.toString(arr.concat(data.htmlError[0]))).length < len){
arr.push(data.htmlError.shift()); |
<<<<<<<
loadFields,
NUMBER_TYPES
} from '@/lib/parser'
=======
loadFields
} from '../lib/parser'
>>>>>>>
loadFields,
NUMBER_TYPES
} from '../lib/parser' |
<<<<<<<
=======
const Todo = require('./todoModel');
>>>>>>>
<<<<<<<
todos(_, __, { client, req }) {
try {
// we have an incoming query
// we parse the query to find out what it is asking for:
// Case 1: if the incoming query is exactly same as a previous query, then return just from cache.\
// Case 2: if the incoming query is completely different...
// Case 3 (hardest): incoming query is partially different than a previous query:
// // we check the cache for the info
// // any info that isnt there, we check the database
// // if our cache is empty or is misisng info from the database
// // we then need to update the cache with what was returned from the database
// // ship off the data back to the client
// console.log(query)
let newID = Math.random().toString();
console.log(query)
return axios.get('http://localhost:3000/todos').then((res) => {
client.set(newID, JSON.stringify(res.data), (err, result) => {
if (err) console.log('errored inside of client.set ' + err)
console.log('client.set ' + result)
// client.get(newID, (err, cachedData) => {
// console.log(cachedData);
// })
})
return res.data;
});
} catch (err) {
console.log(err)
return false
}
=======
async todos() {
const todos = await Todo.find({});
return todos;
>>>>>>>
async todos(_, __, context) {
try {
// we have an incoming query
// we parse the query to find out what it is asking for:
// Case 1: if the incoming query is exactly same as a previous query, then return just from cache.\
// Case 2: if the incoming query is completely different...
// Case 3 (hardest): incoming query is partially different than a previous query:
// // we check the cache for the info
// // any info that isnt there, we check the database
// // if our cache is empty or is misisng info from the database
// // we then need to update the cache with what was returned from the database
// // ship off the data back to the client
// console.log(query)
// let newID = Math.random().toString();
console.log(query)
const todos = await context.models.findMany({})
// get the data from the database
// todos
res.locals.todos = todos;
next()
return axios.get('http://localhost:3000/todos').then((res) => {
client.set(newID, JSON.stringify(res.data), (err, result) => {
if (err) console.log('errored inside of client.set ' + err)
console.log('client.set ' + result)
// client.get(newID, (err, cachedData) => {
// console.log(cachedData);
// })
})
return res.data;
});
} catch (err) {
console.log(err)
return false
} |
<<<<<<<
=======
//last element - current page
// @todo ugly solution - rework needed
>>>>>>>
// @todo ugly solution - rework needed |
<<<<<<<
'model/military/TacticalSymbol',
'model/weather/WeatherScout',
'model/util/WmtUtil',
=======
'model/util/WmtUtil',
>>>>>>>
'model/military/TacticalSymbol',
'model/util/WmtUtil',
<<<<<<<
TacticalSymbol,
WeatherScout,
util,
=======
util,
>>>>>>>
TacticalSymbol,
util,
<<<<<<<
* @param {Object} params Object containing with manager objects
=======
* @param {Array} params Array containing markerManager objects
>>>>>>>
* @param {Object} params Object containing with manager objects
<<<<<<<
this.symbolManager = params.symbolManager;
this.weatherManager = params.weatherManager;
=======
>>>>>>>
this.symbolManager = params.symbolManager;
<<<<<<<
/**
* Arms the click-drop handler to add a tactical symbol to the globe. See: handleClick below.
*/
GlobeViewModel.prototype.armDropSymbol = function () {
this.dropIsArmed(true);
this.dropCallback = this.dropSymbolCallback;
this.dropObject = this.selectedSymbolTemplate();
};
/**
* Arms the click-drop handler to add a weather scout to the globe. See: handleClick below.
*/
GlobeViewModel.prototype.armDropScout = function () {
this.dropIsArmed(true);
this.dropCallback = this.dropScoutCallback;
this.dropObject = null;
};
=======
>>>>>>>
/**
* Arms the click-drop handler to add a tactical symbol to the globe. See: handleClick below.
*/
GlobeViewModel.prototype.armDropSymbol = function () {
this.dropIsArmed(true);
this.dropCallback = this.dropSymbolCallback;
this.dropObject = this.selectedSymbolTemplate();
}; |
<<<<<<<
'text!views/symbols.html',
'text!views/symbol-editor.html',
'text!views/weather.html',
=======
'text!views/weather-scouts.html',
>>>>>>>
'text!views/symbols.html',
'text!views/symbol-editor.html',
'text!views/weather-scouts.html',
<<<<<<<
symbolsHtml,
symbolEditorHtml,
weatherHtml,
=======
weatherScoutsHtml,
>>>>>>>
symbolsHtml,
symbolEditorHtml,
weatherScoutsHtml, |
<<<<<<<
store.currentBankId = null;
store.currentAccountId = null;
/*
{
'bankId': {
name: 'blabla',
accounts: {
'accountId1': {
name: 'something',
id: 'accountId1',
operations: [instanceof Operation]
},
'accountId2': {
}
}
},
'anotherBankId': {
// ...
}
}
*/
store.banks = {};
=======
store.currentBankId = null;
store.currentAccountId = null;
/*
* // Contains user bank data.
{
'bankId': {
name: 'blabla',
accounts: {
'accountId1': {
name: 'something',
id: 'accountId1',
operations: [instanceof Operation]
},
'accountId2': {
}
}
},
'anotherBankId': {
// ...
}
}
*/
store.banks = {};
/* Contains static information about banks (name/uuid) */
store.StaticBanks = {};
>>>>>>>
store.currentBankId = null;
store.currentAccountId = null;
/*
{
'bankId': {
name: 'blabla',
accounts: {
'accountId1': {
name: 'something',
id: 'accountId1',
operations: [instanceof Operation]
},
'accountId2': {
}
}
},
'anotherBankId': {
// ...
}
}
*/
store.banks = {};
/* Contains static information about banks (name/uuid) */
store.StaticBanks = {};
<<<<<<<
/*
* GETTERS
**/
// [{bankId, bankName}]
store.getBanks = function() {
has(this, 'banks');
var banks = [];
for (var id in this.banks) {
var b = this.banks[id];
banks.push({
id: b.id,
name: b.name
});
}
return banks;
}
// [instanceof Account]
store.getCurrentBankAccounts = function() {
assert(typeof this.currentBankId !== null);
has(this.banks, this.currentBankId);
has(this.banks[this.currentBankId], 'accounts');
var accounts = [];
for (var id in this.banks[this.currentBankId].accounts) {
var acc = this.banks[this.currentBankId].accounts[id];
accounts.push(acc);
}
return accounts;
}
// instanceof Account
store.getCurrentAccount = function() {
assert(typeof this.currentBankId !== null);
assert(typeof this.currentAccountId !== null);
has(this.banks[this.currentBankId], 'accounts');
has(this.banks[this.currentBankId].accounts, this.currentAccountId);
return this.banks[this.currentBankId].accounts[this.currentAccountId];
}
// [instanceof Operation]
store.getCurrentOperations = function() {
return store.getCurrentAccount().operations;
}
// [instanceof Category]
store.getCategories = function() {
return this.categories;
}
// String
store.getSetting = function(key) {
var dict = store.settings;
assert(typeof dict[key] !== 'undefined', 'setting not set: ' + key);
return dict[key];
}
/*
* BACKEND
**/
// BANKS
store.loadAllBanks = function() {
$.get('banks', {withAccountOnly:true}, function (data) {
var banks = {};
for (var i = 0; i < data.length; i++) {
var b = new Bank(data[i]);
banks[b.id] = b;
}
=======
/*
* GETTERS
**/
// [{bankId, bankName}]
store.getStaticBanks = function() {
has(this, 'StaticBanks');
assert(this.StaticBanks !== null);
var banks = [];
for (var id in this.StaticBanks) {
var b = this.StaticBanks[id];
banks.push({
id: b.id,
name: b.name,
uuid: b.uuid
});
}
return banks;
}
// [{bankId, bankName}]
store.getBanks = function() {
has(this, 'banks');
var banks = [];
for (var id in this.banks) {
var b = this.banks[id];
banks.push(b);
}
return banks;
}
// [instanceof Account]
store.getCurrentBankAccounts = function() {
if (this.currentBankId === null) {
return [];
}
has(this.banks, this.currentBankId);
has(this.banks[this.currentBankId], 'accounts');
var accounts = [];
for (var id in this.banks[this.currentBankId].accounts) {
var acc = this.banks[this.currentBankId].accounts[id];
accounts.push(acc);
}
return accounts;
}
store.getBankAccounts = function(bankId) {
if (typeof this.banks[bankId] === 'undefined')
return [];
has(this.banks[bankId], 'accounts');
var accounts = [];
for (var id in this.banks[bankId].accounts) {
var acc = this.banks[bankId].accounts[id];
accounts.push(acc);
}
return accounts;
}
// instanceof Account
store.getCurrentAccount = function() {
assert(typeof this.currentBankId !== null);
assert(typeof this.currentAccountId !== null);
has(this.banks[this.currentBankId], 'accounts');
has(this.banks[this.currentBankId].accounts, this.currentAccountId);
return this.banks[this.currentBankId].accounts[this.currentAccountId];
}
// [instanceof Operation]
store.getCurrentOperations = function() {
return store.getCurrentAccount().operations;
}
// [instanceof Category]
store.getCategories = function() {
return this.categories;
}
// String
store.getSetting = function(key) {
var dict = store.settings;
assert(typeof dict[key] !== 'undefined', 'setting not set: ' + key);
return dict[key];
}
/*
* BACKEND
**/
>>>>>>>
/*
* GETTERS
**/
// [{bankId, bankName}]
store.getStaticBanks = function() {
has(this, 'StaticBanks');
assert(this.StaticBanks !== null);
var banks = [];
for (var id in this.StaticBanks) {
var b = this.StaticBanks[id];
banks.push({
id: b.id,
name: b.name,
uuid: b.uuid
});
}
return banks;
}
// [{bankId, bankName}]
store.getBanks = function() {
has(this, 'banks');
var banks = [];
for (var id in this.banks) {
var b = this.banks[id];
banks.push(b);
}
return banks;
}
// [instanceof Account]
store.getCurrentBankAccounts = function() {
if (this.currentBankId === null) {
return [];
}
has(this.banks, this.currentBankId);
has(this.banks[this.currentBankId], 'accounts');
var accounts = [];
for (var id in this.banks[this.currentBankId].accounts) {
var acc = this.banks[this.currentBankId].accounts[id];
accounts.push(acc);
}
return accounts;
}
store.getBankAccounts = function(bankId) {
if (typeof this.banks[bankId] === 'undefined')
return [];
has(this.banks[bankId], 'accounts');
var accounts = [];
for (var id in this.banks[bankId].accounts) {
var acc = this.banks[bankId].accounts[id];
accounts.push(acc);
}
return accounts;
}
// instanceof Account
store.getCurrentAccount = function() {
assert(typeof this.currentBankId !== null);
assert(typeof this.currentAccountId !== null);
has(this.banks[this.currentBankId], 'accounts');
has(this.banks[this.currentBankId].accounts, this.currentAccountId);
return this.banks[this.currentBankId].accounts[this.currentAccountId];
}
// [instanceof Operation]
store.getCurrentOperations = function() {
return store.getCurrentAccount().operations;
}
// [instanceof Category]
store.getCategories = function() {
return this.categories;
}
// String
store.getSetting = function(key) {
var dict = store.settings;
assert(typeof dict[key] !== 'undefined', 'setting not set: ' + key);
return dict[key];
}
/*
* BACKEND
**/
<<<<<<<
if (data.length > 0) {
=======
if (firstBankId !== null) {
>>>>>>>
if (firstBankId !== null) {
<<<<<<<
bankId: data[0].id
=======
bankId: firstBankId
>>>>>>>
bankId: firstBankId
<<<<<<<
// OPERATIONS
store.loadOperationsForImpl = function(bankId, accountId, propagate) {
$.get('accounts/getOperations/' + accountId, function (data) {
var operations = [];
for (var i = 0; i < data.length; i++) {
var o = new Operation(data[i])
operations.push(o);
}
flux.dispatch({
type: Events.server.loaded_operations,
bankId: bankId,
accountId: accountId,
operations: operations,
propagate: propagate
});
}).fail(xhrError);
=======
store.deleteAccount = function(account) {
backend.deleteAccount(account.id, function() {
flux.dispatch({
type: Events.server.deleted_account
});
});
}
// OPERATIONS
store.loadOperationsForImpl = function(bankId, accountId, propagate) {
backend.getOperations(accountId, function(operations) {
flux.dispatch({
type: Events.server.loaded_operations,
bankId: bankId,
accountId: accountId,
operations: operations,
propagate: propagate
});
});
>>>>>>>
store.deleteAccount = function(account) {
backend.deleteAccount(account.id, function() {
flux.dispatch({
type: Events.server.deleted_account
});
});
}
// OPERATIONS
store.loadOperationsForImpl = function(bankId, accountId, propagate) {
backend.getOperations(accountId, function(operations) {
flux.dispatch({
type: Events.server.loaded_operations,
bankId: bankId,
accountId: accountId,
operations: operations,
propagate: propagate
});
});
<<<<<<<
case Events.server.loaded_accounts:
has(action, 'accountMap');
has(action, 'bankId');
store.banks[action.bankId].accounts = action.accountMap;
store.emit(Events.server.loaded_accounts);
=======
case Events.server.loaded_accounts_current_bank:
has(action, 'accountMap');
has(action, 'bankId');
store.banks[action.bankId].accounts = action.accountMap;
store.emit(Events.server.loaded_accounts_current_bank);
break;
case Events.server.loaded_accounts_any_bank:
has(action, 'accountMap');
has(action, 'bankId');
// Don't clobber current values!
for (var id in action.accountMap) {
var accs = store.banks[action.bankId].accounts;
if (typeof accs[id] !== 'undefined')
accs[id].mergeOwnProperties(action.accountMap[id]);
else
accs[id] = action.accountMap[id];
}
store.emit(Events.server.loaded_accounts_any_bank);
>>>>>>>
case Events.server.loaded_accounts_current_bank:
has(action, 'accountMap');
has(action, 'bankId');
store.banks[action.bankId].accounts = action.accountMap;
store.emit(Events.server.loaded_accounts_current_bank);
break;
case Events.server.loaded_accounts_any_bank:
has(action, 'accountMap');
has(action, 'bankId');
// Don't clobber current values!
for (var id in action.accountMap) {
var accs = store.banks[action.bankId].accounts;
if (typeof accs[id] !== 'undefined')
accs[id].mergeOwnProperties(action.accountMap[id]);
else
accs[id] = action.accountMap[id];
}
store.emit(Events.server.loaded_accounts_any_bank);
<<<<<<<
if (store.currentBankId &&
store.currentAccountId &&
store.banks[store.currentBankId].accounts[store.currentAccountId].operations.length > 0) {
=======
if (store.currentBankId !== null &&
store.currentAccountId !== null &&
store.banks[store.currentBankId].accounts[store.currentAccountId].operations.length > 0) {
>>>>>>>
if (store.currentBankId !== null &&
store.currentAccountId !== null &&
store.banks[store.currentBankId].accounts[store.currentAccountId].operations.length > 0) { |
<<<<<<<
console.log('------------------------- CONNECTION');
console.log(user);
console.log('------------------------- CONNECTION');
if (!user) {
=======
if(!user) {
>>>>>>>
if (!user) {
<<<<<<<
socket.on('channel-join', function(params, callback) {
var err = serverUtils.validSocketParams(params, ['channel', 'userId']);
if (err) {
=======
socket.on('channel-join', function (params, callback) {
// ??? why receive userId
var err = serverUtils.validSocketParams(params, ['channel','userId']);
if(err){
>>>>>>>
socket.on('channel-join', function(params, callback) {
var err = serverUtils.validSocketParams(params, ['channel', 'userId']);
if (err) {
<<<<<<<
=======
>>>>>>> |
<<<<<<<
mongoPersister.registerUser(_param.app, _param.userId, _param.deviceType, _param.deviceId, _param.notiId, _param.datas,function (err, msg) {
=======
console.log(_param);
mongoPersister.registerUser(_param.app, _param.userId, _param.deviceType, _param.deviceId, _param.notiId, _param.datas, function (err, msg) {
>>>>>>>
mongoPersister.registerUser(_param.app, _param.userId, _param.deviceType, _param.deviceId, _param.notiId, _param.datas, function (err, msg) { |
<<<<<<<
=======
exports.ref = resolve; // XXX deprecated, use resolve
>>>>>>>
<<<<<<<
"apply": function (args) {
return object.apply(void 0, args);
},
=======
"apply": function (self, args) {
return object.apply(self, args);
},
"fapply": function (args) {
return object.apply(void 0, args);
},
"viewInfo": function () {
var on = object;
var properties = {};
function fixFalsyProperty(name) {
if (!properties[name]) {
properties[name] = typeof on[name];
}
}
while (on) {
Object.getOwnPropertyNames(on).forEach(fixFalsyProperty);
on = Object.getPrototypeOf(on);
}
return {
"type": typeof object,
"properties": properties
};
},
>>>>>>>
"apply": function (args) {
return object.apply(void 0, args);
},
<<<<<<<
=======
* Throws a ReturnValue exception to stop an asynchronous generator.
* Only useful presently in Firefox/SpiderMonkey since generators are
* implemented.
* @param value the return value for the surrounding generator
* @throws ReturnValue exception with the value.
* @example
* Q.async(function () {
* var foo = yield getFooPromise();
* var bar = yield getBarPromise();
* Q.return(foo + bar);
* })
*/
exports['return'] = _return;
function _return(value) {
throw new ReturnValue(value);
}
/**
* Constructs a promise method that can be used to safely observe resolution of
* a promise for an arbitrarily named method like "propfind" in a future turn.
*/
exports.sender = sender; // XXX deprecated, use dispatcher
exports.Method = sender; // XXX deprecated, use dispatcher
function sender(op) {
return function (object) {
var args = Array_slice(arguments, 1);
return send.apply(void 0, [object, op].concat(args));
};
}
/**
* sends a message to a value in a future turn
* @param object* the recipient
* @param op the name of the message operation, e.g., "when",
* @param ...args further arguments to be forwarded to the operation
* @returns result {Promise} a promise for the result of the operation
*/
exports.send = send; // XXX deprecated, use dispatch
function send(object, op) {
var deferred = defer();
var args = Array_slice(arguments, 2);
object = resolve(object);
nextTick(function () {
object.promiseSend.apply(
object,
[op, deferred.resolve].concat(args)
);
});
return deferred.promise;
}
/**
>>>>>>>
* Throws a ReturnValue exception to stop an asynchronous generator.
* Only useful presently in Firefox/SpiderMonkey since generators are
* implemented.
* @param value the return value for the surrounding generator
* @throws ReturnValue exception with the value.
* @example
* Q.async(function () {
* var foo = yield getFooPromise();
* var bar = yield getBarPromise();
* Q.return(foo + bar);
* })
*/
exports['return'] = _return;
function _return(value) {
throw new ReturnValue(value);
}
/**
<<<<<<<
=======
* @param thisp the `this` object for the call
* @param args array of application arguments
*/
var apply = exports.apply = dispatcher("apply"); // XXX deprecated, use fapply
/**
* Applies the promised function in a future turn.
* @param object promise or immediate reference for target function
>>>>>>>
<<<<<<<
var fapply = exports.fapply = dispatcher("apply");
=======
var fapply = exports.fapply = dispatcher("fapply");
/**
* Calls the promised function in a future turn.
* @param object promise or immediate reference for target function
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
exports.call = call; // XXX deprecated, use fcall
function call(value, thisp) {
var args = Array_slice(arguments, 2);
return apply(value, thisp, args);
}
>>>>>>>
var fapply = exports.fapply = dispatcher("apply");
<<<<<<<
=======
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
exports.bind = bind; // XXX deprecated, use fbind
function bind(value, thisp) {
var args = Array_slice(arguments, 2);
return function bound() {
var allArgs = args.concat(Array_slice(arguments));
return apply(value, thisp, allArgs);
};
}
/**
* Binds the promised function, transforming return values into a fulfilled
* promise and thrown errors into a rejected one.
* @param object promise or immediate reference for target function
>>>>>>> |
<<<<<<<
=======
exports.ref = deprecate(resolve, "ref", "resolve"); // XXX deprecated, use resolve
>>>>>>>
<<<<<<<
}, function fallback(op, args) {
return dispatch(object, op, args);
=======
}, function fallback() {
var args = array_slice(arguments);
return send.apply(void 0, [object].concat(args));
>>>>>>>
}, function fallback(op, args) {
return dispatch(object, op, args);
<<<<<<<
=======
exports.viewInfo = viewInfo;
function viewInfo(object, info) {
object = resolve(object);
if (info) {
return makePromise({
"viewInfo": function () {
return info;
}
}, function fallback() {
var args = array_slice(arguments);
return send.apply(void 0, [object].concat(args));
}, function () {
return valueOf(object);
});
} else {
return send(object, "viewInfo");
}
}
exports.view = view;
function view(object) {
return viewInfo(object).when(function (info) {
var view;
if (info.type === "function") {
view = function () {
return apply(object, void 0, arguments);
};
} else {
view = {};
}
var properties = info.properties || {};
object_keys(properties).forEach(function (name) {
if (properties[name] === "function") {
view[name] = function () {
return post(object, name, arguments);
};
}
});
return resolve(view);
});
}
>>>>>>>
<<<<<<<
resolve(value).promiseDispatch(
function (value) {
if (done) {
return;
}
done = true;
resolve(value).promiseDispatch(
function (value) {
deferred.resolve(_fulfilled(value));
},
"when",
[
function (exception) {
deferred.resolve(_rejected(exception));
}
]
);
},
"when",
[
function (exception) {
if (done) {
return;
}
done = true;
deferred.resolve(_rejected(exception));
}
]
);
=======
resolve(value).promiseSend("when", function (value) {
if (done) {
return;
}
done = true;
deferred.resolve(_fulfilled(value));
}, function (exception) {
if (done) {
return;
}
done = true;
deferred.resolve(_rejected(exception));
});
>>>>>>>
resolve(value).promiseDispatch(function (value) {
if (done) {
return;
}
done = true;
deferred.resolve(_fulfilled(value));
}, "when", [function (exception) {
if (done) {
return;
}
done = true;
deferred.resolve(_rejected(exception));
}]);
<<<<<<<
=======
* The promised function decorator ensures that any promise arguments
* are resolved and passed as values (`this` is also resolved and passed
* as a value). It will also ensure that the result of a function is
* always a promise.
*
* @example
* var add = Q.promised(function (a, b) {
* return a + b;
* });
* add(Q.resolve(a), Q.resolve(B));
*
* @param {function} fn The function to decorate
* @returns {function} a function that has been decorated.
*/
exports.promised = promised;
function promised(fn) {
return function () {
return all([this, all(arguments)]).spread(function (self, args) {
return fn.apply(self, args);
});
};
}
/**
* Constructs a promise method that can be used to safely observe resolution of
* a promise for an arbitrarily named method like "propfind" in a future turn.
*/
exports.sender = deprecate(sender, "sender", "dispatcher"); // XXX deprecated, use dispatcher
exports.Method = deprecate(sender, "Method", "dispatcher"); // XXX deprecated, use dispatcher
function sender(op) {
return function (object) {
var args = array_slice(arguments, 1);
return send.apply(void 0, [object, op].concat(args));
};
}
/**
* sends a message to a value in a future turn
* @param object* the recipient
* @param op the name of the message operation, e.g., "when",
* @param ...args further arguments to be forwarded to the operation
* @returns result {Promise} a promise for the result of the operation
*/
exports.send = deprecate(send, "send", "dispatch"); // XXX deprecated, use dispatch
function send(object, op) {
var deferred = defer();
var args = array_slice(arguments, 2);
object = resolve(object);
nextTick(function () {
object.promiseSend.apply(
object,
[op, deferred.resolve].concat(args)
);
});
return deferred.promise;
}
/**
>>>>>>>
* The promised function decorator ensures that any promise arguments
* are resolved and passed as values (`this` is also resolved and passed
* as a value). It will also ensure that the result of a function is
* always a promise.
*
* @example
* var add = Q.promised(function (a, b) {
* return a + b;
* });
* add(Q.resolve(a), Q.resolve(B));
*
* @param {function} wrapped The function to decorate
* @returns {function} a function that has been decorated.
*/
exports.promised = promised;
function promised(wrapped) {
return function () {
return all([this, all(arguments)])
.spread(function (self, args) {
return wrapped.apply(self, args);
});
};
}
/**
<<<<<<<
var fapply = exports.fapply = dispatcher("apply");
=======
// XXX deprecated, use fapply
var apply = exports.apply = deprecate(dispatcher("apply"), "apply", "fapply");
/**
* Applies the promised function in a future turn.
* @param object promise or immediate reference for target function
* @param args array of application arguments
*/
var fapply = exports.fapply = dispatcher("fapply");
/**
* Calls the promised function in a future turn.
* @param object promise or immediate reference for target function
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
// XXX deprecated, use fcall
exports.call = deprecate(call, "call", "fcall");
function call(value, thisp) {
var args = array_slice(arguments, 2);
return apply(value, thisp, args);
}
>>>>>>>
var fapply = exports.fapply = dispatcher("apply");
<<<<<<<
=======
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
exports.bind = deprecate(bind, "bind", "fbind"); // XXX deprecated, use fbind
function bind(value, thisp) {
var args = array_slice(arguments, 2);
return function bound() {
var allArgs = args.concat(array_slice(arguments));
return apply(value, thisp, allArgs);
};
}
/**
* Binds the promised function, transforming return values into a fulfilled
* promise and thrown errors into a rejected one.
* @param object promise or immediate reference for target function
>>>>>>> |
<<<<<<<
"apply", "call",
"all", "allResolved",
=======
"apply", "call", "bind",
"all",
>>>>>>>
"apply", "call", "bind",
"all", "allResolved",
<<<<<<<
var call = exports['try'] = exports.call = function (value, context) {
=======
exports.call = call;
function call(value, context) {
>>>>>>>
exports.call = exports['try'] = call;
function call(value, context) { |
<<<<<<<
promise.promiseDispatch = function () {
var args = Array_slice(arguments);
=======
promise.promiseSend = function () {
var args = array_slice(arguments);
>>>>>>>
promise.promiseDispatch = function () {
var args = array_slice(arguments);
<<<<<<<
promise.promiseDispatch = function (resolve, op, args) {
=======
promise.promiseSend = function (op, resolved /* ...args */) {
var args = array_slice(arguments, 2);
var result;
>>>>>>>
promise.promiseDispatch = function (resolve, op, args) {
<<<<<<<
}, function fallback(op, args) {
return dispatch(object, op, args);
=======
}, function fallback(op) {
var args = array_slice(arguments);
return send.apply(void 0, [object].concat(args));
>>>>>>>
}, function fallback(op, args) {
return dispatch(object, op, args);
<<<<<<<
=======
exports.viewInfo = viewInfo;
function viewInfo(object, info) {
object = resolve(object);
if (info) {
return makePromise({
"viewInfo": function () {
return info;
}
}, function fallback(op) {
var args = array_slice(arguments);
return send.apply(void 0, [object].concat(args));
}, function () {
return valueOf(object);
});
} else {
return send(object, "viewInfo");
}
}
exports.view = view;
function view(object) {
return viewInfo(object).when(function (info) {
var view;
if (info.type === "function") {
view = function () {
return apply(object, void 0, arguments);
};
} else {
view = {};
}
var properties = info.properties || {};
object_keys(properties).forEach(function (name) {
if (properties[name] === "function") {
view[name] = function () {
return post(object, name, arguments);
};
}
});
return resolve(view);
});
}
>>>>>>>
<<<<<<<
=======
* Constructs a promise method that can be used to safely observe resolution of
* a promise for an arbitrarily named method like "propfind" in a future turn.
*/
exports.sender = sender; // XXX deprecated, use dispatcher
exports.Method = sender; // XXX deprecated, use dispatcher
function sender(op) {
return function (object) {
var args = array_slice(arguments, 1);
return send.apply(void 0, [object, op].concat(args));
};
}
/**
* sends a message to a value in a future turn
* @param object* the recipient
* @param op the name of the message operation, e.g., "when",
* @param ...args further arguments to be forwarded to the operation
* @returns result {Promise} a promise for the result of the operation
*/
exports.send = send; // XXX deprecated, use dispatch
function send(object, op) {
var deferred = defer();
var args = array_slice(arguments, 2);
object = resolve(object);
nextTick(function () {
object.promiseSend.apply(
object,
[op, deferred.resolve].concat(args)
);
});
return deferred.promise;
}
/**
>>>>>>>
<<<<<<<
var fapply = exports.fapply = dispatcher("apply");
=======
var fapply = exports.fapply = dispatcher("fapply");
/**
* Calls the promised function in a future turn.
* @param object promise or immediate reference for target function
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
exports.call = call; // XXX deprecated, use fcall
function call(value, thisp) {
var args = array_slice(arguments, 2);
return apply(value, thisp, args);
}
>>>>>>>
var fapply = exports.fapply = dispatcher("apply");
<<<<<<<
=======
* @param thisp the `this` object for the call
* @param ...args array of application arguments
*/
exports.bind = bind; // XXX deprecated, use fbind
function bind(value, thisp) {
var args = array_slice(arguments, 2);
return function bound() {
var allArgs = args.concat(array_slice(arguments));
return apply(value, thisp, allArgs);
};
}
/**
* Binds the promised function, transforming return values into a fulfilled
* promise and thrown errors into a rejected one.
* @param object promise or immediate reference for target function
>>>>>>> |
<<<<<<<
const { getAccessKey, isLoggedIn, getDefaultOrgName, getTemplate } = require('./utils');
const { loadServerlessFile, fileExists, loadComponentConfig } = require('../utils');
=======
const { getAccessKey, isLoggedIn, getDefaultOrgName } = require('./utils');
const { fileExists, loadComponentConfig } = require('../utils');
const { loadServerlessFile } = require('../serverlessFile');
>>>>>>>
const { getAccessKey, isLoggedIn, getDefaultOrgName, getTemplate } = require('./utils');
const { fileExists, loadComponentConfig } = require('../utils');
const { loadServerlessFile } = require('../serverlessFile'); |
<<<<<<<
console.log(os.EOL) // eslint-disable-line
let content = ` ${chalk.grey(this._.seconds + 's')}`
content += ` ${chalk.grey(figures.pointerSmall)} ${chalk.green(this._.stage)}`
content += ` ${chalk.grey(figures.pointerSmall)} ${this._.parentComponent}`
content += ` ${chalk.grey(figures.pointerSmall)} ${chalk.grey(this._.status.message)}`
content += ` ${chalk.grey(this._.status.loadingDots)}`
=======
console.log(os.EOL)
let content = ` ${grey(this._.seconds + 's')}`
content += ` ${grey(figures.pointerSmall)} ${green(this._.stage)}`
content += ` ${grey(figures.pointerSmall)} ${this._.parentComponent}`
content += ` ${grey(figures.pointerSmall)} ${grey(this._.status.message)}`
content += ` ${grey(this._.status.loadingDots)}`
>>>>>>>
console.log(os.EOL) // eslint-disable-line
let content = ` ${grey(this._.seconds + 's')}`
content += ` ${grey(figures.pointerSmall)} ${green(this._.stage)}`
content += ` ${grey(figures.pointerSmall)} ${this._.parentComponent}`
content += ` ${grey(figures.pointerSmall)} ${grey(this._.status.message)}`
content += ` ${grey(this._.status.loadingDots)}`
<<<<<<<
entity = `${chalk.grey(this._.seconds + `s`)} ${chalk.grey(figures.pointerSmall)} ${chalk.grey(
entity
)} ${chalk.grey(figures.pointerSmall)} ${chalk.grey(`status:`)}`
console.log(` ${entity}`) // eslint-disable-line
console.log(` `, status) // eslint-disable-line
=======
entity = `${grey(this._.seconds + `s`)} ${grey(figures.pointerSmall)} ${grey(entity)} ${grey(figures.pointerSmall)} ${grey(`status:`)}`
console.log(` ${entity}`)
console.log(` `, status)
>>>>>>>
entity = `${grey(this._.seconds + `s`)} ${grey(figures.pointerSmall)} ${grey(entity)} ${grey(
figures.pointerSmall
)} ${grey(`status:`)}`
console.log(` ${entity}`) // eslint-disable-line
console.log(` `, status) // eslint-disable-line
<<<<<<<
entity = `${chalk.grey(entity)} ${chalk.grey(figures.pointerSmall)} ${chalk.grey(`log:`)}`
console.log(` ${entity}`) // eslint-disable-line
=======
entity = `${grey(entity)} ${grey(figures.pointerSmall)} ${grey(`log:`)}`
console.log(` ${entity}`)
>>>>>>>
entity = `${grey(entity)} ${grey(figures.pointerSmall)} ${grey(`log:`)}`
console.log(` ${entity}`) // eslint-disable-line
<<<<<<<
console.log(` ${chalk.grey(output + ':')} `) // eslint-disable-line
=======
console.log(` ${grey(output + ':')} `)
>>>>>>>
console.log(` ${grey(output + ':')} `) // eslint-disable-line
<<<<<<<
// eslint-disable-next-line
console.log(
` ${chalk.grey(nextOutput + ':')} `,
util.inspect(nextOutputs[nextOutput], { colors: false })
)
=======
console.log(` ${grey(nextOutput + ':')} `, util.inspect(nextOutputs[nextOutput], { colors: false }))
>>>>>>>
// eslint-disable-next-line
console.log(
` ${grey(nextOutput + ':')} `,
util.inspect(nextOutputs[nextOutput], { colors: false })
)
<<<<<<<
// eslint-disable-next-line
console.log(
` ${chalk.grey(output + ':')} `,
util.inspect(outputs[output], { colors: false })
)
=======
console.log(` ${grey(output + ':')} `, util.inspect(outputs[output], { colors: false }))
>>>>>>>
// eslint-disable-next-line
console.log(` ${grey(output + ':')} `, util.inspect(outputs[output], { colors: false })) |
<<<<<<<
var recentCards = remote.getGlobal('recentCards');
=======
var port = remote.getGlobal('port');
>>>>>>>
var recentCards = remote.getGlobal('recentCards');
var port = remote.getGlobal('port'); |
<<<<<<<
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/api/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/github/callback'
},
paypal: {
clientID: process.env.PAYPAL_ID || 'CLIENT_ID',
clientSecret: process.env.PAYPAL_SECRET || 'CLIENT_SECRET',
callbackURL: '/api/auth/paypal/callback',
sandbox: false
},
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: {
service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER',
auth: {
user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID',
pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD'
}
}
}
=======
secure: true,
port: process.env.PORT || 8443,
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
options: {
user: '',
pass: ''
}
},
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
format: 'combined',
// Stream defaults to process.stdout
// Uncomment to enable logging to a log on the file system
options: {
stream: 'access.log'
}
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/api/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: {
service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER',
auth: {
user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID',
pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD'
}
}
}
>>>>>>>
secure: true,
port: process.env.PORT || 8443,
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
options: {
user: '',
pass: ''
}
},
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'
format: 'combined',
// Stream defaults to process.stdout
// Uncomment to enable logging to a log on the file system
options: {
stream: 'access.log'
}
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/api/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/api/auth/github/callback'
},
paypal: {
clientID: process.env.PAYPAL_ID || 'CLIENT_ID',
clientSecret: process.env.PAYPAL_SECRET || 'CLIENT_SECRET',
callbackURL: '/api/auth/paypal/callback',
sandbox: false
},
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: {
service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER',
auth: {
user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID',
pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD'
}
}
} |
<<<<<<<
for (var itemIndex in service.menus[menuId].items) {
if (service.menus[menuId].items[itemIndex].state === parentItemState) {
// Push new submenu item
service.menus[menuId].items[itemIndex].items.push({
title: options.title || '',
state: options.state || '',
params: options.params || {},
roles: ((options.roles === null || typeof options.roles === 'undefined') ? service.menus[menuId].items[itemIndex].roles : options.roles),
position: options.position || 0,
shouldRender: shouldRender,
target: options.target || undefined,
divider: options.divider || false
});
}
}
=======
service.menus[menuId].items.filter(function (item) {
return item.state === parentItemState;
}).forEach(function (item) {
item.items.push({
title: options.title || '',
state: options.state || '',
params: options.params || {},
roles: ((options.roles === null || typeof options.roles === 'undefined') ? item.roles : options.roles),
position: options.position || 0,
shouldRender: shouldRender
});
});
>>>>>>>
service.menus[menuId].items.filter(function (item) {
return item.state === parentItemState;
}).forEach(function (item) {
item.items.push({
title: options.title || '',
state: options.state || '',
params: options.params || {},
roles: ((options.roles === null || typeof options.roles === 'undefined') ? item.roles : options.roles),
position: options.position || 0,
shouldRender: shouldRender,
target: options.target || undefined,
divider: options.divider || false
});
}); |
<<<<<<<
switch (shape.constructor.name) {
case "Box":
geometry = pc.scene.procedural.createBox({
=======
switch (shape.type) {
case pc.shape.Type.BOX:
geometry = pc.graph.procedural.createBox({
>>>>>>>
switch (shape.type) {
case pc.shape.Type.BOX:
geometry = pc.scene.procedural.createBox({
<<<<<<<
case "Sphere":
geometry = pc.scene.procedural.createSphere({
=======
case pc.shape.Type.SPHERE:
geometry = pc.graph.procedural.createSphere({
>>>>>>>
case pc.shape.Type.SPHERE:
geometry = pc.scene.procedural.createSphere({
<<<<<<<
case "Torus":
geometry = pc.scene.procedural.createTorus({
=======
case pc.shape.Type.TORUS:
geometry = pc.graph.procedural.createTorus({
>>>>>>>
case pc.shape.Type.TORUS:
geometry = pc.scene.procedural.createTorus({ |
<<<<<<<
this.forceFragmentPrecision = null;
=======
this.occludeDirect = false;
>>>>>>>
this.forceFragmentPrecision = null;
this.occludeDirect = false; |
<<<<<<<
// Private
function _onSet(entity, name, oldValue, newValue) {
/*
var component;
var functions = {
"asset": function (entity, name, oldValue, newValue) {
var componentData = this._getComponentData(entity);
if(componentData.model) {
this.context.scene.removeModel(componentData.model);
entity.removeChild(componentData.model.getGraph());
delete componentData.model;
componentData.model = null;
}
if(newValue) {
this.loadModelAsset(entity, newValue);
}
},
"model": function(entity, name, oldValue, newValue) {
if(newValue) {
entity.addChild(newValue.getGraph());
this.context.scene.addModel(newValue);
// Store the entity that owns this model
newValue._entity = entity;
}
}
};
if(functions[name]) {
functions[name].call(this, entity, name, oldValue, newValue);
}
*/
}
=======
>>>>>>>
/*
*/
<<<<<<<
//this.bind("set", pc.callback(this, _onSet));
this.bind('set_assets', this.onSetAssets.bind(this));
this.bind('set_models', this.onSetModels.bind(this));
=======
this.bind("set_asset", this.onSetAsset.bind(this));
this.bind("set_model", this.onSetModel.bind(this));
>>>>>>>
this.bind("set_asset", this.onSetAsset.bind(this));
this.bind("set", pc.callback(this, _onSet));
this.bind('set_assets', this.onSetAssets.bind(this));
this.bind('set_models', this.onSetModels.bind(this));
<<<<<<<
// Remove all models from scene/hierarchy
this.set(entity, 'assets', []);
/*
var component = this.getComponentData(entity);
var i, len = component.models.length;
for (i = 0; i < len; i++) {
this.context.scene.removeModel(component.models[i]);
entity.removeChild(component.models[i].getGraph());
}
*/
=======
this.set(entity, 'asset', null);
>>>>>>>
// Remove all models from scene/hierarchy
this.set(entity, 'assets', []);
/*
this.set(entity, 'asset', null);
var i, len = component.models.length;
for (i = 0; i < len; i++) {
this.context.scene.removeModel(component.model);
entity.removeChild(component.model.getGraph());
*/
<<<<<<<
ModelComponentSystem.prototype.render = function (fn) {
var id;
var entity;
var component;
var position;
var components = this._getComponents();
var transform;
for (id in components) {
if (components.hasOwnProperty(id)) {
entity = components[id].entity;
component = components[id].component;
=======
ModelComponentSystem.prototype.getModel = function (entity) {
return this.getComponentData(entity).model;
};
ModelComponentSystem.prototype.setVisible = function (entity, visible) {
var model = this.getModel(entity);
if (model) {
var inScene = this.context.scene.containsModel(model);
if (visible && !inScene) {
this.context.scene.addModel(model);
} else if (!visible && inScene) {
this.context.scene.removeModel(model);
>>>>>>>
ModelComponentSystem.prototype.getModel = function (entity) {
return this.getComponentData(entity).model;
};
ModelComponentSystem.prototype.setVisible = function (entity, visible) {
var model = this.getModel(entity);
if (model) {
var inScene = this.context.scene.containsModel(model);
if (visible && !inScene) {
this.context.scene.addModel(model);
} else if (!visible && inScene) {
this.context.scene.removeModel(model);
<<<<<<<
ModelComponentSystem.prototype.loadModelAssets = function(entity, guids) {
if (!guids || guids.length === 0) {
return;
}
var assetRequests = guids.map(function (guid) {
return new pc.resources.AssetRequest(guid);
});
var options = {
batch: entity.getRequestBatch()
};
=======
ModelComponentSystem.prototype.loadModelAsset = function(entity, guid) {
var request = new pc.resources.AssetRequest(guid);
var options = {
batch: entity.getRequestBatch()
};
>>>>>>>
ModelComponentSystem.prototype.loadModelAssets = function(entity, guids) {
if (!guids || guids.length === 0) {
return;
}
var assetRequests = guids.map(function (guid) {
return new pc.resources.AssetRequest(guid);
});
var options = {
batch: entity.getRequestBatch()
}; |
<<<<<<<
this.mainLight = -1;
this._activeShadowLights = [];
=======
>>>>>>>
this.mainLight = -1;
this._activeShadowLights = [];
<<<<<<<
var k;
=======
if (!pc._instanceVertexFormat) {
var formatDesc = [
{ semantic: pc.SEMANTIC_TEXCOORD2, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD3, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD4, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD5, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
];
pc._instanceVertexFormat = new pc.VertexFormat(device, formatDesc);
}
if (device.enableAutoInstancing) {
if (!pc._autoInstanceBuffer) {
pc._autoInstanceBuffer = new pc.VertexBuffer(device, pc._instanceVertexFormat, device.autoInstancingMaxObjects, pc.BUFFER_DYNAMIC);
pc._autoInstanceBufferData = new Float32Array(pc._autoInstanceBuffer.lock());
}
}
var next;
var autoInstances;
var j;
>>>>>>>
var k;
if (!pc._instanceVertexFormat) {
var formatDesc = [
{ semantic: pc.SEMANTIC_TEXCOORD2, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD3, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD4, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
{ semantic: pc.SEMANTIC_TEXCOORD5, components: 4, type: pc.ELEMENTTYPE_FLOAT32 },
];
pc._instanceVertexFormat = new pc.VertexFormat(device, formatDesc);
}
if (device.enableAutoInstancing) {
if (!pc._autoInstanceBuffer) {
pc._autoInstanceBuffer = new pc.VertexBuffer(device, pc._instanceVertexFormat, device.autoInstancingMaxObjects, pc.BUFFER_DYNAMIC);
pc._autoInstanceBufferData = new Float32Array(pc._autoInstanceBuffer.lock());
}
}
var next;
var autoInstances;
var j; |
<<<<<<<
var imagesys = new pc.ImageComponentSystem(this);
=======
var zonesys = new pc.ZoneComponentSystem(this);
>>>>>>>
var imagesys = new pc.ImageComponentSystem(this);
var zonesys = new pc.ZoneComponentSystem(this); |
<<<<<<<
=======
if (this._meshInstance) this._meshInstance.cull = false;
>>>>>>>
if (this._meshInstance) this._meshInstance.cull = false;
<<<<<<<
=======
if (this._meshInstance) this._meshInstance.cull = true;
>>>>>>>
if (this._meshInstance) this._meshInstance.cull = true; |
<<<<<<<
'$data.Object': function (o) { if (o === undefined) { return new $data.Object(); } return JSON.parse(o); },
'$data.Array': function (o) { if (o === undefined) { return new $data.Array(); } return JSON.parse(o); },
'$data.Guid': function (guid) { return typeof guid === 'string' ? $data.parseGuid(guid) : guid; },
'$data.GeographyPoint': function (g) { if (g) { return new $data.GeographyPoint(g); } return g; },
'$data.GeographyLineString': function (g) { if (g) { return new $data.GeographyLineString(g); } return g; },
'$data.GeographyPolygon': function (g) { if (g) { return new $data.GeographyPolygon(g); } return g; },
'$data.GeographyMultiPoint': function (g) { if (g) { return new $data.GeographyMultiPoint(g); } return g; },
'$data.GeographyMultiLineString': function (g) { if (g) { return new $data.GeographyMultiLineString(g); } return g; },
'$data.GeographyMultiPolygon': function (g) { if (g) { return new $data.GeographyMultiPolygon(g); } return g; },
'$data.GeographyCollection': function (g) { if (g) { return new $data.GeographyCollection(g); } return g; },
'$data.GeometryPoint': function (g) { if (g) { return new $data.GeometryPoint(g); } return g; },
'$data.GeometryLineString': function (g) { if (g) { return new $data.GeometryLineString(g); } return g; },
'$data.GeometryPolygon': function (g) { if (g) { return new $data.GeometryPolygon(g); } return g; },
'$data.GeometryMultiPoint': function (g) { if (g) { return new $data.GeometryMultiPoint(g); } return g; },
'$data.GeometryMultiLineString': function (g) { if (g) { return new $data.GeometryMultiLineString(g); } return g; },
'$data.GeometryMultiPolygon': function (g) { if (g) { return new $data.GeometryMultiPolygon(g); } return g; },
'$data.GeometryCollection': function (g) { if (g) { return new $data.GeometryCollection(g); } return g; }
=======
'$data.Object': function (o) { if (o === undefined) { return new $data.Object(); } return o; },
'$data.Array': function (o) { if (o === undefined) { return new $data.Array(); } return o; },
'$data.Guid': function (guid) { return typeof guid === 'string' ? $data.parseGuid(guid) : guid; }
>>>>>>>
'$data.Object': function (o) { if (o === undefined) { return new $data.Object(); } return o; },
'$data.Array': function (o) { if (o === undefined) { return new $data.Array(); } return o; },
'$data.Guid': function (guid) { return typeof guid === 'string' ? $data.parseGuid(guid) : guid; },
'$data.GeographyPoint': function (g) { if (g) { return new $data.GeographyPoint(g); } return g; },
'$data.GeographyLineString': function (g) { if (g) { return new $data.GeographyLineString(g); } return g; },
'$data.GeographyPolygon': function (g) { if (g) { return new $data.GeographyPolygon(g); } return g; },
'$data.GeographyMultiPoint': function (g) { if (g) { return new $data.GeographyMultiPoint(g); } return g; },
'$data.GeographyMultiLineString': function (g) { if (g) { return new $data.GeographyMultiLineString(g); } return g; },
'$data.GeographyMultiPolygon': function (g) { if (g) { return new $data.GeographyMultiPolygon(g); } return g; },
'$data.GeographyCollection': function (g) { if (g) { return new $data.GeographyCollection(g); } return g; },
'$data.GeometryPoint': function (g) { if (g) { return new $data.GeometryPoint(g); } return g; },
'$data.GeometryLineString': function (g) { if (g) { return new $data.GeometryLineString(g); } return g; },
'$data.GeometryPolygon': function (g) { if (g) { return new $data.GeometryPolygon(g); } return g; },
'$data.GeometryMultiPoint': function (g) { if (g) { return new $data.GeometryMultiPoint(g); } return g; },
'$data.GeometryMultiLineString': function (g) { if (g) { return new $data.GeometryMultiLineString(g); } return g; },
'$data.GeometryMultiPolygon': function (g) { if (g) { return new $data.GeometryMultiPolygon(g); } return g; },
'$data.GeometryCollection': function (g) { if (g) { return new $data.GeometryCollection(g); } return g; }
<<<<<<<
'$data.Object': function (o) { return JSON.stringify(o); },
'$data.Array': function (o) { return JSON.stringify(o); },
'$data.Guid': function (guid) { return guid; },
'$data.GeographyPoint': function (g) { if (g) { return g; } return g; },
'$data.GeographyLineString': function (g) { if (g) { return g; } return g; },
'$data.GeographyPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiPoint': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiLineString': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeographyCollection': function (g) { if (g) { return g; } return g; },
'$data.GeometryPoint': function (g) { if (g) { return g; } return g; },
'$data.GeometryLineString': function (g) { if (g) { return g; } return g; },
'$data.GeometryPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiPoint': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiLineString': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeometryCollection': function (g) { if (g) { return g; } return g; }
=======
'$data.Object': function (o) { return o; },
'$data.Array': function (o) { return o; },
'$data.Guid': function (guid) { return guid ? guid.value : guid; }
>>>>>>>
'$data.Object': function (o) { return o; },
'$data.Array': function (o) { return o; },
'$data.Guid': function (guid) { return guid ? guid.value : guid; },
'$data.GeographyPoint': function (g) { if (g) { return g; } return g; },
'$data.GeographyLineString': function (g) { if (g) { return g; } return g; },
'$data.GeographyPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiPoint': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiLineString': function (g) { if (g) { return g; } return g; },
'$data.GeographyMultiPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeographyCollection': function (g) { if (g) { return g; } return g; },
'$data.GeometryPoint': function (g) { if (g) { return g; } return g; },
'$data.GeometryLineString': function (g) { if (g) { return g; } return g; },
'$data.GeometryPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiPoint': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiLineString': function (g) { if (g) { return g; } return g; },
'$data.GeometryMultiPolygon': function (g) { if (g) { return g; } return g; },
'$data.GeometryCollection': function (g) { if (g) { return g; } return g; } |
<<<<<<<
this._scriptPrefix = options.scriptPrefix || '';
this._scripts = [];
this.loader.addHandler("animation", new pc.AnimationHandler());
this.loader.addHandler("model", new pc.ModelHandler(this.graphicsDevice));
this.loader.addHandler("material", new pc.MaterialHandler(this.assets));
this.loader.addHandler("texture", new pc.TextureHandler(this.graphicsDevice));
this.loader.addHandler("text", new pc.TextHandler());
this.loader.addHandler("json", new pc.JsonHandler());
this.loader.addHandler("audio", new pc.AudioHandler(this._audioManager));
this.loader.addHandler("script", new pc.ScriptHandler(this));
this.loader.addHandler("scene", new pc.SceneHandler(this));
this.loader.addHandler("cubemap", new pc.CubemapHandler(this.graphicsDevice, this.assets, this.loader));
=======
if( options.cache === false ) {
this.loader.cache = false;
}
// Display shows debug loading information. Only really fit for debug display at the moment.
if (options.displayLoader) {
var loaderdisplay = new pc.resources.ResourceLoaderDisplay(document.body, this.loader);
}
if (options.content) {
this.content = options.content;
// Add the assets from all TOCs to the
Object.keys(this.content.toc).forEach(function (key) {
this.assets.addGroup(key, this.content.toc[key]);
}.bind(this));
}
// Enable new texture bank feature to cache textures
var textureCache = new pc.resources.TextureCache(this.loader);
this.loader.registerHandler(pc.resources.JsonRequest, new pc.resources.JsonResourceHandler());
this.loader.registerHandler(pc.resources.TextRequest, new pc.resources.TextResourceHandler());
this.loader.registerHandler(pc.resources.ImageRequest, new pc.resources.ImageResourceHandler());
this.loader.registerHandler(pc.resources.MaterialRequest, new pc.resources.MaterialResourceHandler(this.graphicsDevice, this.assets));
this.loader.registerHandler(pc.resources.TextureRequest, new pc.resources.TextureResourceHandler(this.graphicsDevice, this.assets));
this.loader.registerHandler(pc.resources.CubemapRequest, new pc.resources.CubemapResourceHandler(this.graphicsDevice, this.assets));
this.loader.registerHandler(pc.resources.ModelRequest, new pc.resources.ModelResourceHandler(this.graphicsDevice, this.assets));
this.loader.registerHandler(pc.resources.AnimationRequest, new pc.resources.AnimationResourceHandler());
this.loader.registerHandler(pc.resources.PackRequest, new pc.resources.PackResourceHandler(this, options.depot));
this.loader.registerHandler(pc.resources.AudioRequest, new pc.resources.AudioResourceHandler(this._audioManager));
this.loader.registerHandler(pc.resources.ScriptRequest, new pc.resources.ScriptResourceHandler(this, options.scriptPrefix));
>>>>>>>
this._scriptPrefix = options.scriptPrefix || '';
this._scripts = [];
this.loader.addHandler("animation", new pc.AnimationHandler());
this.loader.addHandler("model", new pc.ModelHandler(this.graphicsDevice));
this.loader.addHandler("material", new pc.MaterialHandler(this.assets));
this.loader.addHandler("texture", new pc.TextureHandler(this.graphicsDevice));
this.loader.addHandler("text", new pc.TextHandler());
this.loader.addHandler("json", new pc.JsonHandler());
this.loader.addHandler("audio", new pc.AudioHandler(this._audioManager));
this.loader.addHandler("script", new pc.ScriptHandler(this));
this.loader.addHandler("scene", new pc.SceneHandler(this));
this.loader.addHandler("cubemap", new pc.CubemapHandler(this.graphicsDevice, this.assets, this.loader));
<<<<<<<
var packsys = new pc.PackComponentSystem(this);
var scriptsys = new pc.ScriptComponentSystem(this, options.scriptPrefix);
=======
var scriptsys = new pc.ScriptComponentSystem(this);
>>>>>>>
var scriptsys = new pc.ScriptComponentSystem(this, options.scriptPrefix);
<<<<<<<
=======
// Load libraries
this.on('librariesloaded', this.onLibrariesLoaded, this);
if (options.libraries && options.libraries.length) {
var requests = options.libraries.map(function (url) {
return new pc.resources.ScriptRequest(url);
});
this.loader.request(requests).then( function (resources) {
this.fire('librariesloaded', this);
this._librariesLoaded = true;
}.bind(this));
} else {
this.fire('librariesloaded', this);
this._librariesLoaded = true;
}
>>>>>>>
<<<<<<<
_linkUpdatePackSettings: function (settings) {
=======
updateSceneSettings: function (settings) {
>>>>>>>
updateSceneSettings: function (settings) { |
<<<<<<<
* @property {Number} occludeDirect Tells if AO should darken directional lighting.
=======
*
>>>>>>>
* @property {Number} occludeDirect Tells if AO should darken directional lighting.
*
<<<<<<<
var options;
var minimalOptions = pass > pc.SHADER_FORWARDHDR && pass <= pc.SHADER_PICK;
if (minimalOptions) {
// minimal options
options = {
opacityTint: this.opacity!==1 && this.blendType!==pc.BLEND_NONE,
alphaTest: this.alphaTest > 0,
forceFragmentPrecision: this.forceFragmentPrecision,
chunks: this.chunks,
blendType: this.blendType,
forceUv1: this.forceUv1,
pass: pass
};
} else {
// full options
options = {
fog: this.useFog? scene.fog : "none",
gamma: this.useGammaTonemap? scene.gammaCorrection : pc.GAMMA_NONE,
toneMap: this.useGammaTonemap? scene.toneMapping : -1,
blendMapsWithColors: true,
ambientTint: this.ambientTint,
diffuseTint: (this.diffuse.data[0]!==1 || this.diffuse.data[1]!==1 || this.diffuse.data[2]!==1) && this.diffuseMapTint,
specularTint: specularTint,
metalnessTint: this.useMetalness && this.metalness<1,
glossTint: true,
emissiveTint: emissiveTint,
opacityTint: this.opacity!==1 && this.blendType!==pc.BLEND_NONE,
alphaTest: this.alphaTest > 0,
alphaToCoverage: this.alphaToCoverage,
needsNormalFloat: this.normalizeNormalMap,
sphereMap: !!this.sphereMap,
cubeMap: !!this.cubeMap,
dpAtlas: !!this.dpAtlas,
ambientSH: !!this.ambientSH,
useSpecular: useSpecular,
rgbmAmbient: rgbmAmbient,
rgbmReflection: rgbmReflection,
hdrAmbient: hdrAmbient,
hdrReflection: hdrReflection,
fixSeams: prefilteredCubeMap128? prefilteredCubeMap128.fixCubemapSeams : (this.cubeMap? this.cubeMap.fixCubemapSeams : false),
prefilteredCubemap: !!prefilteredCubeMap128,
emissiveFormat: this.emissiveMap? (this.emissiveMap.rgbm? 1 : (this.emissiveMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
lightMapFormat: this.lightMap? (this.lightMap.rgbm? 1 : (this.lightMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
useRgbm: rgbmReflection || rgbmAmbient || (this.emissiveMap? this.emissiveMap.rgbm : 0) || (this.lightMap? this.lightMap.rgbm : 0),
specularAntialias: this.specularAntialias,
conserveEnergy: this.conserveEnergy,
occludeSpecular: this.occludeSpecular,
occludeSpecularFloat: (this.occludeSpecularIntensity !== 1.0),
occludeDirect: this.occludeDirect,
shadingModel: this.shadingModel,
fresnelModel: this.fresnelModel,
packedNormal: this.normalMap? (this.normalMap.format===pc.PIXELFORMAT_DXT5) : false,
forceFragmentPrecision: this.forceFragmentPrecision,
fastTbn: this.fastTbn,
cubeMapProjection: this.cubeMapProjection,
chunks: this.chunks,
customFragmentShader: this.customFragmentShader,
refraction: !!this.refraction,
useMetalness: this.useMetalness,
blendType: this.blendType,
skyboxIntensity: (prefilteredCubeMap128===globalSky128 && prefilteredCubeMap128) && (scene.skyboxIntensity!==1),
forceUv1: this.forceUv1,
useTexCubeLod: useTexCubeLod,
msdf: !!this.msdfMap,
twoSidedLighting: this.twoSidedLighting,
pixelSnap: this.pixelSnap,
pass: pass
};
if (pass === pc.SHADER_FORWARDHDR) {
if (options.gamma) options.gamma = pc.GAMMA_SRGBHDR;
options.toneMap = pc.TONEMAP_LINEAR;
}
=======
var options = {
fog: this.useFog? scene.fog : "none",
gamma: this.useGammaTonemap? scene.gammaCorrection : pc.GAMMA_NONE,
toneMap: this.useGammaTonemap? scene.toneMapping : -1,
blendMapsWithColors: true,
modulateAmbient: this.ambientTint,
diffuseTint: diffuseTint,
specularTint: specularTint ? 3 : 0,
metalnessTint: (this.useMetalness && this.metalness < 1) ? 1 : 0,
glossTint: 1,
emissiveTint: emissiveTint,
opacityTint: (this.opacity !== 1 && this.blendType !== pc.BLEND_NONE) ? 1 : 0,
alphaTest: this.alphaTest > 0,
alphaToCoverage: this.alphaToCoverage,
needsNormalFloat: this.normalizeNormalMap,
sphereMap: !!this.sphereMap,
cubeMap: !!this.cubeMap,
dpAtlas: !!this.dpAtlas,
ambientSH: !!this.ambientSH,
useSpecular: useSpecular,
rgbmAmbient: rgbmAmbient,
rgbmReflection: rgbmReflection,
hdrAmbient: hdrAmbient,
hdrReflection: hdrReflection,
fixSeams: prefilteredCubeMap128? prefilteredCubeMap128.fixCubemapSeams : (this.cubeMap? this.cubeMap.fixCubemapSeams : false),
prefilteredCubemap: !!prefilteredCubeMap128,
emissiveFormat: this.emissiveMap? (this.emissiveMap.rgbm? 1 : (this.emissiveMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
lightMapFormat: this.lightMap? (this.lightMap.rgbm? 1 : (this.lightMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
useRgbm: rgbmReflection || rgbmAmbient || (this.emissiveMap? this.emissiveMap.rgbm : 0) || (this.lightMap? this.lightMap.rgbm : 0),
specularAA: this.specularAntialias,
conserveEnergy: this.conserveEnergy,
occludeSpecular: this.occludeSpecular,
occludeSpecularFloat: (this.occludeSpecularIntensity !== 1.0),
occludeDirect: this.occludeDirect,
shadingModel: this.shadingModel,
fresnelModel: this.fresnelModel,
packedNormal: this.normalMap? (this.normalMap.format===pc.PIXELFORMAT_DXT5) : false,
forceFragmentPrecision: this.forceFragmentPrecision,
fastTbn: this.fastTbn,
cubeMapProjection: this.cubeMapProjection,
chunks: this.chunks,
customFragmentShader: this.customFragmentShader,
refraction: !!this.refraction,
useMetalness: this.useMetalness,
blendType: this.blendType,
skyboxIntensity: (prefilteredCubeMap128===globalSky128 && prefilteredCubeMap128) && (scene.skyboxIntensity!==1),
forceUv1: this.forceUv1,
useTexCubeLod: useTexCubeLod,
msdf: !!this.msdfMap,
pixelSnap: this.pixelSnap,
twoSidedLighting: this.twoSidedLighting
};
if (pass === pc.SHADER_FORWARDHDR) {
if (options.gamma) options.gamma = pc.GAMMA_SRGBHDR;
options.toneMap = pc.TONEMAP_LINEAR;
>>>>>>>
var options;
var minimalOptions = pass > pc.SHADER_FORWARDHDR && pass <= pc.SHADER_PICK;
if (minimalOptions) {
// minimal options
options = {
opacityTint: this.opacity!==1 && this.blendType!==pc.BLEND_NONE,
alphaTest: this.alphaTest > 0,
forceFragmentPrecision: this.forceFragmentPrecision,
chunks: this.chunks,
blendType: this.blendType,
forceUv1: this.forceUv1,
pass: pass
};
} else {
// full options
options = {
fog: this.useFog? scene.fog : "none",
gamma: this.useGammaTonemap? scene.gammaCorrection : pc.GAMMA_NONE,
toneMap: this.useGammaTonemap? scene.toneMapping : -1,
blendMapsWithColors: true,
ambientTint: this.ambientTint,
diffuseTint: diffuseTint,
specularTint: specularTint ? 3 : 0,
metalnessTint: (this.useMetalness && this.metalness < 1) ? 1 : 0,
glossTint: 1,
emissiveTint: emissiveTint,
opacityTint: (this.opacity !== 1 && this.blendType !== pc.BLEND_NONE) ? 1 : 0,
alphaTest: this.alphaTest > 0,
alphaToCoverage: this.alphaToCoverage,
needsNormalFloat: this.normalizeNormalMap,
sphereMap: !!this.sphereMap,
cubeMap: !!this.cubeMap,
dpAtlas: !!this.dpAtlas,
ambientSH: !!this.ambientSH,
useSpecular: useSpecular,
rgbmAmbient: rgbmAmbient,
rgbmReflection: rgbmReflection,
hdrAmbient: hdrAmbient,
hdrReflection: hdrReflection,
fixSeams: prefilteredCubeMap128? prefilteredCubeMap128.fixCubemapSeams : (this.cubeMap? this.cubeMap.fixCubemapSeams : false),
prefilteredCubemap: !!prefilteredCubeMap128,
emissiveFormat: this.emissiveMap? (this.emissiveMap.rgbm? 1 : (this.emissiveMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
lightMapFormat: this.lightMap? (this.lightMap.rgbm? 1 : (this.lightMap.format===pc.PIXELFORMAT_RGBA32F? 2 : 0)) : null,
useRgbm: rgbmReflection || rgbmAmbient || (this.emissiveMap? this.emissiveMap.rgbm : 0) || (this.lightMap? this.lightMap.rgbm : 0),
specularAntialias: this.specularAntialias,
conserveEnergy: this.conserveEnergy,
occludeSpecular: this.occludeSpecular,
occludeSpecularFloat: (this.occludeSpecularIntensity !== 1.0),
occludeDirect: this.occludeDirect,
shadingModel: this.shadingModel,
fresnelModel: this.fresnelModel,
packedNormal: this.normalMap? (this.normalMap.format===pc.PIXELFORMAT_DXT5) : false,
forceFragmentPrecision: this.forceFragmentPrecision,
fastTbn: this.fastTbn,
cubeMapProjection: this.cubeMapProjection,
chunks: this.chunks,
customFragmentShader: this.customFragmentShader,
refraction: !!this.refraction,
useMetalness: this.useMetalness,
blendType: this.blendType,
skyboxIntensity: (prefilteredCubeMap128===globalSky128 && prefilteredCubeMap128) && (scene.skyboxIntensity!==1),
forceUv1: this.forceUv1,
useTexCubeLod: useTexCubeLod,
msdf: !!this.msdfMap,
twoSidedLighting: this.twoSidedLighting,
pixelSnap: this.pixelSnap,
pass: pass
};
if (pass === pc.SHADER_FORWARDHDR) {
if (options.gamma) options.gamma = pc.GAMMA_SRGBHDR;
options.toneMap = pc.TONEMAP_LINEAR;
}
<<<<<<<
isOpacity = p === "opacity";
if (isOpacity && this.blendType===pc.BLEND_NONE && this.alphaTest===0.0 && !this.alphaToCoverage) continue;
if (minimalOptions && !isOpacity) continue;
=======
if (p === "opacity" && this.blendType === pc.BLEND_NONE && this.alphaTest === 0.0 && !this.alphaToCoverage) continue;
>>>>>>>
isOpacity = p === "opacity";
if (isOpacity && this.blendType === pc.BLEND_NONE && this.alphaTest === 0.0 && !this.alphaToCoverage) continue;
if (minimalOptions && !isOpacity) continue; |
<<<<<<<
this.fillMode = pc.FillMode.KEEP_ASPECT;
this.resolutionMode = pc.ResolutionMode.FIXED;
this.graphicsDevice = new pc.GraphicsDevice(canvas);
this.systems = new pc.ComponentSystemRegistry();
this.audioManager = new pc.AudioManager();
this.loader = new pc.resources.ResourceLoader();
=======
this.fillMode = pc.FILLMODE_KEEP_ASPECT;
this.resolutionMode = pc.RESOLUTION_FIXED;
this.librariesLoaded = false;
>>>>>>>
this.fillMode = pc.FILLMODE_KEEP_ASPECT;
this.resolutionMode = pc.RESOLUTION_FIXED;
this.graphicsDevice = new pc.GraphicsDevice(canvas);
this.systems = new pc.ComponentSystemRegistry();
this.audioManager = new pc.AudioManager();
this.loader = new pc.resources.ResourceLoader(); |
<<<<<<<
* @property {Boolean} pixelSnap Align vertices to pixel co-ordinates when rendering. Useful for pixel perfect 2D graphics
=======
* @property {Boolean} twoSidedLighting Calculate proper normals (and therefore lighting) on backfaces
>>>>>>>
* @property {Boolean} pixelSnap Align vertices to pixel co-ordinates when rendering. Useful for pixel perfect 2D graphics
* @property {Boolean} twoSidedLighting Calculate proper normals (and therefore lighting) on backfaces
<<<<<<<
msdf: !!this.msdfMap,
pixelSnap: this.pixelSnap
=======
msdf: !!this.msdfMap,
twoSidedLighting: this.twoSidedLighting
>>>>>>>
msdf: !!this.msdfMap,
pixelSnap: this.pixelSnap,
twoSidedLighting: this.twoSidedLighting
<<<<<<<
_defineFlag(obj, "pixelSnap", false);
=======
_defineFlag(obj, "twoSidedLighting", false);
>>>>>>>
_defineFlag(obj, "pixelSnap", false);
_defineFlag(obj, "twoSidedLighting", false); |
<<<<<<<
// use METHOD if (shadowRead[pc.SHADOWREAD_METHOD] & light.mask) > 0
this.shadowReadMask = [0, 0xFFFFFFFF, 0]; // use PCF3x3 on everything by default
this.shadowReadMask.copy = function(from) {
for(var i=0; i<from.length; i++) {
this[i] = from[i];
}
};
=======
this.forceFragmentPrecision = null;
>>>>>>>
// use METHOD if (shadowRead[pc.SHADOWREAD_METHOD] & light.mask) > 0
this.shadowReadMask = [0, 0xFFFFFFFF, 0]; // use PCF3x3 on everything by default
this.shadowReadMask.copy = function(from) {
for(var i=0; i<from.length; i++) {
this[i] = from[i];
}
};
this.forceFragmentPrecision = null;
<<<<<<<
shadowReadMask: this.shadowReadMask,
=======
forceFragmentPrecision: this.forceFragmentPrecision,
useInstancing: this.useInstancing,
fastTbn: this.fastTbn,
cubeMapProjection: this.cubeMapProjection,
customChunks: this.chunks,
customFragmentShader: this.customFragmentShader,
refraction: this.refraction,
useMetalness: this.useMetalness,
>>>>>>>
shadowReadMask: this.shadowReadMask,
forceFragmentPrecision: this.forceFragmentPrecision,
useInstancing: this.useInstancing,
fastTbn: this.fastTbn,
cubeMapProjection: this.cubeMapProjection,
customChunks: this.chunks,
customFragmentShader: this.customFragmentShader,
refraction: this.refraction,
useMetalness: this.useMetalness, |
<<<<<<<
// Commit any samplers used by active program
for (i = 0, len = samplers.length; i < len; i++) {
sampler = samplers[i];
texture = sampler.scopeId.value;
if (this.textureUnits[i] !== texture) {
gl.activeTexture(gl.TEXTURE0 + i);
texture.bind();
this.textureUnits[i] = texture;
}
if (sampler.slot !== i) {
gl.uniform1i(sampler.locationId, i);
sampler.slot = i;
}
}
// Commit any updated uniforms
for (i = 0, len = uniforms.length; i < len; i++) {
uniform = uniforms[i];
scopeId = uniform.scopeId;
uniformVersion = uniform.version;
programVersion = scopeId.versionObject.version;
// Check the value is valid
if (uniformVersion.globalId !== programVersion.globalId || uniformVersion.revision !== programVersion.revision) {
// if (uniformVersion.notequals(programVersion)) {
// Copy the version to track that its now up to date
// uniformVersion.copy(programVersion);
uniformVersion.globalId = programVersion.globalId;
uniformVersion.revision = programVersion.revision;
// Call the function to commit the uniform value
this.commitFunction[uniform.dataType](uniform.locationId, scopeId.value);
// uniform.commitArgs[uniform.valueIndex] = uniform.scopeId.value;
// uniform.commitFunc.apply(gl, uniform.commitArgs);
}
}
=======
// Commit the shader uniforms
this.commitSamplers();
this.commitUniforms();
>>>>>>>
// Commit the shader program variables
for (i = 0, len = samplers.length; i < len; i++) {
sampler = samplers[i];
texture = sampler.scopeId.value;
if (this.textureUnits[i] !== texture) {
gl.activeTexture(gl.TEXTURE0 + i);
texture.bind();
this.textureUnits[i] = texture;
}
if (sampler.slot !== i) {
gl.uniform1i(sampler.locationId, i);
sampler.slot = i;
}
}
// Commit any updated uniforms
for (i = 0, len = uniforms.length; i < len; i++) {
uniform = uniforms[i];
scopeId = uniform.scopeId;
uniformVersion = uniform.version;
programVersion = scopeId.versionObject.version;
// Check the value is valid
if (uniformVersion.globalId !== programVersion.globalId || uniformVersion.revision !== programVersion.revision) {
// if (uniformVersion.notequals(programVersion)) {
// Copy the version to track that its now up to date
// uniformVersion.copy(programVersion);
uniformVersion.globalId = programVersion.globalId;
uniformVersion.revision = programVersion.revision;
// Call the function to commit the uniform value
this.commitFunction[uniform.dataType](uniform.locationId, scopeId.value);
// uniform.commitArgs[uniform.valueIndex] = uniform.scopeId.value;
// uniform.commitFunc.apply(gl, uniform.commitArgs);
}
}
<<<<<<<
=======
* @private
* @name pc.gfx.Device#commitAttributes
* @author Will Eastcott
*/
commitAttributes: function () {
var i, len, attribute, element, vertexBuffer;
var attributes = this.shader.attributes;
var gl = this.gl;
for (i = 0, len = attributes.length; i < len; i++) {
attribute = attributes[i];
// Retrieve vertex element for this shader attribute
element = attribute.scopeId.value;
// Check the vertex element is valid
if (element !== null) {
// Retrieve the vertex buffer that contains this element
vertexBuffer = this.vertexBuffers[element.stream];
// Set the active vertex buffer object
if (this.boundBuffer !== vertexBuffer.bufferId) {
gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.bufferId);
this.boundBuffer = vertexBuffer.bufferId;
}
// Hook the vertex buffer to the shader program
gl.enableVertexAttribArray(attribute.locationId);
gl.vertexAttribPointer(attribute.locationId,
element.numComponents,
this.lookup.elementType[element.dataType],
element.normalize,
element.stride,
element.offset);
}
}
},
/**
* @private
* @name pc.gfx.Device#commitSamplers
* @author Will Eastcott
*/
commitSamplers: function () {
var gl = this.gl;
var i, len, sampler, value;
var samplers = this.shader.samplers;
for (i = 0, len = samplers.length; i < len; i++) {
sampler = samplers[i];
texture = sampler.scopeId.value;
if (this.textureUnits[i] !== texture) {
gl.activeTexture(gl.TEXTURE0 + i);
texture.bind();
this.textureUnits[i] = texture;
}
if (sampler.slot !== i) {
gl.uniform1i(sampler.locationId, i);
sampler.slot = i;
}
}
},
/**
* @private
* @name pc.gfx.Device#commitUniforms
* @author Will Eastcott
*/
commitUniforms: function () {
var i, len, uniform;
var uniforms = this.shader.uniforms;
var gl = this.gl;
for (i = 0, len = uniforms.length; i < len; i++) {
uniform = uniforms[i];
// Check the value is valid
if (uniform.version.notequals(uniform.scopeId.versionObject.version)) {
// Copy the version to track that its now up to date
uniform.version.copy(uniform.scopeId.versionObject.version);
// Retrieve value for this shader uniform
var value = uniform.scopeId.value;
// Call the function to commit the uniform value
this.commitFunction[uniform.dataType](uniform.locationId, value);
// uniform.commitArgs[uniform.valueIndex] = uniform.scopeId.value;
// uniform.commitFunc.apply(gl, uniform.commitArgs);
}
}
},
/**
>>>>>>> |
<<<<<<<
* </ul>
* @property {pc.Vec3} halfExtents The half-extents of the box-shaped collision volume in the x, y and z axes. Defaults to [0.5, 0.5, 0.5]
* @property {Number} radius The radius of the sphere or capsule-shaped collision volumes. Defaults to 0.5
* @property {Number} axis The local space axis with which the capsule-shaped collision volume's length is aligned. 0 for X, 1 for Y and 2 for Z. Defaults to 1 (Y-axis).
* @property {Number} height The total height of the capsule-shaped collision volume from tip to tip. Defaults to 2.
=======
* </ul>
* @property {pc.math.vec3} halfExtents The half-extents of the box-shaped collision volume in the x, y and z axes. Defaults to [0.5, 0.5, 0.5]
* @property {pc.math.vec3} radius The radius of the sphere, capsule or cylinder-shaped collision volumes. Defaults to 0.5
* @property {Number} axis The local space axis with which the capsule or cylinder-shaped collision volume's length is aligned. 0 for X, 1 for Y and 2 for Z. Defaults to 1 (Y-axis).
* @property {Number} height The total height of the capsule or cylinder-shaped collision volume from tip to tip. Defaults to 2.
>>>>>>>
* </ul>
* @property {pc.Vec3} halfExtents The half-extents of the box-shaped collision volume in the x, y and z axes. Defaults to [0.5, 0.5, 0.5]
* @property {Number} radius The radius of the sphere, capsule or cylinder-shaped collision volumes. Defaults to 0.5
* @property {Number} axis The local space axis with which the capsule or cylinder-shaped collision volume's length is aligned. 0 for X, 1 for Y and 2 for Z. Defaults to 1 (Y-axis).
* @property {Number} height The total height of the capsule or cylinder-shaped collision volume from tip to tip. Defaults to 2. |
<<<<<<<
this.shadowWrite = pc.SHADOWWRITE_DEPTH;
=======
this.shadowUpdateMode = pc.SHADOWUPDATE_REALTIME;
this.mask = 1;
>>>>>>>
this.shadowWrite = pc.SHADOWWRITE_DEPTH;
this.shadowUpdateMode = pc.SHADOWUPDATE_REALTIME;
this.mask = 1; |
<<<<<<<
var scene = this.system.app.scene;
if (!scene.containsModel(model)) {
scene.addModel(model);
=======
var model = this.data.model;
if (model) {
var scene = this.system.context.scene;
if (!scene.containsModel(model)) {
scene.addModel(model);
}
>>>>>>>
var model = this.data.model;
if (model) {
var scene = this.system.app.scene;
if (!scene.containsModel(model)) {
scene.addModel(model);
}
<<<<<<<
this.system.app.scene.removeModel(model);
=======
var model = this.data.model;
if (model) {
var scene = this.system.context.scene;
scene.removeModel(model);
}
>>>>>>>
var model = this.data.model;
if (model) {
var scene = this.system.app.scene;
scene.removeModel(model);
} |
<<<<<<<
this.defaultMaterial.pixelSnap = false;
=======
this.defaultMaterial.cull = pc.CULLFACE_NONE; // don't cull because we might flipX or flipY which uses negative scale on the graph node
>>>>>>>
this.defaultMaterial.pixelSnap = false;
this.defaultMaterial.cull = pc.CULLFACE_NONE; // don't cull because we might flipX or flipY which uses negative scale on the graph node |
<<<<<<<
'layers',
'mapping'
=======
'mapping',
'batchGroupId'
>>>>>>>
'layers',
'batchGroupId'
'mapping'
<<<<<<<
properties = ['enabled', 'material', 'materialAsset', 'asset', 'castShadows', 'receiveShadows', 'castShadowsLightmap', 'lightmapped', 'lightmapSizeMultiplier', 'type', 'mapping', 'layers', 'isStatic'];
=======
properties = ['enabled', 'material', 'materialAsset', 'asset', 'castShadows', 'receiveShadows', 'castShadowsLightmap', 'lightmapped', 'lightmapSizeMultiplier', 'type', 'mapping', 'isStatic', 'batchGroupId'];
>>>>>>>
properties = ['enabled', 'material', 'materialAsset', 'asset', 'castShadows', 'receiveShadows', 'castShadowsLightmap', 'lightmapped', 'lightmapSizeMultiplier', 'type', 'mapping', 'layers', 'isStatic', 'batchGroupId'];
<<<<<<<
layers: entity.model.layers,
=======
batchGroupId: entity.model.batchGroupId,
>>>>>>>
layers: entity.model.layers,
batchGroupId: entity.model.batchGroupId, |
<<<<<<<
if (this.mask) {
var maskDepth = this._getMaskDepth();
if (maskDepth === 1) {
this._topMask = true;
if (topMasks.indexOf(this) < 0) topMasks.push(this);
}
}
=======
this.system.app.scene.on("set:layers", this.onLayersChanged, this);
if (this.system.app.scene.layers) {
this.system.app.scene.layers.on("add", this.onLayerAdded, this);
this.system.app.scene.layers.on("remove", this.onLayerRemoved, this);
}
>>>>>>>
if (this.mask) {
var maskDepth = this._getMaskDepth();
if (maskDepth === 1) {
this._topMask = true;
if (topMasks.indexOf(this) < 0) topMasks.push(this);
}
}
this.system.app.scene.on("set:layers", this.onLayersChanged, this);
if (this.system.app.scene.layers) {
this.system.app.scene.layers.on("add", this.onLayerAdded, this);
this.system.app.scene.layers.on("remove", this.onLayerRemoved, this);
} |
<<<<<<<
unloadOld: function () {
this.resource = null;
this.loaded = false;
},
=======
reload: function() {
// no need to be reloaded
if (! this.loaded)
return;
if (this.type === 'cubemap') {
this.registry._loader.patch(this, this.registry);
} else {
this.loaded = false;
this.registry.load(this);
}
},
>>>>>>>
unloadOld: function () {
this.resource = null;
this.loaded = false;
},
reload: function() {
// no need to be reloaded
if (! this.loaded)
return;
if (this.type === 'cubemap') {
this.registry._loader.patch(this, this.registry);
} else {
this.loaded = false;
this.registry.load(this);
}
}, |
<<<<<<<
name: "shadowUpdateMode",
exposed: false
}, {
=======
name: "mask",
displayName: "Mask",
description: "Bit mask",
type: "number",
defaultValue: 1,
exposed: false
}, {
>>>>>>>
name: "shadowUpdateMode",
exposed: false
}, {
name: "mask",
displayName: "Mask",
description: "Bit mask",
type: "number",
defaultValue: 1,
exposed: false
}, { |
<<<<<<<
var appc = require('node-appc'),
afs = appc.fs,
async = require('async'),
exec = require('child_process').exec,
os = require('os');
=======
var config = require('../config'),
appc = require('node-appc'),
i18n = appc.i18n(__dirname),
__ = i18n.__,
__n = i18n.__n;
>>>>>>>
var appc = require('node-appc'),
afs = appc.fs,
async = require('async'),
exec = require('child_process').exec,
i18n = appc.i18n(__dirname),
__ = i18n.__,
__n = i18n.__n; |
<<<<<<<
=======
stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats,
>>>>>>>
stats: process.env.JHI_DISABLE_WEBPACK_LOGS ? 'none' : options.stats,
<<<<<<<
=======
process.env.JHI_DISABLE_WEBPACK_LOGS
? null
: new SimpleProgressWebpackPlugin({
format: options.stats === 'minimal' ? 'compact' : 'expanded'
}),
new FriendlyErrorsWebpackPlugin(),
>>>>>>>
process.env.JHI_DISABLE_WEBPACK_LOGS
? null
: new SimpleProgressWebpackPlugin({
format: options.stats === 'minimal' ? 'compact' : 'expanded'
}),
new FriendlyErrorsWebpackPlugin(), |
<<<<<<<
this.invisiblePins = [];
this.auto_evaluate = false;
this.dirty = true;
=======
this.invisiblePins = {} ;
this.defaultPinValues = {};
>>>>>>>
this.invisiblePins = {} ;
this.defaultPinValues = {};
this.auto_evaluate = false;
this.dirty = true; |
<<<<<<<
const converter = {};
=======
const converter = {}
>>>>>>>
const converter = {};
<<<<<<<
next();
};
=======
>>>>>>>
}; |
<<<<<<<
=======
console.log( {
ready: subscription.ready() && session && activity && object,
instances,
object,
activity,
dashboardData,
session,
users
});
>>>>>>> |
<<<<<<<
=======
// viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
// url : "https://www.supermapol.com/iserver/services/map_China/rest/maps/China_Light"
// }));
>>>>>>> |
<<<<<<<
forCompareModels, // true when used by Compareprojections.js component.
stateId,
=======
forCompareModels, // true when used by CompareInterventions.js component.
location,
>>>>>>>
forCompareModels, // true when used by CompareInterventions.js component.
stateId,
<<<<<<<
<Wrapper
projections={projections}
isInferred={projection.isInferred}
inShelterInPlace={currentIntervention === projections.SHELTER_IN_PLACE}
>
=======
<Wrapper projections={projections} isInferred={projection.isInferred}>
>>>>>>>
<Wrapper projections={projections} isInferred={projection.isInferred}> |
<<<<<<<
{!isEmbed ? <LocationSummary projections={projections} /> : ''}
=======
{!isEmbed && projections.getSummary()}
{projections.isCounty && !isEmbed && (
<HeaderSubCopy>
<strong>County data is currently in beta. </strong>
<span>
Because counties don’t report hospitalizations, our forecasts
may not be as accurate. See something wrong?{' '}
</span>
<a
href="https://forms.gle/NPsLcFnrvfS1kqkn9"
target="_blank"
rel="noopener noreferrer"
>
Please let us know.
</a>
</HeaderSubCopy>
)}
>>>>>>>
{!isEmbed ? <LocationSummary projections={projections} /> : ''}
{projections.isCounty && !isEmbed && (
<HeaderSubCopy>
<strong>County data is currently in beta. </strong>
<span>
Because counties don’t report hospitalizations, our forecasts
may not be as accurate. See something wrong?{' '}
</span>
<a
href="https://forms.gle/NPsLcFnrvfS1kqkn9"
target="_blank"
rel="noopener noreferrer"
>
Please let us know.
</a>
</HeaderSubCopy>
)} |
<<<<<<<
var processErrors = function (errors, input, fullPath) {
var filename = path.basename(fullPath);
var lines = input.split('\n');
errors = errors.filter(function (error) {
return error !== null;
});
errors = flatten(errors);
errors = errors.map(function (error) {
var line = error.line;
error.file = filename;
error.source = line ? lines[line - 1] : '';
return error;
});
return errors;
};
exports.lint = function (input, fullPath, config) {
var ast = this.parseAST(input);
=======
exports.lint = function (input, path, config) {
>>>>>>>
var processErrors = function (errors, input, fullPath) {
var filename = path.basename(fullPath);
var lines = input.split('\n');
errors = errors.filter(function (error) {
return error !== null;
});
errors = flatten(errors);
errors = errors.map(function (error) {
var line = error.line;
error.file = filename;
error.source = line ? lines[line - 1] : '';
return error;
});
return errors;
};
exports.lint = function (input, fullPath, config) { |
<<<<<<<
// remove test/distance.js (and this exception) when bumping to 0.9.0
tests: ["test/*.js", "!test/mock*", "!test/distance.js"]
=======
tests: [
"test/bootstrap/*.js",
"test/*.js"
]
>>>>>>>
tests: [
"test/bootstrap/*.js",
"test/*.js"
]
<<<<<<<
grunt.registerTask("nodeunit:just", "Run a single test specified by a target; usage: \"grunt nodeunit:just:<module-name>[.js]\"", function(file) {
var path = require("path");
=======
// grunt nodeunit:just:extended/piezo for example
grunt.registerTask("nodeunit:just", function(file) {
>>>>>>>
grunt.registerTask("nodeunit:just", "Run a single test specified by a target; usage: \"grunt nodeunit:just:<module-name>[.js]\"", function(file) {
<<<<<<<
path.join("test", path.basename(file, ".js") + ".js")
=======
"test/bootstrap/*.js",
"test/" + file + ".js",
>>>>>>>
"test/bootstrap/*.js",
"test/" + file + ".js", |
<<<<<<<
.attr('x', d => { return context.xScale(d[context.getxAxisLabel]); }) // start position before transition
.attr('y', context.getHeight)
=======
.attr('x', d => { return context.xScale(d[context.getxAxisLabel]); })
.attr('y', context.getChartHeight)
>>>>>>>
.attr('x', d => { return context.xScale(d[context.getxAxisLabel]); }) // start position before transition
.attr('y', context.getChartHeight) |
<<<<<<<
var path = require('jsdoc/path');
var Syntax = require('jsdoc/src/syntax').Syntax;
=======
var path = require('jsdoc/path');
function filepathMinusPrefix(filepath) {
var sourceFiles = env.sourceFiles || [];
var commonPrefix = path.commonPrefix( sourceFiles.concat(env.opts._ || []) );
var result = (filepath + '/').replace(commonPrefix, '');
if (result.length > 0 && result[result.length - 1] !== '/') {
result += '/';
}
return result;
}
>>>>>>>
var path = require('jsdoc/path');
var Syntax = require('jsdoc/src/syntax').Syntax;
function filepathMinusPrefix(filepath) {
var sourceFiles = env.sourceFiles || [];
var commonPrefix = path.commonPrefix( sourceFiles.concat(env.opts._ || []) );
var result = (filepath + '/').replace(commonPrefix, '');
if (result.length > 0 && result[result.length - 1] !== '/') {
result += '/';
}
return result;
} |
<<<<<<<
var runtime = require('jsdoc/util/runtime');
var parser = require( runtime.getModulePath('jsdoc/src/parser') );
var srcParser = new parser.Parser();
var doclets;
=======
var parser = require('jsdoc/src/parser');
var srcParser = null;
var doclets;
var sourcePaths = env.opts._.slice(0);
>>>>>>>
var parser = require('jsdoc/src/parser');
var runtime = require('jsdoc/util/runtime');
var doclets;
var parser = require( runtime.getModulePath('jsdoc/src/parser') );
var srcParser = null;
var sourcePaths = env.opts._.slice(0); |
<<<<<<<
expect(url).toBe('be9d9563a3.html#"*foo"');
});
});
describe("resolveAuthorLinks", function() {
// convert Jane Doe <[email protected]> to a mailto link.
it('should convert email addresses in angle brackets *after* a name to mailto links', function() {
var str = ' John Doe <[email protected]> ',
out = helper.resolveAuthorLinks(str);
expect(out).toBe('<a href="mailto:[email protected]">John Doe</a>');
});
it('should HTML-safe author names', function() {
var str = ' John<Doe <[email protected]> ',
out = helper.resolveAuthorLinks(str);
expect(out).toBe('<a href="mailto:[email protected]">' + helper.htmlsafe('John<Doe') + '</a>');
});
it('should simply return the input string, HTML-safe, if no email is detected', function() {
var str = 'John Doe <dummy>',
out = helper.resolveAuthorLinks(str);
expect(out).toBe(helper.htmlsafe(str));
=======
expect(url).toEqual('_.html#"*foo"');
>>>>>>>
expect(url).toEqual('_.html#"*foo"');
});
});
describe("resolveAuthorLinks", function() {
// convert Jane Doe <[email protected]> to a mailto link.
it('should convert email addresses in angle brackets *after* a name to mailto links', function() {
var str = ' John Doe <[email protected]> ',
out = helper.resolveAuthorLinks(str);
expect(out).toBe('<a href="mailto:[email protected]">John Doe</a>');
});
it('should HTML-safe author names', function() {
var str = ' John<Doe <[email protected]> ',
out = helper.resolveAuthorLinks(str);
expect(out).toBe('<a href="mailto:[email protected]">' + helper.htmlsafe('John<Doe') + '</a>');
});
it('should simply return the input string, HTML-safe, if no email is detected', function() {
var str = 'John Doe <dummy>',
out = helper.resolveAuthorLinks(str);
expect(out).toBe(helper.htmlsafe(str)); |
<<<<<<<
// TODO Define test once Core work is done
test.skip('has_current_token', () => {})
=======
// TODO Create tests once work is done in Core
test.skip('current_identity', () => {})
// TODO Add test once Core work has been done
test.skip('has_current_identity', () => {})
// TODO Finish test after Core work is done
test.skip('current_token', () => {})
>>>>>>>
// TODO Create tests once work is done in Core
test.skip('current_identity', () => {})
// TODO Add test once Core work has been done
test.skip('has_current_identity', () => {})
// TODO Finish test after Core work is done
test.skip('current_token', () => {})
// TODO Define test once Core work is done
test.skip('has_current_token', () => {}) |
<<<<<<<
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function CurrentToken() {
arity.exact(0, arguments, CurrentToken.name)
return new Expr({ current_token: null })
}
=======
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentIdentity() {
arity.exact(0, arguments, HasCurrentIdentity.name)
return new Expr({ has_current_identity: null })
}
>>>>>>>
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentIdentity() {
arity.exact(0, arguments, HasCurrentIdentity.name)
return new Expr({ has_current_identity: null })
}
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function CurrentToken() {
arity.exact(0, arguments, CurrentToken.name)
return new Expr({ current_token: null })
}
<<<<<<<
Identity: Identity,
HasIdentity: HasIdentity,
CurrentToken: CurrentToken,
=======
Identity: deprecate(
Identity,
'Identity() is deprecated, use CurrentIdentity() instead'
),
CurrentIdentity: CurrentIdentity,
HasIdentity: deprecate(
HasIdentity,
'HasIdentity() is deprecated, use HasCurrentIdentity() instead'
),
HasCurrentIdentity: HasCurrentIdentity,
>>>>>>>
Identity: deprecate(
Identity,
'Identity() is deprecated, use CurrentIdentity() instead'
),
CurrentIdentity: CurrentIdentity,
HasIdentity: deprecate(
HasIdentity,
'HasIdentity() is deprecated, use HasCurrentIdentity() instead'
),
HasCurrentIdentity: HasCurrentIdentity,
CurrentToken: CurrentToken, |
<<<<<<<
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentToken() {
arity.exact(0, arguments, HasCurrentToken.name)
return new Expr({ has_current_token: null })
}
=======
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentIdentity() {
arity.exact(0, arguments, HasCurrentIdentity.name)
return new Expr({ has_current_identity: null })
}
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function CurrentToken() {
arity.exact(0, arguments, CurrentToken.name)
return new Expr({ current_token: null })
}
>>>>>>>
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentIdentity() {
arity.exact(0, arguments, HasCurrentIdentity.name)
return new Expr({ has_current_identity: null })
}
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function CurrentToken() {
arity.exact(0, arguments, CurrentToken.name)
return new Expr({ current_token: null })
}
/**
* See the [docs](https://app.fauna.com/documentation/reference/queryapi#authentication).
*
* @return {Expr}
*/
function HasCurrentToken() {
arity.exact(0, arguments, HasCurrentToken.name)
return new Expr({ has_current_token: null })
}
<<<<<<<
Identity: Identity,
HasIdentity: HasIdentity,
HasCurrentToken: HasCurrentToken,
=======
Identity: deprecate(
Identity,
'Identity() is deprecated, use CurrentIdentity() instead'
),
CurrentIdentity: CurrentIdentity,
HasIdentity: deprecate(
HasIdentity,
'HasIdentity() is deprecated, use HasCurrentIdentity() instead'
),
HasCurrentIdentity: HasCurrentIdentity,
CurrentToken: CurrentToken,
>>>>>>>
Identity: deprecate(
Identity,
'Identity() is deprecated, use CurrentIdentity() instead'
),
CurrentIdentity: CurrentIdentity,
HasIdentity: deprecate(
HasIdentity,
'HasIdentity() is deprecated, use HasCurrentIdentity() instead'
),
HasCurrentIdentity: HasCurrentIdentity,
CurrentToken: CurrentToken,
HasCurrentToken: HasCurrentToken, |
<<<<<<<
// TODO Finish test after Core work is done
test.skip('current_token', () => {})
=======
// TODO Add test once Core work has been done
test.skip('has_current_identity', () => {})
// TODO Create tests once work is done in Core
test.skip('current_identity', () => {})
>>>>>>>
// TODO Create tests once work is done in Core
test.skip('current_identity', () => {})
// TODO Add test once Core work has been done
test.skip('has_current_identity', () => {})
// TODO Finish test after Core work is done
test.skip('current_token', () => {}) |
<<<<<<<
* If the request with the same `Request.uniqueKey` property is already present in the queue,
* it will not be updated. You can find out this happened from the resulting
* {@linkcode RequestOperationInfo} object.
*
* @param {Request} request Request object
=======
* @param {Request|Object} request Request object, or object to construct a Request
>>>>>>>
* If the request with the same `Request.uniqueKey` property is already present in the queue,
* it will not be updated. You can find out this happened from the resulting
* {@linkcode RequestOperationInfo} object.
*
* @param {Request|Object} request Request object, or object to construct a Request |
<<<<<<<
/**
* Flushes the provided stream into a Buffer and transforms
* it to a String using the provided encoding or utf-8 as default.
*
* @param {stream.Readable} stream
* @param {String} [encoding]
* @returns {Promise<String>}
* @private
*/
async _readStreamIntoString(stream, encoding) { // eslint-disable-line class-methods-use-this
return new Promise((resolve, reject) => {
const chunks = [];
stream
.on('data', chunk => chunks.push(chunk))
.on('error', err => reject(err))
.on('end', () => {
const buffer = Buffer.concat(chunks);
resolve(buffer.toString(encoding));
});
});
}
=======
/**
* The handler this function attaches overcomes a long standing bug in
* the tunnel-agent NPM package that is used by the Request package internally.
* The package throws an assertion error in a callback scope that cannot be
* caught by conventional means and shuts down the running process.
* @ignore
*/
_suppressTunnelAgentAssertError() {
// Only set the handler if it's not already set.
if (this.tunnelAgentExceptionListener) return;
this.tunnelAgentExceptionListener = process.on('uncaughtException', (err) => {
try {
const code = err.code === 'ERR_ASSERTION';
const name = err.name === 'AssertionError [ERR_ASSERTION]';
const operator = err.operator === '==';
const value = err.expected === 0;
const stack = err.stack.includes('/tunnel-agent/index.js');
// If this passes, we can be reasonably sure that it's
// the right error from tunnel-agent.
if (code && name && operator && value && stack) {
log.error('CheerioCrawler: Tunnel-Agent assertion error intercepted. The affected request will timeout.');
return;
}
} catch (caughtError) {
// Catch any exception resulting from the duck-typing
// check. It only means that the error is not the one
// we're looking for.
}
// Rethrow the original error if it's not a match.
throw err;
});
}
>>>>>>>
/**
* Flushes the provided stream into a Buffer and transforms
* it to a String using the provided encoding or utf-8 as default.
*
* @param {stream.Readable} stream
* @param {String} [encoding]
* @returns {Promise<String>}
* @private
*/
async _readStreamIntoString(stream, encoding) { // eslint-disable-line class-methods-use-this
return new Promise((resolve, reject) => {
const chunks = [];
stream
.on('data', chunk => chunks.push(chunk))
.on('error', err => reject(err))
.on('end', () => {
const buffer = Buffer.concat(chunks);
resolve(buffer.toString(encoding));
});
});
}
/**
* The handler this function attaches overcomes a long standing bug in
* the tunnel-agent NPM package that is used by the Request package internally.
* The package throws an assertion error in a callback scope that cannot be
* caught by conventional means and shuts down the running process.
* @ignore
*/
_suppressTunnelAgentAssertError() {
// Only set the handler if it's not already set.
if (this.tunnelAgentExceptionListener) return;
this.tunnelAgentExceptionListener = process.on('uncaughtException', (err) => {
try {
const code = err.code === 'ERR_ASSERTION';
const name = err.name === 'AssertionError [ERR_ASSERTION]';
const operator = err.operator === '==';
const value = err.expected === 0;
const stack = err.stack.includes('/tunnel-agent/index.js');
// If this passes, we can be reasonably sure that it's
// the right error from tunnel-agent.
if (code && name && operator && value && stack) {
log.error('CheerioCrawler: Tunnel-Agent assertion error intercepted. The affected request will timeout.');
return;
}
} catch (caughtError) {
// Catch any exception resulting from the duck-typing
// check. It only means that the error is not the one
// we're looking for.
}
// Rethrow the original error if it's not a match.
throw err;
});
} |
<<<<<<<
* Either {@link RequestList} or {@link RequestQueue} must be provided.
=======
* Either `requestList` or `requestQueue` option must be provided (or both).
* @param {Function} [options.requestFunction]
* Overrides the default function that performs the HTTP request to get the raw HTML needed for Cheerio.
* See source code on <a href="https://github.com/apifytech/apify-js/blob/master/src/cheerio_crawler.js#L264">GitHub</a> for default behavior.
>>>>>>>
* Either `requestList` or `requestQueue` option must be provided (or both). |
<<<<<<<
import { registerBrowserForLiveView } from './puppeteer_live_view_server';
import Stealth from './stealth/stealth';
=======
>>>>>>>
import Stealth from './stealth/stealth';
<<<<<<<
const puppeteer = getPuppeteerOrThrow();
// Add stealth
if (options.stealth) {
const prevLaunch = puppeteer.launch;
const newLaunch = async function (...args) {
const browser = await prevLaunch.bind(puppeteer)(...args);
const stealth = new Stealth(options.stealth);
return stealth.getStealthBrowser(browser);
};
puppeteer.launch = newLaunch.bind(puppeteer);
}
=======
const puppeteer = getPuppeteerOrThrow(options.puppeteerModule);
>>>>>>>
const puppeteer = getPuppeteerOrThrow(options.puppeteerModule);
// Add stealth
if (options.stealth) {
const prevLaunch = puppeteer.launch;
const newLaunch = async function (...args) {
const browser = await prevLaunch.bind(puppeteer)(...args);
const stealth = new Stealth(options.stealth);
return stealth.getStealthBrowser(browser);
};
puppeteer.launch = newLaunch.bind(puppeteer);
} |
<<<<<<<
getPublicUrl(fileName) {
ensureTokenOrLocalStorageEnvExists('key value store');
return `${publicUrl}/${this.storeId}/records/${fileName}`;
}
=======
/**
* Iterates over key value store keys, yielding each in turn to an `iteratee` function.
* Each invocation of `iteratee` is called with two arguments: `(item, index)`.
*
* If the `iteratee` function returns a Promise then it is awaited before the next call.
* If it throws an error, the iteration is aborted and the `forEachKey` function throws the error.
*
* **Example usage**
* ```javascript
* const keyValueStore = await Apify.openKeyValueStore();
* keyValueStore.forEachKey(async (key, index) => {
* console.log(`Key at ${index}: ${key}`);
* });
* ```
*
* @param {Function} iteratee A function that is called for every key in the key value store.
* @param {Object} [options] All `forEachKey()` parameters are passed
* via an options object with the following keys:
* @param {string} [options.exclusiveStartKey] All keys up to this one (including) are skipped from the result.
* @return {Promise}
*/
async forEachKey(iteratee, options = {}, index = 0) {
const { exclusiveStartKey } = options;
checkParamOrThrow(iteratee, 'iteratee', 'Function');
checkParamOrThrow(exclusiveStartKey, 'options.exclusiveStartKey', 'Maybe String');
checkParamOrThrow(index, 'index', 'Number');
const response = await keyValueStores.listKeys({ storeId: this.storeId, exclusiveStartKey });
const { nextExclusiveStartKey, isTruncated, items } = response.data;
for (const key of items) {
await iteratee(key, index++);
}
return isTruncated
? this.forEachKey(iteratee, { exclusiveStartKey: nextExclusiveStartKey }, index)
: undefined; // [].forEach() returns undefined.
}
>>>>>>>
getPublicUrl(fileName) {
ensureTokenOrLocalStorageEnvExists('key value store');
return `${publicUrl}/${this.storeId}/records/${fileName}`;
}
/**
* Iterates over key value store keys, yielding each in turn to an `iteratee` function.
* Each invocation of `iteratee` is called with two arguments: `(item, index)`.
*
* If the `iteratee` function returns a Promise then it is awaited before the next call.
* If it throws an error, the iteration is aborted and the `forEachKey` function throws the error.
*
* **Example usage**
* ```javascript
* const keyValueStore = await Apify.openKeyValueStore();
* keyValueStore.forEachKey(async (key, index) => {
* console.log(`Key at ${index}: ${key}`);
* });
* ```
*
* @param {Function} iteratee A function that is called for every key in the key value store.
* @param {Object} [options] All `forEachKey()` parameters are passed
* via an options object with the following keys:
* @param {string} [options.exclusiveStartKey] All keys up to this one (including) are skipped from the result.
* @return {Promise}
*/
async forEachKey(iteratee, options = {}, index = 0) {
const { exclusiveStartKey } = options;
checkParamOrThrow(iteratee, 'iteratee', 'Function');
checkParamOrThrow(exclusiveStartKey, 'options.exclusiveStartKey', 'Maybe String');
checkParamOrThrow(index, 'index', 'Number');
const response = await keyValueStores.listKeys({ storeId: this.storeId, exclusiveStartKey });
const { nextExclusiveStartKey, isTruncated, items } = response.data;
for (const key of items) {
await iteratee(key, index++);
}
return isTruncated
? this.forEachKey(iteratee, { exclusiveStartKey: nextExclusiveStartKey }, index)
: undefined; // [].forEach() returns undefined.
} |
<<<<<<<
* @property {String} [puppeteerModule]
* Require path to a module to be used instead of default `puppeteer`. This enables usage
* of various Puppeteer wrappers such as `puppeteer-extra`.
* @property {boolean} [stealth]
* This setting hides most of the know properties that identifies the headless Chrome and makes it nearly undetectable.
* It is recommended to use it together with the `useChrome` set to `true`.
* @property {StealthOptions} [stealthOptions]
* Using this configuration, you can disable some of the hiding tricks.
* For these settings to take effect `stealth` must be set to true
=======
* @property {string|Object} [puppeteerModule]
* Either a require path (`string`) to a package to be used instead of default `puppeteer`,
* or an already required module (`Object`). This enables usage of various Puppeteer
* wrappers such as `puppeteer-extra`.
*
* Take caution, because it can cause all kinds of unexpected errors and weird behavior.
* Apify SDK is not tested with any other library besides `puppeteer` itself.
>>>>>>>
* @property {string|Object} [puppeteerModule]
* Either a require path (`string`) to a package to be used instead of default `puppeteer`,
* or an already required module (`Object`). This enables usage of various Puppeteer
* wrappers such as `puppeteer-extra`.
*
* Take caution, because it can cause all kinds of unexpected errors and weird behavior.
* Apify SDK is not tested with any other library besides `puppeteer` itself.
* @property {boolean} [stealth]
* This setting hides most of the know properties that identifies the headless Chrome and makes it nearly undetectable.
* It is recommended to use it together with the `useChrome` set to `true`.
* @property {StealthOptions} [stealthOptions]
* Using this configuration, you can disable some of the hiding tricks.
* For these settings to take effect `stealth` must be set to true
<<<<<<<
checkParamOrThrow(options.puppeteerModule, 'options.puppeteerModule', 'Maybe String');
checkParamOrThrow(options.stealth, 'options.stealth', 'Maybe Boolean');
checkParamOrThrow(options.stealthOptions, 'options.stealthOptions', 'Maybe Object');
=======
checkParamOrThrow(options.puppeteerModule, 'options.puppeteerModule', 'Maybe String|Object');
>>>>>>>
checkParamOrThrow(options.puppeteerModule, 'options.puppeteerModule', 'Maybe String|Object');
checkParamOrThrow(options.stealth, 'options.stealth', 'Maybe Boolean');
checkParamOrThrow(options.stealthOptions, 'options.stealthOptions', 'Maybe Object'); |
<<<<<<<
import openKeyValueStore from './key-value-store';
=======
import { setDefaultToken, setDefaultUserId, getAllCrawlers, startCrawler } from './crawler';
>>>>>>>
import openKeyValueStore from './key-value-store';
import { setDefaultToken, setDefaultUserId, getAllCrawlers, startCrawler } from './crawler';
<<<<<<<
openKeyValueStore,
=======
setDefaultToken,
setDefaultUserId,
getAllCrawlers,
startCrawler,
>>>>>>>
openKeyValueStore,
setDefaultToken,
setDefaultUserId,
getAllCrawlers,
startCrawler, |
<<<<<<<
* @memberof module:Apify
* @function
* @description Gets a value from the default key-value store for the current act run.
* This store is created automatically for this run,
* whose ID is defined in the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
* The result of the function is the body of the record. For records with 'application/json'
* content type, the body is the already parsed object. For other content types,
* the body is raw String or Buffer. If the record cannot be found, the result is null.
=======
* Gets a value from the default key-value store for the current act run.
* This store is created automatically for this run
* and its ID is passed by the Apify platform as the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
* The result of the function is the body of the record. For records with the 'application/json'
* content type, the body is the already parsed object
* and for 'text/plain' content types it is parsed as String.
* For other content types, the body is raw Buffer.
* If the record cannot be found, the result is null.
>>>>>>>
* @memberof module:Apify
* @function
* @description Gets a value from the default key-value store for the current act run.
* This store is created automatically for this run
* and its ID is passed by the Apify platform as the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
* The result of the function is the body of the record. For records with the 'application/json'
* content type, the body is the already parsed object
* and for 'text/plain' content types it is parsed as String.
* For other content types, the body is raw Buffer.
* If the record cannot be found, the result is null. |
<<<<<<<
=======
//webview配置titlebar
var globalConfig = require('../config');
if ( globalConfig.webview
&& /true|false/.test(globalConfig.webview.showTitleBar)
&& !globalConfig.webview.showTitleBar ) {
let routePath = 'pages/__web__view__';
display['pages'] = display['pages'] || {};
display['pages'][routePath] = {
titleBar: false
}
}
>>>>>>>
//webview配置titlebar
var globalConfig = require('../config');
if ( globalConfig.webview
&& /true|false/.test(globalConfig.webview.showTitleBar)
&& !globalConfig.webview.showTitleBar ) {
let routePath = 'pages/__web__view__';
display['pages'] = display['pages'] || {};
display['pages'][routePath] = {
titleBar: false
}
}
<<<<<<<
module.exports = function quickConfig(config, modules){
if (modules.componentType !== 'App') return;
=======
module.exports = function quickConfig(config, modules, queue){
if (modules.componentType !== 'App'){
return;
}
>>>>>>>
module.exports = function quickConfig(config, modules){
if (modules.componentType !== 'App') return; |
<<<<<<<
var originalInitialCSS;
=======
/**
* Trigger to initialize the sticky
* Because of the `timeout()` method for the call of `initSticky()` method, the `onChange` method is called before!
* @type {Boolean}
*/
var toInitialize = true;
>>>>>>>
var originalInitialCSS;
/**
* Trigger to initialize the sticky
* Because of the `timeout()` method for the call of
* @type {Boolean}
*/
var toInitialize = true;
<<<<<<<
// Listeners
scrollbarElement.on('scroll', checkIfShouldStick);
windowElement.on('resize', $onResize);
=======
if( toInitialize ){
// Listeners
scrollbarElement.on('scroll', checkIfShouldStick);
windowElement.on('resize', $scope.$apply.bind($scope, onResize));
>>>>>>>
// Listeners
scrollbarElement.on('scroll', checkIfShouldStick);
windowElement.on('resize', $onResize);
if( toInitialize ){
// Listeners
scrollbarElement.on('scroll', checkIfShouldStick);
windowElement.on('resize', $scope.$apply.bind($scope, onResize));
<<<<<<<
// Setup watcher on digest and change
$scope.$watch(onDigest, onChange);
// Clean up
$scope.$on('$destroy', onDestroy);
=======
// Clean up
$scope.$on('$destroy', onDestroy);
toInitialize = false;
}
>>>>>>>
// Setup watcher on digest and change
$scope.$watch(onDigest, onChange);
// Clean up
$scope.$on('$destroy', onDestroy);
toInitialize = false;
}
<<<<<<<
(!isSticking && !isBottomedOut()) && newVal !== 0) {
=======
(!isSticking && !isBottomedOut()) && elemIsShowed) {
>>>>>>>
(!isSticking && !isBottomedOut()) && newVal !== 0 && elemIsShowed) { |
<<<<<<<
stickyClass: '@',
mediaQuery: '@'
=======
stickyClass: '@',
bodyClass: '@'
>>>>>>>
stickyClass: '@',
mediaQuery: '@',
bodyClass: '@'
<<<<<<<
mediaQuery = $scope.mediaQuery || 'min-width: 0',
=======
bodyClass = $scope.bodyClass || '',
>>>>>>>
mediaQuery = $scope.mediaQuery || 'min-width: 0',
bodyClass = $scope.bodyClass || '',
<<<<<<<
$elem.css('width', initialWidthStyle);
} else if (!isSticky && isPositionFixed) {
=======
body.addClass(bodyClass);
} else {
>>>>>>>
body.addClass(bodyClass);
$elem.css('width', initialWidthStyle);
} else if (!isSticky && isPositionFixed) { |
<<<<<<<
//replace
newNode = mountVnode(newVnode, parentContext)
removeVnode(vnode, node, newNode)
=======
//replace
disposeVnode(vnode, node)
newNode = mountVnode(newVnode, parentContext)
node
.parentNode
.replaceChild(newNode, node)
>>>>>>>
//replace
newNode = mountVnode(newVnode, parentContext)
removeVnode(vnode, node, newNode)
<<<<<<<
removeVnode(data.vnode, data.node)
// data
// .node
// .parentNode
// .removeChild(data.node)
=======
disposeVnode(data.vnode, data.node)
_removeNodes.forEach(function (n, index) {
try {
n.parentNode.removeChild(n);
} catch (err) {
}
})
_removeNodes = [];
>>>>>>>
removeVnode(data.vnode, data.node) |
<<<<<<<
${this.randomClassName}.top img {
=======
.top, left, bottom, right, center, top-left, top-right, bottom-left, bottom-right {
width: ${this.state.containerWidth}px;
height: ${this.state.containerHeight}px;
}
.top img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
>>>>>>>
${this.randomClassName}.top, left, bottom, right, center, top-left, top-right, bottom-left, bottom-right {
width: ${this.state.containerWidth}px;
height: ${this.state.containerHeight}px;
}
${this.randomClassName}.top img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
<<<<<<<
${this.randomClassName}.bottom img {
position: absolute;
=======
.bottom img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
>>>>>>>
${this.randomClassName}.bottom img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
<<<<<<<
${this.randomClassName}.center img {
position: absolute;
=======
.center img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
>>>>>>>
${this.randomClassName}.center img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
<<<<<<<
${this.randomClassName}.left img {
position: absolute;
=======
.left img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
>>>>>>>
${this.randomClassName}.left img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
<<<<<<<
${this.randomClassName}.right img {
position: absolute;
=======
.right img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight};
>>>>>>>
${this.randomClassName}.right img {
width: ${this.state.imageWidth};
height: ${this.state.imageHeight}; |
<<<<<<<
if (dom) {
diffChildren(lastVnode, nextVnode, dom, context, updateQueue);
}
=======
diffChildren(lastVnode, flattenChildren(nextVnode), dom, context, updateQueue);
>>>>>>>
if (dom) {
diffChildren(lastVnode, flattenChildren(nextVnode), dom, context, updateQueue);
}
<<<<<<<
function diffDomText(pastDom, dom, insertPoint) {
var dText = dom.innerText.trim();
var iText = insertPoint.innerText.trim();
var isTrue = false;
pastDom.forEach(function (v) {
if (v.innerText === dText || dText === iText) {
isTrue = !isTrue;
return false;
}
});
return isTrue;
}
function diffChildren(lastVnode, nextVnode, parentNode, context, updateQueue) {
var insertDom = function insertDom(dom) {
return parentNode.insertBefore(dom, insertPoint);
};
=======
function diffChildren(lastVnode, nextChildren, parentNode, context, updateQueue) {
>>>>>>>
function diffDomText(pastDom, dom, insertPoint) {
var dText = dom.innerText.trim();
var iText = insertPoint.innerText.trim();
var isTrue = false;
pastDom.forEach(function (v) {
if (v.innerText === dText || dText === iText) {
isTrue = !isTrue;
return false;
}
});
return isTrue;
}
function diffChildren(lastVnode, nextChildren, parentNode, context, updateQueue) {
var insertDom = function insertDom(dom) {
return parentNode.insertBefore(dom, insertPoint);
}; |
<<<<<<<
import Navigator from '@components/Navigator/index';
=======
>>>>>>>
<<<<<<<
title: '原生组件',
array: 'button,checkbox,input,slider,picker,radio,textarea,label,audio,camera,image,video'
.split(',')
.map(function (name) {
=======
title: "内置组件",
array: "button,checkbox,input,slider,picker,radio,textarea,label,audio,camera,image,video"
.split(",")
.map(function (name) {
>>>>>>>
title: "内置组件",
array: "button,checkbox,input,slider,picker,radio,textarea,label,audio,camera,image,video"
.split(",")
.map(function(name) { |
<<<<<<<
=======
//webview路由跳转
var globalConfig = require('../config');
if (globalConfig.webview && globalConfig.webview.pages.length) {
let routePath = 'pages/__web__view__';
manifest.router.pages[routePath] = {
component: 'index'
}
}
>>>>>>>
<<<<<<<
modules.queue.push({
path: 'manifest.json',
=======
//manifest要序列化的对象
queue.push({
path: path.join(process.cwd(), 'src', 'manifest.json'),
>>>>>>>
//manifest要序列化的对象
modules.queue.push({
path: path.join(process.cwd(), 'src', 'manifest.json'), |
<<<<<<<
const { resetNum, timerLog } = require('./logger/index');
const runBeforeParseTasks = require('../commands/runBeforeParseTasks');
const fs = require('fs-extra');
const cwd = process.cwd();
=======
const { resetNum, timerLog, errorLog, warningLog } = require('./logger/index');
const errorStack = require('./logger/queue');
>>>>>>>
const runBeforeParseTasks = require('../commands/runBeforeParseTasks');
const fs = require('fs-extra');
const cwd = process.cwd();
const { resetNum, timerLog, errorLog, warningLog } = require('./logger/index');
const errorStack = require('./logger/queue'); |
<<<<<<<
if (utils.isWebView(data.id)) {
this.webViewFiles.push({
id: data.id
});
} else {
this.jsFiles.push({
id: data.id,
originalCode: data.originalCode,
resolvedIds: data.resolvedIds //获取alias配置
});
}
=======
//搜集js中依赖的样式,存入quickFiles
this.collectQuickDepStyle(data);
this.jsFiles.push(data);
>>>>>>>
if (utils.isWebView(data.id)) {
this.webViewFiles.push({
id: data.id
});
} else {
//搜集js中依赖的样式,存入quickFiles
this.collectQuickDepStyle(data);
this.jsFiles.push(data);
} |
<<<<<<<
dragListen,// drag listen event.
=======
scrollableContainer, //the scrollable container
>>>>>>>
dragListen,// drag listen event.
scrollableContainer, //the scrollable container |
<<<<<<<
test('registerSimpleHelper', 3, function() {
can.Mustache.registerSimpleHelper('simple', function(first, second) {
equal(first, 2);
equal(second, 4);
return first + second;
});
var template = can.view.mustache('<div>Result: {{simple first second}}</div>');
var frag = template(new can.Map({
first: 2,
second: 4
}));
equal(frag.childNodes[0].innerHTML, 'Result: 6');
});
=======
test('Helper handles list replacement (#1652)', 3, function () {
var state = new can.Map({
list: []
});
var helpers = {
listHasLength: function (options) {
ok(true, 'listHasLength helper evaluated');
return this.attr('list').attr('length') ?
options.fn() :
options.inverse();
}
};
// Helper evaluated 1st time...
can.mustache('{{#listHasLength}}{{/listHasLength}}')(state, helpers);
// Helper evaluated 2nd time...
state.attr('list', []);
// Helper evaluated 3rd time...
state.attr('list').push('...')
});
test('Helper binds to nested properties (#1651)', function () {
var nestedAttrsCount = 0,
state = new can.Map({
parent: null
});
var helpers = {
bindViaNestedAttrs: function (options) {
nestedAttrsCount++;
if (nestedAttrsCount === 3) {
ok(true, 'bindViaNestedAttrs helper evaluated 3 times');
}
return this.attr('parent') && this.attr('parent').attr('child') ?
options.fn() :
options.inverse();
}
};
// Helpers evaluated 1st time...
can.mustache('{{#bindViaNestedAttrs}}{{/bindViaNestedAttrs}}')(state, helpers);
// Helpers evaluated 2nd time...
state.attr('parent', {
child: 'foo'
});
// Helpers evaluated 3rd time...
state.attr('parent.child', 'bar');
});
>>>>>>>
test('registerSimpleHelper', 3, function() {
can.Mustache.registerSimpleHelper('simple', function(first, second) {
equal(first, 2);
equal(second, 4);
return first + second;
});
var template = can.view.mustache('<div>Result: {{simple first second}}</div>');
var frag = template(new can.Map({
first: 2,
second: 4
}));
equal(frag.childNodes[0].innerHTML, 'Result: 6');
});
test('Helper handles list replacement (#1652)', 3, function () {
var state = new can.Map({
list: []
});
var helpers = {
listHasLength: function (options) {
ok(true, 'listHasLength helper evaluated');
return this.attr('list').attr('length') ?
options.fn() :
options.inverse();
}
};
// Helper evaluated 1st time...
can.mustache('{{#listHasLength}}{{/listHasLength}}')(state, helpers);
// Helper evaluated 2nd time...
state.attr('list', []);
// Helper evaluated 3rd time...
state.attr('list').push('...')
});
test('Helper binds to nested properties (#1651)', function () {
var nestedAttrsCount = 0,
state = new can.Map({
parent: null
});
var helpers = {
bindViaNestedAttrs: function (options) {
nestedAttrsCount++;
if (nestedAttrsCount === 3) {
ok(true, 'bindViaNestedAttrs helper evaluated 3 times');
}
return this.attr('parent') && this.attr('parent').attr('child') ?
options.fn() :
options.inverse();
}
};
// Helpers evaluated 1st time...
can.mustache('{{#bindViaNestedAttrs}}{{/bindViaNestedAttrs}}')(state, helpers);
// Helpers evaluated 2nd time...
state.attr('parent', {
child: 'foo'
});
// Helpers evaluated 3rd time...
state.attr('parent.child', 'bar');
}); |
<<<<<<<
false :
!this.leakScope) &&
!!this.template),
bindingsData = {},
//twoWayBindings = {},
=======
false :
!this.leakScope) &&
!!this.template),
twoWayBindings = {},
>>>>>>>
false :
!this.leakScope) &&
!!this.template),
bindingsData = {},
<<<<<<<
var bindingData = bindings.attributeNameInfo(nodeName);
bindingData.propName = can.camelize(bindingData.propName);
bindingsData[bindingData.propName] = bindingData;
=======
>>>>>>>
var bindingData = bindings.attributeNameInfo(nodeName);
bindingData.propName = can.camelize(bindingData.propName);
bindingsData[bindingData.propName] = bindingData;
<<<<<<<
if(bindingData.parentToChild) {
bindings.bindParentToChild(el, compute, function(newValue){
viewModel.attr(bindingData.propName, newValue);
}, viewModelPropertyUpdates, bindingData.propName);
// Set the value to be added to the viewModel
var initialValue = compute();
if(initialValue !== undefined) {
initialScopeData[bindingData.propName] = initialValue;
}
}
bindingsData[bindingData.propName].parentCompute = compute;
=======
bindings.bindParentToChild(el, compute, function(newValue){
viewModel.attr(name, newValue);
}, viewModelPropertyUpdates, name);
// Set the value to be added to the viewModel
initialScopeData[name] = compute();
twoWayBindings[name] = compute;
>>>>>>>
if(bindingData.parentToChild) {
bindings.bindParentToChild(el, compute, function(newValue){
viewModel.attr(bindingData.propName, newValue);
}, viewModelPropertyUpdates, bindingData.propName);
// Set the value to be added to the viewModel
var initialValue = compute();
if(initialValue !== undefined) {
initialScopeData[bindingData.propName] = initialValue;
}
}
bindingsData[bindingData.propName].parentCompute = compute;
<<<<<<<
=======
>>>>>>> |
<<<<<<<
=======
test("can.Construct derived classes should be considered objects, not functions (#450)", function() {
var foostructor = can.Map({ text: "bar" }, {}),
obj = {
next_level: {
thing: foostructor,
text: "In the inner context"
}
},
read;
foostructor.self = foostructor;
read = can.compute.read(obj, can.compute.read.reads("next_level.thing.self.text") );
equal(read.value, "bar", "static properties on a can.Construct-based function");
read = can.compute.read(obj, can.compute.read.reads("next_level.thing.self"), { isArgument: true });
ok(read.value === foostructor, "arguments shouldn't be executed");
foostructor.self = function() { return foostructor; };
read = can.compute.read(obj, can.compute.read.reads("next_level.thing.self.text"), { });
equal(read.value, "bar", "anonymous functions in the middle of a read should be executed if requested");
});
>>>>>>>
<<<<<<<
=======
test("compute.read works with a Map wrapped in a compute", function() {
var parent = can.compute(new can.Map({map: {first: "Justin" }}));
var result = can.compute.read(parent, can.compute.read.reads("map.first"));
equal(result.value, "Justin", "The correct value is found.");
});
test('compute.read works with a Map wrapped in a compute', function() {
var parent = new can.Compute(new can.Map({map: {first: 'Justin' }}));
var result = can.Compute.read(parent, can.compute.read.reads("map.first"));
equal(result.value, 'Justin', 'The correct value is found.');
});
test("compute.read returns constructor functions instead of executing them (#1332)", function() {
var Todo = can.Map.extend({});
var parent = can.compute(new can.Map({map: { Test: Todo }}));
var result = can.compute.read(parent, can.compute.read.reads("map.Test"));
equal(result.value, Todo, 'Got the same Todo');
});
test("compute.set with different values", 4, function() {
var comp = can.compute("David");
var parent = {
name: "David",
comp: comp
};
var map = new can.Map({
name: "David"
});
map.bind('change', function(ev, attr, how, value) {
equal(value, "Brian", "Got change event on map");
});
can.compute.set(parent, "name", "Matthew");
equal(parent.name, "Matthew", "Name set");
can.compute.set(parent, "comp", "Justin");
equal(comp(), "Justin", "Name updated");
can.compute.set(map, "name", "Brian");
equal(map.attr("name"), "Brian", "Name updated in map");
});
>>>>>>>
<<<<<<<
=======
test("can.Compute.read can read a promise (#179)", function(){
var def = new can.Deferred();
var map = new can.Map();
var c = can.compute(function(){
return can.Compute.read({map: map},can.compute.read.reads("map.data.value")).value;
});
var calls = 0;
c.bind("change", function(ev, newVal, oldVal){
calls++;
equal(calls, 1, "only one call");
equal(newVal, "Something", "new value");
equal(oldVal, undefined, "oldVal");
start();
});
map.attr("data", def);
setTimeout(function(){
def.resolve("Something");
},2);
stop();
});
>>>>>>>
<<<<<<<
=======
test('can.compute.reads', function(){
deepEqual( can.compute.read.reads("@foo"),
[{key: "foo", at: true}]);
deepEqual( can.compute.read.reads("@foo.bar"),
[{key: "foo", at: true}, {key: "bar", at: false}]);
deepEqual( can.compute.read.reads("@foo\\.bar"),
[{key: "foo.bar", at: true}]);
deepEqual( can.compute.read.reads("foo.bar@zed"),
[{key: "foo", at: false},{key: "bar", at: false},{key: "zed", at: true}]);
});
>>>>>>>
<<<<<<<
=======
test("prototype computes work (#2098)", function(){
var Map = can.Map.extend({
plusOne: can.compute(function(){
return this.attr("value")+1;
})
});
var root = new Map({value: 2}),
read;
read = can.compute.read(root, can.compute.read.reads("plusOne") );
equal(read.value, 3, "static properties on a can.Construct-based function");
});
>>>>>>> |
<<<<<<<
exprData: exprData
});
args.push(helperOptions);
// Call the helper.
helperEvaluator = function () {
return helper.fn.apply(context, args);
=======
exprData: exprData,
helpersScope: helperOptions
>>>>>>>
exprData: exprData,
helpersScope: helperOptions
<<<<<<<
else if( value != null ){
elements.replace([this], can.frag(value));
=======
else if( value ){
elements.replace([this], can.frag(value, this.ownerDocument));
>>>>>>>
else if( value != null ){
elements.replace([this], can.frag(value, this.ownerDocument)); |
<<<<<<<
// It's handy if we pass this to comptues, because computes can have a default value.
var defaultValues = this._setupDefaults();
this._setupComputes(defaultValues);
=======
// Setup computed attributes.
this._setupComputes();
>>>>>>>
// It's handy if we pass this to comptues, because computes can have a default value.
var defaultValues = this._setupDefaults();
this._setupComputes(defaultValues);
<<<<<<<
/**
* @property {*} can.Map.prototype.DEFAULT-ATTR
*
* @description Specify a default property and value.
*
* @option {*} A value of any type other than a function that will
* be set as the `DEFAULT-ATTR` attribute's value.
*
* @body
*
* ## Use
*
* When extending [can.Map], if a prototype property is not a function,
* it is used as a default value on instances of the extended Map. For example:
*
* var Paginate = can.Map.extend({
* limit: 20,
* offset: 0,
* next: function(){
* this.attr("offset", this.attr("offset")+this.attr("limit"))
* }
* });
*
* var paginate = new Paginate({limit: 30});
*
* paginate.attr("offset") //-> 0
* paginate.attr("limit") //-> 30
*
* paginate.next();
*
* paginate.attr("offset") //-> 30
*/
var data = can.extend(can.extend(true, {}, defaultValues), obj);
=======
// Setup default attribute values.
var data = can.extend(can.extend(true, {}, this._setupDefaults()), obj);
>>>>>>>
var data = can.extend(can.extend(true, {}, defaultValues), obj); |
<<<<<<<
*
=======
* @release 2.0.4
*
>>>>>>>
* @release 2.0.4
*
<<<<<<<
list: function (el, compute, render, context, parentNode) {
=======
/**
* @function can.view.live.list
* @parent can.view.live
* @release 2.0.4
*
* Live binds a compute's [can.List] incrementally.
*
*
* @param {HTMLElement} el An html element to replace with the live-section.
*
* @param {can.compute|can.List} list A [can.List] or [can.compute] whose value is a [can.List].
*
* @param {function(this:*,*,index):String} render(index, index) A function that when called with
* the incremental item to render and the index of the item in the list.
*
* @param {Object} context The `this` the `render` function will be called with.
*
* @param {HTMLElement} [parentNode] An overwritable parentNode if `el`'s parent is
* a documentFragment.
*
* ## Use
*
* `can.view.live.list` is used to setup incremental live-binding.
*
* // a compute that change's it's list
* var todos = can.compute(function(){
* return new Todo.List({page: can.route.attr("page")})
* })
*
* var placeholder = document.createTextNode(" ")
* $("ul#todos").append(placeholder)
*
*
*
* can.view.live.list(
* placeholder,
* todos,
* function(todo, index){
* return "<li>"+todo.attr("name")+"</li>"
* })
*
*/
list: function(el, compute, render, context, parentNode){
>>>>>>>
/**
* @function can.view.live.list
* @parent can.view.live
* @release 2.0.4
*
* Live binds a compute's [can.List] incrementally.
*
*
* @param {HTMLElement} el An html element to replace with the live-section.
*
* @param {can.compute|can.List} list A [can.List] or [can.compute] whose value is a [can.List].
*
* @param {function(this:*,*,index):String} render(index, index) A function that when called with
* the incremental item to render and the index of the item in the list.
*
* @param {Object} context The `this` the `render` function will be called with.
*
* @param {HTMLElement} [parentNode] An overwritable parentNode if `el`'s parent is
* a documentFragment.
*
* ## Use
*
* `can.view.live.list` is used to setup incremental live-binding.
*
* // a compute that change's it's list
* var todos = can.compute(function(){
* return new Todo.List({page: can.route.attr("page")})
* })
*
* var placeholder = document.createTextNode(" ")
* $("ul#todos").append(placeholder)
*
*
*
* can.view.live.list(
* placeholder,
* todos,
* function(todo, index){
* return "<li>"+todo.attr("name")+"</li>"
* })
*
*/
list: function (el, compute, render, context, parentNode) {
<<<<<<<
html: function (el, compute, parentNode) {
var data;
parentNode = elements.getParentNode(el, parentNode);
data = listen(parentNode, compute, function (ev, newVal, oldVal) {
// TODO: remove teardownCheck in 2.1
var attached = nodes[0].parentNode;
// update the nodes in the DOM with the new rendered value
if (attached) {
makeAndPut(newVal);
}
data.teardownCheck(nodes[0].parentNode);
});
=======
/**
* @function can.view.live.html
* @parent can.view.live
* @release 2.0.4
*
* Live binds a compute's value to a collection of elements.
*
*
* @param {HTMLElement} el An html element to replace with the live-section.
*
* @param {can.compute} compute A [can.compute] whose value is HTML.
*
* @param {HTMLElement} [parentNode] An overwritable parentNode if `el`'s parent is
* a documentFragment.
*
* ## Use
*
* `can.view.live.html` is used to setup incremental live-binding.
*
* // a compute that change's it's list
* var greeting = can.compute(function(){
* return "Welcome <i>"+me.attr("name")+"</i>"
* });
*
* var placeholder = document.createTextNode(" ");
* $("#greeting").append(placeholder);
*
* can.view.live.html( placeholder, greeting );
*
*/
html: function(el, compute, parentNode){
var parentNode = elements.getParentNode(el, parentNode),
data = listen(parentNode, compute, function(ev, newVal, oldVal){
// TODO: remove teardownCheck in 2.1
var attached = nodes[0].parentNode;
// update the nodes in the DOM with the new rendered value
if( attached ) {
makeAndPut(newVal);
}
data.teardownCheck(nodes[0].parentNode);
});
>>>>>>>
/**
* @function can.view.live.html
* @parent can.view.live
* @release 2.0.4
*
* Live binds a compute's value to a collection of elements.
*
*
* @param {HTMLElement} el An html element to replace with the live-section.
*
* @param {can.compute} compute A [can.compute] whose value is HTML.
*
* @param {HTMLElement} [parentNode] An overwritable parentNode if `el`'s parent is
* a documentFragment.
*
* ## Use
*
* `can.view.live.html` is used to setup incremental live-binding.
*
* // a compute that change's it's list
* var greeting = can.compute(function(){
* return "Welcome <i>"+me.attr("name")+"</i>"
* });
*
* var placeholder = document.createTextNode(" ");
* $("#greeting").append(placeholder);
*
* can.view.live.html( placeholder, greeting );
*
*/
html: function (el, compute, parentNode) {
var data;
parentNode = elements.getParentNode(el, parentNode);
data = listen(parentNode, compute, function (ev, newVal, oldVal) {
// TODO: remove teardownCheck in 2.1
var attached = nodes[0].parentNode;
// update the nodes in the DOM with the new rendered value
if (attached) {
makeAndPut(newVal);
}
data.teardownCheck(nodes[0].parentNode);
});
<<<<<<<
replace: function (nodes, val, teardown) {
=======
/**
* @function can.view.live.replace
* @parent can.view.live
* @release 2.0.4
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*
* @param {Array.<HTMLElement>} nodes An array of elements. There should typically be one element.
* @param {String|HTMLElement|DocumentFragment} val The content that should replace
* `nodes`. If a string is passed, it will be [can.view.hookup hookedup].
*
* @param {function} [teardown] A callback if these elements are torn down.
*/
replace: function(nodes, val, teardown){
>>>>>>>
/**
* @function can.view.live.replace
* @parent can.view.live
* @release 2.0.4
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*
* @param {Array.<HTMLElement>} nodes An array of elements. There should typically be one element.
* @param {String|HTMLElement|DocumentFragment} val The content that should replace
* `nodes`. If a string is passed, it will be [can.view.hookup hookedup].
*
* @param {function} [teardown] A callback if these elements are torn down.
*/
replace: function (nodes, val, teardown) {
<<<<<<<
text: function (el, compute, parentNode) {
=======
/**
* @function can.view.live.text
* @parent can.view.live
* @release 2.0.4
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*/
text: function(el, compute, parentNode){
>>>>>>>
/**
* @function can.view.live.text
* @parent can.view.live
* @release 2.0.4
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*/
text: function (el, compute, parentNode) {
<<<<<<<
/**
* @function can.view.live.text
* @parent can.view.live
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*/
attributes: function (el, compute, currentValue) {
var setAttrs = function (newVal) {
=======
attributes: function(el, compute, currentValue){
var setAttrs = function(newVal){
>>>>>>>
/**
* @function can.view.live.text
* @parent can.view.live
*
* Replaces one element with some content while keeping [can.view.live.nodeLists nodeLists] data
* correct.
*/
attributes: function (el, compute, currentValue) {
var setAttrs = function (newVal) {
<<<<<<<
};
listen(el, compute, function (ev, newVal) {
setAttrs(newVal);
});
=======
}
listen(el, compute, function(ev, newVal){
setAttrs(newVal)
})
>>>>>>>
};
listen(el, compute, function (ev, newVal) {
setAttrs(newVal);
});
<<<<<<<
goodParts.splice(1, 0, compute());
=======
goodParts.splice(1,0,compute());
>>>>>>>
goodParts.splice(1, 0, compute()); |
<<<<<<<
store: function (count, make, filter) {
=======
// ## can.fixture.store
// Make a store of objects to use when making requests against fixtures.
store: function (types, count, make, filter) {
>>>>>>>
// ## can.fixture.store
// Make a store of objects to use when making requests against fixtures.
store: function (count, make, filter) {
<<<<<<<
methods = {},
types,
items,
reset;
if(can.isArray(count) && typeof count[0] === "string" ){
types = count;
count = make;
make= filter;
filter = arguments[3];
} else if(typeof count === "string") {
types = [count + "s", count];
count = make;
make= filter;
filter = arguments[3];
}
if(typeof count === "number") {
items = [];
reset = function () {
items = [];
for (var i = 0; i < (count); i++) {
//call back provided make
var item = make(i, items);
if (!item.id) {
item.id = i;
}
currentId = Math.max(item.id + 1, currentId + 1) || items.length;
items.push(item);
}
if (can.isArray(types)) {
can.fixture["~" + types[0]] = items;
can.fixture["-" + types[0]] = methods.findAll;
can.fixture["-" + types[1]] = methods.findOne;
can.fixture["-" + types[1] + "Update"] = methods.update;
can.fixture["-" + types[1] + "Destroy"] = methods.destroy;
can.fixture["-" + types[1] + "Create"] = methods.create;
}
};
} else {
=======
methods = {};
if (typeof types === "string") {
// If types is a string, change it to an array with the name and
// "pluralize" it.
types = [types + "s", types];
} else if (!can.isArray(types)) {
// Otherwise, shift the arguments right to match their names
>>>>>>>
methods = {},
types,
items,
reset;
if(can.isArray(count) && typeof count[0] === "string" ){
types = count;
count = make;
make= filter;
filter = arguments[3];
} else if(typeof count === "string") {
types = [count + "s", count];
count = make;
make= filter;
filter = arguments[3];
}
if(typeof count === "number") {
items = [];
reset = function () {
items = [];
for (var i = 0; i < (count); i++) {
//call back provided make
var item = make(i, items);
if (!item.id) {
item.id = i;
}
currentId = Math.max(item.id + 1, currentId + 1) || items.length;
items.push(item);
}
if (can.isArray(types)) {
can.fixture["~" + types[0]] = items;
can.fixture["-" + types[0]] = methods.findAll;
can.fixture["-" + types[1]] = methods.findOne;
can.fixture["-" + types[1] + "Update"] = methods.update;
can.fixture["-" + types[1] + "Destroy"] = methods.destroy;
can.fixture["-" + types[1] + "Create"] = methods.create;
}
};
} else {
<<<<<<<
=======
// ## fixtureStore.findAll
// Simulates a can.Model.findAll to a fixture
>>>>>>>
<<<<<<<
if ( typeof filter === "function" ) {
=======
// If a filter function was provided, pass results though function
// to potentially filter out ones that do not match.
if (filter) {
>>>>>>>
if ( typeof filter === "function" ) {
<<<<<<<
=======
// ## fixtureStore.findOne
// Simulates a can.Model.findOne to a fixture
>>>>>>>
// ## fixtureStore.findOne
// Simulates a can.Model.findOne to a fixture
<<<<<<<
=======
// ## fixtureStore.update
// Simulates a can.Model.update to a fixture
>>>>>>>
// ## fixtureStore.update
// Simulates a can.Model.update to a fixture
<<<<<<<
=======
// ## fixtureStore.destroy
// Simulates a can.Model.destroy to a fixture
>>>>>>>
// ## fixtureStore.destroy
// Simulates a can.Model.destroy to a fixture
<<<<<<<
=======
// ## fixtureStore.create
// Simulates a can.Model.create to a fixture
>>>>>>>
// ## fixtureStore.create
// Simulates a can.Model.create to a fixture
<<<<<<<
=======
// ## fixtureStore.reset
// Resets the fixture store back to its original data.
var reset = function () {
items = [];
for (var i = 0; i < (count); i++) {
//call back provided make
var item = make(i, items);
if (!item.id) {
item.id = i;
}
currentId = Math.max(item.id + 1, currentId + 1) || items.length;
items.push(item);
}
if (can.isArray(types)) {
can.fixture["~" + types[0]] = items;
can.fixture["-" + types[0]] = methods.findAll;
can.fixture["-" + types[1]] = methods.findOne;
can.fixture["-" + types[1] + "Update"] = methods.update;
can.fixture["-" + types[1] + "Destroy"] = methods.destroy;
can.fixture["-" + types[1] + "Create"] = methods.create;
}
};
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
// ## can.fixture.rand
// Creates either a random number or a random selection of variables
>>>>>>>
<<<<<<<
=======
// ## can.fixture.xhr
// Create an object that looks like an XHR object.
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
// ## can.fixture.delay
// The delay, in milliseconds, between an AJAX request being made and when
// the success callback gets called.
>>>>>>>
// ## can.fixture.delay
// The delay, in milliseconds, between an AJAX request being made and when
// the success callback gets called.
<<<<<<<
=======
// ## can.fixture.rootUrl
// The root URL which fixtures will use.
>>>>>>>
// ## can.fixture.rootUrl
// The root URL which fixtures will use. |
<<<<<<<
can.bind = function() {};
can.unbind = function() {};
can.trigger = function() {};
can.delegate = function() {};
can.undelegate = function() {};
=======
>>>>>>>
<<<<<<<
// Events
// can.bind = function( ev, cb){
// // if we can bind to it ...
// if(this.bind && this.bind !== can.bind){
// this.bind(ev, cb)
// } else if(this.addEvent) {
// this.addEvent(ev, cb)
// } else {
// // make it bind-able ...
// can.addEvent.call(this, ev, cb)
// }
// return this;
// }
// can.unbind = function(ev, cb){
// // if we can bind to it ...
// if(this.unbind && this.unbind !== can.unbind){
// this.unbind(ev, cb)
// } else {
// // make it bind-able ...
// can.removeEvent.call(this, ev, cb)
// }
// return this;
// }
// can.trigger = function(item, event, args, bubble){
// if(item.trigger){
// if(bubble === false){
// // force stop propagation by
// // listening to On and then immediately disconnecting
// var connect = item.on(event, function(ev){
// ev.stopPropagation();
// dojo.disconnect(connect);
// })
// item.trigger(event,args)
// } else {
// item.trigger(event,args)
// }
//
// } else {
// if(typeof event === 'string'){
// event = {type: event}
// }
// event.data = args
// can.dispatch.call(item, event)
// }
// }
// can.delegate = function(selector, ev , cb){
// if(this.on || this.nodeType){
// addBinding( new dojo.NodeList(this), selector+":"+ev, cb)
// } else if(this.delegate) {
// this.delegate(selector, ev , cb)
// }
// return this;
// }
// can.undelegate = function(selector, ev , cb){
// if(this.on || this.nodeType){
// removeBinding(new dojo.NodeList(this), selector+":"+ev, cb);
// } else if(this.undelegate) {
// this.undelegate(selector, ev , cb)
// }
// return this;
// }
=======
Can.data = function(wrapped, key, value){
if(value === undefined){
return wrapped[0].getData(key)
} else {
return wrapped.setData(key, value)
}
}
Can.remove = function(wrapped){
return wrapped.filter(function(node){
if(node.nodeType !== 1){
node.parentNode.removeChild(node);
} else {
return true;
}
}).destroy();
}
// destroyed method
var destroy = Element.prototype.destroy;
Element.prototype.destroy = function(){
Can.trigger(this,"destroyed",[],false)
var elems = this.getElementsByTagName("*");
for ( var i = 0, elem; (elem = elems[i]) !== undefined; i++ ) {
Can.trigger(elem,"destroyed",[],false);
}
destroy.apply(this, arguments)
}
// Ajax
var optionsMap = {
type:"method",
success : undefined,
error: undefined
}
var updateDeferred = function(xhr, d){
for(var prop in xhr){
if(typeof d[prop] == 'function'){
d[prop] = function(){
xhr[prop].apply(xhr, arguments)
}
} else {
d[prop] = prop[xhr]
}
}
}
Can.ajax = function(options){
var d = Can.Deferred(),
requestOptions = Can.extend({}, options);
for(var option in optionsMap){
if(requestOptions[option] !== undefined){
requestOptions[optionsMap[option]] = requestOptions[option];
delete requestOptions[option]
}
}
>>>>>>>
can.data = function(wrapped, key, value){
if(value === undefined){
return wrapped[0].getData(key)
} else {
return wrapped.setData(key, value)
}
}
can.remove = function(wrapped){
return wrapped.filter(function(node){
if(node.nodeType !== 1){
node.parentNode.removeChild(node);
} else {
return true;
}
}).destroy();
}
// destroyed method
var destroy = Element.prototype.destroy;
Element.prototype.destroy = function(){
can.trigger(this,"destroyed",[],false)
var elems = this.getElementsByTagName("*");
for ( var i = 0, elem; (elem = elems[i]) !== undefined; i++ ) {
can.trigger(elem,"destroyed",[],false);
}
destroy.apply(this, arguments)
}
// Ajax
var optionsMap = {
type:"method",
success : undefined,
error: undefined
}
var updateDeferred = function(xhr, d){
for(var prop in xhr){
if(typeof d[prop] == 'function'){
d[prop] = function(){
xhr[prop].apply(xhr, arguments)
}
} else {
d[prop] = prop[xhr]
}
}
}
can.ajax = function(options){
var d = can.Deferred(),
requestOptions = can.extend({}, options);
for(var option in optionsMap){
if(requestOptions[option] !== undefined){
requestOptions[optionsMap[option]] = requestOptions[option];
delete requestOptions[option]
}
} |
<<<<<<<
} else if (range.clientX != null || range.pageX != null || range.left != null) {
this.rangeFromPoint(range)
} else if (range.originalEvent && range.originalEvent.touches && range.originalEvent.touches.length) {
this.rangeFromPoint(range.originalEvent.touches[0])
} else if (range.originalEvent && range.originalEvent.changedTouches && range.originalEvent.changedTouches.length) {
this.rangeFromPoint(range.originalEvent.changedTouches[0])
=======
} else if (range.clientX || range.pageX || range.left) {
this.moveToPoint(range)
>>>>>>>
} else if (range.clientX != null || range.pageX != null || range.left != null) {
this.moveToPoint(range)
} else if (range.originalEvent && range.originalEvent.touches && range.originalEvent.touches.length) {
this.moveToPoint(range.originalEvent.touches[0])
} else if (range.originalEvent && range.originalEvent.changedTouches && range.originalEvent.changedTouches.length) {
this.moveToPoint(range.originalEvent.changedTouches[0])
<<<<<<<
}, supportWhitespace,
isWhitespace = function(el){
if(supportWhitespace == null){
supportWhitespace = 'isElementContentWhitespace' in el;
}
return (supportWhitespace? el.isElementContentWhitespace :
(el.nodeType === 3 && '' == el.data.trim()));
}, within = function(rect, point){
=======
},
// if a point is within a rectangle
within = function(rect, point){
>>>>>>>
},
supportWhitespace,
isWhitespace = function(el){
if(supportWhitespace == null){
supportWhitespace = 'isElementContentWhitespace' in el;
}
return (supportWhitespace? el.isElementContentWhitespace :
(el.nodeType === 3 && '' == el.data.trim()));
},
// if a point is within a rectangle
within = function(rect, point){
<<<<<<<
$("<div id='rect' />").appendTo(document.body)
=======
// support
support.moveToPoint = !!$.Range().range.moveToPoint
>>>>>>>
support.moveToPoint = !!$.Range().range.moveToPoint |
<<<<<<<
steal("can/model", "can/view/ejs", "can/test", function() {
module("can/view/ejs, rendering",{
setup : function(){
this.animals = ['sloth', 'bear', 'monkey']
if(!this.animals.each){
this.animals.each = function(func){
for(var i =0; i < this.length; i++){
func(this[i])
}
=======
(function () {
module('can/view/ejs, rendering', {
setup: function () {
this.animals = [
'sloth',
'bear',
'monkey'
];
if (!this.animals.each) {
this.animals.each = function (func) {
for (var i = 0; i < this.length; i++) {
func(this[i]);
}
};
>>>>>>>
steal("can/model", "can/view/ejs", "can/test", function() {
module('can/view/ejs, rendering', {
setup: function () {
this.animals = [
'sloth',
'bear',
'monkey'
];
if (!this.animals.each) {
this.animals.each = function (func) {
for (var i = 0; i < this.length; i++) {
func(this[i]);
}
};
<<<<<<<
equal(div.getElementsByTagName('div').length, 0, '0 items in list')
todos.push({id: 4, name: 'Pick up sticks'});
equal(div.getElementsByTagName('div').length, 1, '1 item in list again')
});
test("attribute single unescaped, html single unescaped", function(){
var text = "<div id='me' class='<%== task.attr('completed') ? 'complete' : ''%>'><%== task.attr('name') %></div>";
var task = new can.Map({
name : 'dishes'
})
var compiled = new can.EJS({text: text}).render({task: task}) ;
var div = document.createElement('div');
div.appendChild(can.view.frag(compiled))
equal(div.getElementsByTagName('div')[0].innerHTML,"dishes", "html correctly dishes")
equal(div.getElementsByTagName('div')[0].className,"", "class empty")
task.attr('name','lawn')
equal(div.getElementsByTagName('div')[0].innerHTML,"lawn", "html correctly lawn")
equal(div.getElementsByTagName('div')[0].className,"", "class empty")
task.attr('completed', true);
equal(div.getElementsByTagName('div')[0].className,"complete", "class changed to complete")
});
test("event binding / triggering on things other than options", 1, function(){
var frag = can.buildFragment("<ul><li>a</li></ul>",[document]);
var qta = document.getElementById('qunit-test-area');
qta.innerHTML = "";
qta.appendChild(frag);
// destroyed events should not bubble
can.bind.call(qta.getElementsByTagName("li")[0], 'foo', function(event) {
ok(true,"li called :)");
=======
equal(div.getElementsByTagName('div')
.length, 0, '0 items in list');
todos.push({
id: 4,
name: 'Pick up sticks'
});
equal(div.getElementsByTagName('div')
.length, 1, '1 item in list again');
>>>>>>>
equal(div.getElementsByTagName('div')
.length, 0, '0 items in list');
todos.push({
id: 4,
name: 'Pick up sticks'
});
equal(div.getElementsByTagName('div')
.length, 1, '1 item in list again'); |
<<<<<<<
steal('can/route/pushstate', "can/test", function(){
/*var orgTest = window.test;
var test = function(name, fn){
orgTest(name, function(){
console.log(name+"\n");
return fn.apply(this, arguments)
})
}*/
if(window.history && history.pushState) {
var originalPath = location.pathname;
module("can/route/pushstate",{
setup: function(){
can.route._teardown();
can.route.defaultBinding = "pushstate";
},
teardown: function() {
}
});
=======
/* jshint asi:true*/
(function () {
>>>>>>>
/* jshint asi:true*/
steal('can/route/pushstate', "can/test", function(){
<<<<<<<
test("clicked hashes work (#259)", function(){
stop();
window.routeTestReady = function(iCanRoute, loc, hist, win) {
iCanRoute(win.location.pathname,{
page: "index"
})
iCanRoute(":type/:id");
iCanRoute.ready();
window.win = win;
var link = win.document.createElement("a");
link.href="/articles/17#references";
link.innerHTML = "Click Me"
win.document.body.appendChild(link);
win.can.trigger(win.can.$(link), "click")
//link.click()
setTimeout(function(){
deepEqual(can.extend({},iCanRoute.attr()),{
type: "articles",
id: "17",
route: ":type/:id"
},"articles are right")
equal( win.location.hash, "#references", "includes hash");
start();
can.remove(can.$(iframe))
},100);
}
var iframe = document.createElement('iframe');
iframe.src = can.test.path("route/pushstate/testing.html");
can.$("#qunit-test-area")[0].appendChild(iframe);
});
=======
setTimeout(function () {
win.history.back();
setTimeout(function () {
var path = win.location.pathname;
// strip root for deparam
if (path.indexOf(root) === 0) {
path = path.substr(root.length);
}
equal(win.can.route.deparam(path)
.page, "start", message + " passed");
nextStateTest();
}, 200);
}, 200);
}, 200);
}
win.can.route.bindings.pushstate.root = root;
win.can.route(":page/");
win.can.route.ready();
nextStateTest();
}
>>>>>>>
setTimeout(function () {
win.history.back();
setTimeout(function () {
var path = win.location.pathname;
// strip root for deparam
if (path.indexOf(root) === 0) {
path = path.substr(root.length);
}
equal(win.can.route.deparam(path)
.page, "start", message + " passed");
nextStateTest();
}, 200);
}, 200);
}, 200);
}
win.can.route.bindings.pushstate.root = root;
win.can.route(":page/");
win.can.route.ready();
nextStateTest();
} |
<<<<<<<
map: state.map,
splitTreeAndMap: state.controls.splitTreeAndMap,
=======
>>>>>>>
// map: state.map,
splitTreeAndMap: state.controls.splitTreeAndMap,
<<<<<<<
horizontal: this.props.browserDimensions && this.props.browserDimensions.width > globals.twoColumnBreakpoint && this.props.splitTreeAndMap ? .5 : 1,
=======
horizontal: this.props.browserDimensions && this.props.browserDimensions.width > twoColumnBreakpoint ? .5 : 1,
>>>>>>>
horizontal: this.props.browserDimensions && this.props.browserDimensions.width > twoColumnBreakpoint && this.props.splitTreeAndMap ? .5 : 1, |
<<<<<<<
test("easy hookup", function(){
var div = $('<div/>').html("//jquery/view/ejs/easyhookup.ejs",{text: "yes"})
ok( div.find('div').hasClass('yes'), "has yes" )
});
test("helpers", function() {
$.EJS.Helpers.prototype.simpleHelper = function()
{
return 'Simple';
}
$.EJS.Helpers.prototype.elementHelper = function()
{
return function(el) {
el.innerHTML = 'Simple';
}
}
var text = "<div><%= simpleHelper() %></div>";
var compiled = new $.EJS({text: text}).render() ;
equals(compiled, "<div>Simple</div>");
text = "<div id=\"hookup\" <%= elementHelper() %>></div>";
compiled = new $.EJS({text: text}).render() ;
$('#qunit-test-area').append($(compiled));
equals($('#hookup').html(), "Simple");
});
=======
test("binding", function(){
var text = "<div class='<%== task.attr('completed') ? 'complete' : ''%>'><%== task.attr('name') %></div>";
var task = new $.Observe({
name : 'dishes'
})
var compiled = new $.EJS({text: text}).render({task: task}) ;
var div = $('<div/>').html(compiled)
console.log(div.html());
task.attr('name','lawn')
console.log(div.html());
task.attr('completed', true);
console.log(div.html());
});
>>>>>>>
test("easy hookup", function(){
var div = $('<div/>').html("//jquery/view/ejs/easyhookup.ejs",{text: "yes"})
ok( div.find('div').hasClass('yes'), "has yes" )
});
test("helpers", function() {
$.EJS.Helpers.prototype.simpleHelper = function()
{
return 'Simple';
}
$.EJS.Helpers.prototype.elementHelper = function()
{
return function(el) {
el.innerHTML = 'Simple';
}
}
var text = "<div><%= simpleHelper() %></div>";
var compiled = new $.EJS({text: text}).render() ;
equals(compiled, "<div>Simple</div>");
text = "<div id=\"hookup\" <%= elementHelper() %>></div>";
compiled = new $.EJS({text: text}).render() ;
$('#qunit-test-area').append($(compiled));
equals($('#hookup').html(), "Simple");
});
test("binding", function(){
var text = "<div class='<%== task.attr('completed') ? 'complete' : ''%>'><%== task.attr('name') %></div>";
var task = new $.Observe({
name : 'dishes'
})
var compiled = new $.EJS({text: text}).render({task: task}) ;
var div = $('<div/>').html(compiled)
console.log(div.html());
task.attr('name','lawn')
console.log(div.html());
task.attr('completed', true);
console.log(div.html());
}); |
<<<<<<<
if (d.visibility !== "visible") return;
=======
if (this.props.narrativeMode) return;
>>>>>>>
if (d.visibility !== "visible") return;
if (this.props.narrativeMode) return;
<<<<<<<
if (d.visibility !== "visible") return;
=======
if (this.props.narrativeMode) return;
>>>>>>>
if (d.visibility !== "visible") return;
if (this.props.narrativeMode) return; |
<<<<<<<
steal("can/construct/proxy", "can/control", function() {
=======
(function () {
/* global Car */
>>>>>>>
steal("can/construct/proxy", "can/control", function() {
/* global Car */
<<<<<<<
});
=======
}());
>>>>>>>
}); |
<<<<<<<
},
// #### insertElementsAfter
// Appends elements after the last item in oldElements.
insertElementsAfter = function(oldElements, newFrag){
var last = oldElements[oldElements.length - 1];
// Insert it in the `document` or `documentFragment`
if( last.nextSibling ){
can.insertBefore(last.parentNode, newFrag, last.nextSibling)
} else {
can.appendChild(last.parentNode, newFrag);
}
},
splice = [].splice;
=======
};
>>>>>>>
},
splice = [].splice;
<<<<<<<
list: function(el, compute, func, context, parentNode){
// A mapping of the index to an array
// of elements that represent the item.
// Each array is registered so child or parent
// live structures can update the elements
var nodesMap = [],
// A mapping of items to their indicies'
indexMap = [],
// called when an item is added
=======
list: function(el, compute, render, context, parentNode){
// A nodeList of all elements this live-list manages.
// This is here so that if this live list is within another section
// that section is able to remove the items in this list.
var masterNodeList = [el],
// A mapping of the index of an item to an array
// of elements that represent the item.
// Each array is registered so child or parent
// live structures can update the elements.
itemIndexToNodeListsMap = [],
// Called when items are added to the list.
>>>>>>>
list: function(el, compute, render, context, parentNode){
// A nodeList of all elements this live-list manages.
// This is here so that if this live list is within another section
// that section is able to remove the items in this list.
var masterNodeList = [el],
// A mapping of the index of an item to an array
// of elements that represent the item.
// Each array is registered so child or parent
// live structures can update the elements.
itemIndexToNodeListsMap = [],
// A mapping of items to their indicies'
indexMap = [],
// Called when items are added to the list.
<<<<<<<
newMappings = [],
newIndicies = [];
=======
newNodeLists = [];
// For each new item,
>>>>>>>
newNodeLists = [],
newIndicies = [];
// For each new item,
<<<<<<<
// register each item
can.each(newMappings,function(nodeList){
nodeLists.register(nodeList)
});
splice.apply(nodesMap, [index, 0].concat(newMappings));
// update indecies after insert point
splice.apply(indexMap, [index, 0].concat(newIndicies));
for(var i = index+newIndicies.length, len = indexMap.length; i < len; i++){
indexMap[i](i)
}
=======
// Add the new nodeLists.
[].splice.apply(itemIndexToNodeListsMap, [index, 0].concat(newNodeLists));
>>>>>>>
splice.apply(itemIndexToNodeListsMap, [index, 0].concat(newNodeLists));
// update indices after insert point
splice.apply(indexMap, [index, 0].concat(newIndicies));
for(var i = index+newIndicies.length, len = indexMap.length; i < len; i++){
indexMap[i](i)
} |
<<<<<<<
=======
/**
* @add can.prototype
*/
>>>>>>>
<<<<<<<
/**
* @hide
* @attribute pluginName
* Setting the <code>pluginName</code> property allows you
* to change the jQuery plugin helper name from its
* default value.
*
* can.Control("Mxui.Layout.Fill",{
* pluginName: "fillWith"
* },{});
*
* $("#foo").fillWith();
*/
$.fn.extend({
=======
can.prototype.extend({
>>>>>>>
/**
* @hide
* @attribute pluginName
* Setting the <code>pluginName</code> property allows you
* to change the jQuery plugin helper name from its
* default value.
*
* can.Control("Mxui.Layout.Fill",{
* pluginName: "fillWith"
* },{});
*
* $("#foo").fillWith();
*/
can.prototype.extend({ |
<<<<<<<
});
=======
test("Test top level attributes", 7, function() {
var test = new can.Map({
'my.enable': false,
'my.item': true,
'my.count': 0,
'my.newCount': 1,
'my': {
'value': true,
'nested': {
'value': 100
}
}
});
equal( test.attr('my.value'), true, 'correct' );
equal( test.attr('my.nested.value'), 100, 'correct' );
ok( test.attr("my.nested") instanceof can.Map );
equal( test.attr('my.enable'), false, 'falsey (false) value accessed correctly' );
equal( test.attr('my.item'), true, 'truthey (true) value accessed correctly' );
equal( test.attr('my.count'), 0, 'falsey (0) value accessed correctly' );
equal( test.attr('my.newCount'), 1, 'falsey (1) value accessed correctly' );
});
})();
>>>>>>>
test("Test top level attributes", 7, function() {
var test = new can.Map({
'my.enable': false,
'my.item': true,
'my.count': 0,
'my.newCount': 1,
'my': {
'value': true,
'nested': {
'value': 100
}
}
});
equal( test.attr('my.value'), true, 'correct' );
equal( test.attr('my.nested.value'), 100, 'correct' );
ok( test.attr("my.nested") instanceof can.Map );
equal( test.attr('my.enable'), false, 'falsey (false) value accessed correctly' );
equal( test.attr('my.item'), true, 'truthey (true) value accessed correctly' );
equal( test.attr('my.count'), 0, 'falsey (0) value accessed correctly' );
equal( test.attr('my.newCount'), 1, 'falsey (1) value accessed correctly' );
});
}); |
<<<<<<<
test("html takes promise", function(){
var d = new can.Deferred();
can.$("#qunit-test-area").html(d);
stop();
d.done(function(){
equal(can.$("#qunit-test-area").html(), "Hello World", "deferred is working");
start();
})
setTimeout(function(){
d.resolve("Hello World")
},10)
});
test("val set with a template within a hookup within another template", function(){
var frag = can.view(can.test.path("view/test/hookupvalcall.ejs"), {});
var div = document.createElement('div');
div.appendChild(frag);
equal(div.getElementsByTagName('div')[0].getElementsByTagName('h3')[0].innerHTML, 'in div', 'Rendered withing other template');
});
test("jQuery.fn.hookup", function(){
can.$("#qunit-test-area").html("");
var els = $(can.view.render(can.test.path("view/test/hookup.ejs"),{})).hookup();
can.$("#qunit-test-area").html(els); //makes sure no error happens
equal(can.$("#qunit-test-area")[0].getElementsByTagName('div')[0].id, 'dummy', 'Element hooked up');
});
test("hookups don't break script execution (issue #130)", function(){
// this simulates a pending hookup (hasn't been run yet)
can.view.hook(function() {});
// this simulates HTML with script tags being loaded (probably legacy code)
can.$("#qunit-test-area").html("<script>can.$('#qunit-test-area').html('OK')</script>");
equal(can.$("#qunit-test-area").html(),'OK');
can.$("#qunit-test-area").html("");
});
});
=======
test('html takes promise', function () {
var d = new can.Deferred();
can.$('#qunit-test-area')
.html(d);
stop();
d.done(function () {
equal(can.$('#qunit-test-area')
.html(), 'Hello World', 'deferred is working');
start();
});
setTimeout(function () {
d.resolve('Hello World');
}, 10);
});
test('val set with a template within a hookup within another template', function () {
var frag = can.view(can.test.path('view/test/hookupvalcall.ejs'), {});
var div = document.createElement('div');
div.appendChild(frag);
equal(div.getElementsByTagName('div')[0].getElementsByTagName('h3')[0].innerHTML, 'in div', 'Rendered withing other template');
});
test('jQuery.fn.hookup', function () {
can.$('#qunit-test-area')
.html('');
var els = $(can.view.render(can.test.path('view/test/hookup.ejs'), {}))
.hookup();
can.$('#qunit-test-area')
.html(els);
//makes sure no error happens
equal(can.$('#qunit-test-area')[0].getElementsByTagName('div')[0].id, 'dummy', 'Element hooked up');
});
test('hookups don\'t break script execution (issue #130)', function () {
// this simulates a pending hookup (hasn't been run yet)
can.view.hook(function () {});
// this simulates HTML with script tags being loaded (probably legacy code)
can.$('#qunit-test-area')
.html('<script>can.$(\'#qunit-test-area\').html(\'OK\')</script>');
equal(can.$('#qunit-test-area')
.html(), 'OK');
can.$('#qunit-test-area')
.html('');
});
}());
>>>>>>>
test('html takes promise', function () {
var d = new can.Deferred();
can.$('#qunit-test-area')
.html(d);
stop();
d.done(function () {
equal(can.$('#qunit-test-area')
.html(), 'Hello World', 'deferred is working');
start();
});
setTimeout(function () {
d.resolve('Hello World');
}, 10);
});
test('val set with a template within a hookup within another template', function () {
var frag = can.view(can.test.path('view/test/hookupvalcall.ejs'), {});
var div = document.createElement('div');
div.appendChild(frag);
equal(div.getElementsByTagName('div')[0].getElementsByTagName('h3')[0].innerHTML, 'in div', 'Rendered withing other template');
});
test('jQuery.fn.hookup', function () {
can.$('#qunit-test-area')
.html('');
var els = $(can.view.render(can.test.path('view/test/hookup.ejs'), {}))
.hookup();
can.$('#qunit-test-area')
.html(els);
//makes sure no error happens
equal(can.$('#qunit-test-area')[0].getElementsByTagName('div')[0].id, 'dummy', 'Element hooked up');
});
test('hookups don\'t break script execution (issue #130)', function () {
// this simulates a pending hookup (hasn't been run yet)
can.view.hook(function () {});
// this simulates HTML with script tags being loaded (probably legacy code)
can.$('#qunit-test-area')
.html('<script>can.$(\'#qunit-test-area\').html(\'OK\')</script>');
equal(can.$('#qunit-test-area')
.html(), 'OK');
can.$('#qunit-test-area')
.html('');
});
}); |
<<<<<<<
steal("can/route", "can/test", function() {
module("can/route",{
setup: function(){
can.route._teardown();
can.route.defaultBinding = "hashchange";
=======
/* jshint asi:true*/
(function () {
module("can/route", {
setup: function () {
can.route._teardown();
can.route.defaultBinding = "hashchange";
}
})
if (!("onhashchange" in window)) {
return;
>>>>>>>
/* jshint asi:true*/
steal("can/route", "can/test", function() {
module("can/route", {
setup: function () {
can.route._teardown();
can.route.defaultBinding = "hashchange";
}
})
if (!("onhashchange" in window)) {
return;
<<<<<<<
res = can.route.param({page: "foo", foo: "bar", where: "there"});
equal(res, "pages/foo/&where=there")
// There is no matching route so the hash should be empty.
res = can.route.param({});
equal(res, "")
can.route.routes = {};
res = can.route.param({page: "foo", bar: "baz", where: "there"});
equal(res, "&page=foo&bar=baz&where=there")
res = can.route.param({});
equal(res, "")
});
test("symmetry", function(){
can.route.routes = {};
var obj = {page: "=&[]", nestedArray : ["a"], nested : {a :"b"} }
var res = can.route.param(obj)
var o2 = can.route.deparam(res)
deepEqual(o2, obj)
})
test("light param", function(){
can.route.routes = {};
can.route(":page",{
page: "index"
=======
test("deparam-param", function () {
can.route.routes = {};
can.route(":foo/:bar", {
foo: 1,
bar: 2
});
var res = can.route.param({
foo: 1,
bar: 2
});
equal(res, "/", "empty slash")
var deparamed = can.route.deparam("/")
deepEqual(deparamed, {
foo: 1,
bar: 2,
route: ":foo/:bar"
})
>>>>>>>
test("deparam-param", function () {
can.route.routes = {};
can.route(":foo/:bar", {
foo: 1,
bar: 2
});
var res = can.route.param({
foo: 1,
bar: 2
});
equal(res, "/", "empty slash")
var deparamed = can.route.deparam("/")
deepEqual(deparamed, {
foo: 1,
bar: 2,
route: ":foo/:bar"
}) |
<<<<<<<
var ignoreAttributesRegExp = /^(dataViewId|class|id)$/i,
viewAttr = can.view.attr;
=======
// ## Helpers
// Attribute names to ignore for setting scope values.
var ignoreAttributesRegExp = /^(dataViewId|class|id)$/i;
>>>>>>>
// ## Helpers
// Attribute names to ignore for setting scope values.
var ignoreAttributesRegExp = /^(dataViewId|class|id)$/i,
viewAttr = can.view.attr;
<<<<<<<
// use that object as the prototype of an extened Map constructor function.
=======
// If scope is an object, use that object as the prototype of an extended
// Map constructor function.
>>>>>>>
// If scope is an object, use that object as the prototype of an extended
// Map constructor function.
<<<<<<<
can.view.tag(this.prototype.tag, function (el, options) {
=======
// Register this component to be created when its `tag` is found.
can.view.Scanner.tag(this.prototype.tag, function (el, options) {
>>>>>>>
// Register this component to be created when its `tag` is found.
can.view.tag(this.prototype.tag, function (el, options) { |
<<<<<<<
import { modifyURLquery } from "../../util/urlHelpers";
import { changeDateFilter } from "../../actions/treeProperties";
=======
import { CHANGE_DATE_MIN, CHANGE_DATE_MAX, CHANGE_ABSOLUTE_DATE_MIN,
CHANGE_ABSOLUTE_DATE_MAX } from "../../actions/controls";
import { controlsWidth } from "../../util/globals";
>>>>>>>
import { controlsWidth } from "../../util/globals";
import { modifyURLquery } from "../../util/urlHelpers";
import { changeDateFilter } from "../../actions/treeProperties"; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.