conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
store.mods.editor && (store.mods.editor.root = () => git.root())
const vars = store.vars;
>>>>>>>
store.mods.editor && (store.mods.editor.root = () => git.root()) |
<<<<<<<
// import treeLossTsc from 'components/widgets/forest-change/tree-loss-tsc';
=======
import treeLossTsc from 'components/widgets/forest-change/tree-loss-tsc';
import fires from 'components/widgets/forest-change/fires';
>>>>>>>
import treeLossTsc from 'components/widgets/forest-change/tree-loss-tsc'; |
<<<<<<<
},
initPaginate: function(){
var options = this.getPaginateOptions();
// pagination
this.$paginationContainer = $('#my-gfw-subscriptions-pagination');
this.$paginationContainer.pagination(options);
},
getPaginateSubscriptions: function() {
var start = this.model.get('perpage') * (this.model.get('page') - 1);
var end = this.model.get('perpage') * (this.model.get('page') - 1) + this.model.get('perpage');
return this.subscriptions.slice(start, end);
},
getPaginateOptions: function() {
return {
items: this.subscriptions.toJSON().length,
itemsOnPage : this.model.get('perpage'),
currentPage : this.model.get('page'),
displayedPages: 3,
selectOnClick: false,
prevText: ' ',
nextText: ' ',
onPageClick: function(pageNumber, event){
event.preventDefault();
this.model.set('page', pageNumber);
this.$paginationContainer.pagination('drawPage', pageNumber);
this.render();
}.bind(this)
}
=======
if (urlParams.unsubscribed === 'true') {
mps.publish('Notification/open', ['my-gfw-subscription-deleted']);
}
>>>>>>>
if (urlParams.unsubscribed === 'true') {
mps.publish('Notification/open', ['my-gfw-subscription-deleted']);
}
},
initPaginate: function(){
var options = this.getPaginateOptions();
// pagination
this.$paginationContainer = $('#my-gfw-subscriptions-pagination');
this.$paginationContainer.pagination(options);
},
getPaginateSubscriptions: function() {
var start = this.model.get('perpage') * (this.model.get('page') - 1);
var end = this.model.get('perpage') * (this.model.get('page') - 1) + this.model.get('perpage');
return this.subscriptions.slice(start, end);
},
getPaginateOptions: function() {
return {
items: this.subscriptions.toJSON().length,
itemsOnPage : this.model.get('perpage'),
currentPage : this.model.get('page'),
displayedPages: 3,
selectOnClick: false,
prevText: ' ',
nextText: ' ',
onPageClick: function(pageNumber, event){
event.preventDefault();
this.model.set('page', pageNumber);
this.$paginationContainer.pagination('drawPage', pageNumber);
this.render();
}.bind(this)
} |
<<<<<<<
import { getNonGlobalDatasets } from 'services/forest-data';
import { setDashboardPromptsSettings } from 'components/prompts/dashboard-prompts/actions';
=======
import { getNonGlobalDatasets } from 'services/analysis-cached';
>>>>>>>
import { setDashboardPromptsSettings } from 'components/prompts/dashboard-prompts/actions';
import { getNonGlobalDatasets } from 'services/analysis-cached'; |
<<<<<<<
import axios from 'axios';
import moment from 'moment';
=======
import { apiRequest, cartoRquest } from 'utils/request';
>>>>>>>
import { apiRequest, cartoRequest } from 'utils/request';
<<<<<<<
}`.replace('{WHERE}', getWHEREQuery({ adm0, adm1, adm2, ...params }));
return axios.get(url).then(response => ({
=======
}`.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
if (download) {
return {
name: 'treecover_loss__ha',
url: url.replace('query', 'download')
};
}
return apiRequest.get(url).then(response => ({
>>>>>>>
}`.replace('{WHERE}', getWHEREQuery({ adm0, adm1, adm2, ...params }));
if (download) {
return {
name: 'treecover_loss__ha',
url: url.replace('query', 'download')
};
}
return apiRequest.get(url).then(response => ({
<<<<<<<
export const getLossGrouped = ({ adm0, adm1, adm2, ...params }) => {
const url = `${getRequestUrl({
...params,
adm0,
adm1,
adm2,
grouped: true
})}${SQL_QUERIES.lossGrouped}`
.replace(
/{location}/g,
getLocationSelectGrouped({ adm0, adm1, adm2, ...params })
)
.replace('{WHERE}', getWHEREQuery({ adm0, adm1, adm2, ...params }));
=======
export const getLossGrouped = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl({ adm0, adm1, adm2, grouped: true })}${
SQL_QUERIES.lossGrouped
}`
.replace(/{location}/g, getLocationSelectGrouped({ adm0, adm1, adm2 }))
.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
>>>>>>>
export const getLossGrouped = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl({
adm0,
adm1,
adm2,
grouped: true,
...params
})}${SQL_QUERIES.lossGrouped}`
.replace(
/{location}/g,
getLocationSelectGrouped({ adm0, adm1, adm2, ...params })
)
.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
<<<<<<<
.replace(
/{location}/g,
getLocationSelectGrouped({ adm0, adm1, adm2, ...params })
)
.replace('{WHERE}', getWHEREQuery({ adm0, adm1, adm2, ...params }));
return axios.get(url).then(response => ({
=======
.replace(/{location}/g, getLocationSelectGrouped({ adm0, adm1, adm2 }))
.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
if (download) {
return {
name: 'treecover_gain_2000-2012_by_region__ha',
url: url.replace('query', 'download')
};
}
return apiRequest.get(url).then(response => ({
>>>>>>>
.replace(
/{location}/g,
getLocationSelectGrouped({ adm0, adm1, adm2, ...params })
)
.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
if (download) {
return {
name: 'treecover_gain_2000-2012_by_region__ha',
url: url.replace('query', 'download')
};
}
return apiRequest.get(url).then(response => ({
<<<<<<<
.replace('{WHERE}', getWHEREQuery(params));
return axios.get(url);
=======
.replace('{WHERE}', getWHEREQuery({ iso: params.adm0, ...params }));
return apiRequest.get(url);
>>>>>>>
.replace('{WHERE}', getWHEREQuery(params));
return apiRequest.get(url); |
<<<<<<<
'map/views/layers/PerBufferLayer',
'map/views/layers/PerNatPALayer',
'map/views/layers/PerPrivPALayer',
'map/views/layers/PerRegPALayer',
'map/views/layers/IdnForMorLayer',
=======
// high resolution maps
'map/views/layers/UrthecastLayer',
>>>>>>>
'map/views/layers/PerBufferLayer',
'map/views/layers/PerNatPALayer',
'map/views/layers/PerPrivPALayer',
'map/views/layers/PerRegPALayer',
'map/views/layers/IdnForMorLayer',
// high resolution maps
'map/views/layers/UrthecastLayer',
<<<<<<<
PerBufferLayer,
PerNatPALayer,
PerPrivPALayer,
PerRegPALayer,
IdnForMorLayer,
=======
UrthecastLayer,
>>>>>>>
PerBufferLayer,
PerNatPALayer,
PerPrivPALayer,
PerRegPALayer,
IdnForMorLayer,
UrthecastLayer,
<<<<<<<
per_buffer: {
view: PerBufferLayer
},
per_nat_pa: {
view: PerNatPALayer
},
per_priv_pa: {
view: PerPrivPALayer
},
per_reg_pa: {
view: PerRegPALayer
},
idn_for_mor: {
view: IdnForMorLayer
},
=======
urthe: {
view: UrthecastLayer
},
>>>>>>>
per_buffer: {
view: PerBufferLayer
},
per_nat_pa: {
view: PerNatPALayer
},
per_priv_pa: {
view: PerPrivPALayer
},
per_reg_pa: {
view: PerRegPALayer
},
idn_for_mor: {
view: IdnForMorLayer
},
urthe: {
view: UrthecastLayer
}, |
<<<<<<<
},
responsiblesHelper() {
let aTopic = new Topic(this.minutesID, this.topic._id);
if (aTopic.hasResponsibles()) {
return "("+aTopic.getResponsiblesString()+")";
}
return "";
=======
},
showRecurringIcon() {
return (this.isEditable || this.topic.isRecurring);
>>>>>>>
},
showRecurringIcon() {
return (this.isEditable || this.topic.isRecurring);
},
responsiblesHelper() {
let aTopic = new Topic(this.minutesID, this.topic._id);
if (aTopic.hasResponsibles()) {
return "("+aTopic.getResponsiblesString()+")";
}
return ""; |
<<<<<<<
// some responsive CSS tweaking
useClassWell() {
if (! Session.get("global.isMobileWidth")) {
return "well";
}
},
switch2MultiColumn() {
let aMin = new Minutes(_minutesID);
if (aMin.participants.length > 7) {
return "multicolumn";
}
},
useStylePadding() {
if (! Session.get("global.isMobileWidth")) {
return "padding-left: 1.5em;";
}
},
=======
>>>>>>> |
<<<<<<<
'map/views/layers/MysLoggingSabahLayer',
=======
'map/views/layers/MysPASabahLayer',
>>>>>>>
'map/views/layers/MysLoggingSabahLayer',
'map/views/layers/MysPASabahLayer',
<<<<<<<
MysLoggingSabahLayer,
=======
MysPASabahLayer,
>>>>>>>
MysLoggingSabahLayer,
MysPASabahLayer, |
<<<<<<<
activeBasemap: getBasemap,
=======
showRecentImagery: getShowRecentImagery,
>>>>>>>
activeBasemap: getBasemap,
showRecentImagery: getShowRecentImagery, |
<<<<<<<
import { setMainMapSettings } from 'pages/map/actions';
=======
import { setMapSettings } from 'components/map/actions';
import { setMainMapSettings } from 'layouts/map/actions';
>>>>>>>
import { setMainMapSettings } from 'layouts/map/actions'; |
<<<<<<<
MapControlsView, TabsView, AnalysisResultsView, LayersNavView, LegendView, TimelineView, NavMobileView, GuideView, HeaderView, FooterView, NotificationsView, DownloadView) {
=======
MapControlsView, TabsView, AnalysisResultsView, LayersNavView, LegendView, TimelineView, NavMobileView, HeaderView, FooterView, NotificationsView, DownloadView, FeedbackModalView) {
>>>>>>>
MapControlsView, TabsView, AnalysisResultsView, LayersNavView, LegendView, TimelineView, NavMobileView, GuideView, HeaderView, FooterView, NotificationsView, DownloadView, FeedbackModalView) {
<<<<<<<
new GuideView();
=======
new FeedbackModalView();
>>>>>>>
new GuideView();
new FeedbackModalView(); |
<<<<<<<
import * as gladBiodiversity from './widgets/biodiversity/glad-biodiversity';
import * as intactness from './widgets/biodiversity/intactness';
=======
// import * as gladBiodiversity from './widgets/biodiversity/glad-biodiversity';
>>>>>>>
import * as intactness from './widgets/biodiversity/intactness';
// import * as gladBiodiversity from './widgets/biodiversity/glad-biodiversity';
<<<<<<<
gladBiodiversity,
intactness,
=======
// gladBiodiversity,
>>>>>>>
intactness,
// gladBiodiversity, |
<<<<<<<
'text!map/templates/layersNavByCountryWrapper.handlebars',
'text!map/templates/tabs/countries-mobile.handlebars'
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplIso, tplButtons, tplCountryWrapper, tplMobile) {
=======
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplIso, tplButtons) {
>>>>>>>
'text!map/templates/tabs/countries-mobile.handlebars'
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplIso, tplButtons, tplMobile) {
<<<<<<<
templateCountryWrapper: Handlebars.compile(tplCountryWrapper),
templateMobile: Handlebars.compile(tplMobile),
=======
>>>>>>>
templateMobile: Handlebars.compile(tplMobile),
<<<<<<<
'click #countries-country-ul li' : 'changeIsoMobile',
'click #countries-country-reset' : 'changeIsoMobile',
'click .layer': 'toggleLayer'
=======
'change #countries-region-select' : 'changeArea',
'click .layer': 'toggleLayer',
'click .wrapped-layer': 'toggleLayerWrap'
>>>>>>>
'change #countries-region-select' : 'changeArea',
'click #countries-country-ul li' : 'changeIsoMobile',
'click #countries-country-reset' : 'changeIsoMobile' |
<<<<<<<
(params.glad ? polynameMeta.gladTableKey : polynameMeta.tableKey);
let paramKey = p;
if (p === 'threshold') paramKey = 'treecover_density__threshold';
if (p === 'iso' && params.type === 'geostore') paramKey = 'geostore__id';
if (p === 'iso' && params.type === 'wdpa') paramKey = 'wdpa_id';
=======
(params.glad && polynameMeta.gladTableKey
? polynameMeta.gladTableKey
: polynameMeta.tableKey);
>>>>>>>
(params.glad && polynameMeta.gladTableKey
? polynameMeta.gladTableKey
: polynameMeta.tableKey);
let paramKey = p;
if (p === 'threshold') paramKey = 'treecover_density__threshold';
if (p === 'iso' && params.type === 'geostore') paramKey = 'geostore__id';
if (p === 'iso' && params.type === 'wdpa') paramKey = 'wdpa_id'; |
<<<<<<<
import * as woodyBiomass from './widgets/climate/whrc-biomass/';
=======
import * as emissionsPlantations from './widgets/climate/emissions-plantations';
>>>>>>>
import * as woodyBiomass from './widgets/climate/whrc-biomass/';
import * as emissionsPlantations from './widgets/climate/emissions-plantations';
<<<<<<<
woodyBiomass,
=======
emissionsPlantations,
>>>>>>>
woodyBiomass,
emissionsPlantations, |
<<<<<<<
import * as emissionsDeforestationActions from 'pages/country/widget/widgets/widget-emissions-deforestation/widget-emissions-deforestation-actions';
=======
import * as firesActions from 'pages/country/widget/widgets/widget-fires/widget-fires-actions';
>>>>>>>
import * as emissionsDeforestationActions from 'pages/country/widget/widgets/widget-emissions-deforestation/widget-emissions-deforestation-actions';
import * as firesActions from 'pages/country/widget/widgets/widget-fires/widget-fires-actions';
<<<<<<<
...emissionsActions.default,
...emissionsDeforestationActions.default
=======
...emissionsActions.default,
...firesActions.default
>>>>>>>
...emissionsActions.default,
...emissionsDeforestationActions.default,
...firesActions.default |
<<<<<<<
const getRankingLocationQuery = (country, region, subRegion) =>
`${
region
? `iso = '${country}' ${subRegion ? `AND adm1 = ${region}` : ''}`
: '1 = 1'
}`;
export const getLocations = ({ country, region, indicator, threshold }) => {
=======
export const getLocations = ({
country,
region,
indicator,
threshold,
extentYear
}) => {
>>>>>>>
const getRankingLocationQuery = (country, region, subRegion) =>
`${
region
? `iso = '${country}' ${subRegion ? `AND adm1 = ${region}` : ''}`
: '1 = 1'
}`;
export const getLocations = ({
country,
region,
indicator,
threshold,
extentYear
}) => { |
<<<<<<<
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return axios.get(url);
=======
.replace('{indicator}', indicator);
return request.get(url);
>>>>>>>
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return request.get(url);
<<<<<<<
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return axios.get(url);
=======
.replace('{indicator}', indicator);
return request.get(url);
>>>>>>>
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return request.get(url);
<<<<<<<
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return axios.get(url);
=======
.replace('{indicator}', indicator);
return request.get(url);
>>>>>>>
.replace('{indicator}', getIndicatorQuery(forestType, landCategory));
return request.get(url);
<<<<<<<
.replace('{polyname}', getIndicatorQuery(forestType, landCategory));
return axios.get(url);
=======
.replace('{polyname}', indicator);
return request.get(url);
>>>>>>>
.replace('{polyname}', getIndicatorQuery(forestType, landCategory));
return request.get(url); |
<<<<<<<
=======
let template = 'Hello {{name}}, time: {{time}}';
const date = new Date();
const name = '4minitz';
>>>>>>>
<<<<<<<
it('uses the style template helper to include stylesheet files', function() {
const template = '{{style style.css}}';
const expected = `<style>${textFile}</style>`;
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
expect(tmplRenderer.render()).to.equal(expected);
});
=======
it('uses the markdown helper correctly', function () {
template = 'Hello {{markdown2html name}}';
let expected = 'Hello <strong>Peter</strong><br>\n';
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
tmplRenderer.addData('name', '**Peter**');
expect(tmplRenderer.render()).to.equal(expected);
});
it('uses the doctype helper correctly', function () {
template = '{{doctype}}';
let expected = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
expect(tmplRenderer.render()).to.equal(expected);
});
>>>>>>>
it('uses the style template helper to include stylesheet files', function() {
const template = '{{style style.css}}';
const expected = `<style>${textFile}</style>`;
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
expect(tmplRenderer.render()).to.equal(expected);
});
it('uses the markdown helper correctly', function () {
template = 'Hello {{markdown2html name}}';
let expected = 'Hello <strong>Peter</strong><br>\n';
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
tmplRenderer.addData('name', '**Peter**');
expect(tmplRenderer.render()).to.equal(expected);
});
it('uses the doctype helper correctly', function () {
template = '{{doctype}}';
let expected = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
tmplRenderer = new TemplateRenderer(template, null,/* loadTmplFromAssets */ false);
expect(tmplRenderer.render()).to.equal(expected);
}); |
<<<<<<<
=======
'Analysis/upload': function(geojson) {
ga('send', 'event', 'Map', 'Analysis', 'Upload Shapefile');
this._saveAndAnalyzeGeojson(geojson, {draw: true});
}
}, {
>>>>>>> |
<<<<<<<
import { ResponsiblePreparer } from '/imports/client/ResponsiblePreparer';
=======
import { Label } from '/imports/label';
>>>>>>>
import { ResponsiblePreparer } from '/imports/client/ResponsiblePreparer';
import { Label } from '/imports/label';
<<<<<<<
import {configureSelect2Labels} from './helpers/configure-select2-labels';
import {convertOrCreateLabelsFromStrings} from './helpers/convert-or-create-label-from-string';
import {IsEditedService} from '../../../imports/services/isEditedService';
import {isEditedHandling} from '../../helpers/isEditedHelpers';
=======
import {convertOrCreateLabelsFromStrings} from '/client/templates/topic/helpers/convert-or-create-label-from-string';
import {configureSelect2Responsibles} from '/imports/client/ResponsibleSearch';
>>>>>>>
import {IsEditedService} from '../../../imports/services/isEditedService';
import {isEditedHandling} from '../../helpers/isEditedHelpers';
import {convertOrCreateLabelsFromStrings} from '/client/templates/topic/helpers/convert-or-create-label-from-string';
import {configureSelect2Responsibles} from '/imports/client/ResponsibleSearch';
<<<<<<<
'show.bs.modal #dlgAddTopic': function (evt) {
const topic = getEditTopic();
if (topic !== false) {
const element = topic._topicDoc;
const unset = function () {
IsEditedService.removeIsEditedTopic(_minutesID, topic._topicDoc._id, true);
$('#dlgAddTopic').modal('show');
};
const setIsEdited = () => {
IsEditedService.setIsEditedTopic(_minutesID, topic._topicDoc._id);
};
isEditedHandling(element, unset, setIsEdited, evt, 'confirmationDialogResetEdit');
}
configureSelect2Responsibles();
=======
'show.bs.modal #dlgAddTopic': function () {
let topic = getEditTopic();
configureSelect2Responsibles('id_selResponsible', topic._topicDoc, true, _minutesID);
>>>>>>>
'show.bs.modal #dlgAddTopic': function (evt) {
const topic = getEditTopic();
if (topic !== false) {
const element = topic._topicDoc;
const unset = function () {
IsEditedService.removeIsEditedTopic(_minutesID, topic._topicDoc._id, true);
$('#dlgAddTopic').modal('show');
};
const setIsEdited = () => {
IsEditedService.setIsEditedTopic(_minutesID, topic._topicDoc._id);
};
isEditedHandling(element, unset, setIsEdited, evt, 'confirmationDialogResetEdit');
}
configureSelect2Responsibles('id_selResponsible', topic._topicDoc, true, _minutesID); |
<<<<<<<
E2ETopics.insertTopicDataIntoDialog(aTopic, aResponsible);
=======
E2ETopics.insertTopicDataIntoDialog(aTopic);
E2ETopics.submitTopicDialog();
>>>>>>>
E2ETopics.insertTopicDataIntoDialog(aTopic, aResponsible);
E2ETopics.submitTopicDialog();
<<<<<<<
E2EGlobal.waitSomeTime();
E2ETopics.insertInfoItemDataIntoDialog(infoItemDoc, true);
=======
this.insertInfoItemDataIntoDialog(infoItemDoc, true);
this.submitInfoItemDialog();
>>>>>>>
E2EGlobal.waitSomeTime();
this.insertInfoItemDataIntoDialog(infoItemDoc, true);
this.submitInfoItemDialog();
<<<<<<<
if (infoItemDoc.responsible) {
E2ETopics.responsibleEnterFreetext(infoItemDoc.responsible);
}
=======
>>>>>>>
if (infoItemDoc.responsible) {
E2ETopics.responsibleEnterFreetext(infoItemDoc.responsible);
} |
<<<<<<<
define([
'underscore',
=======
define(
[
>>>>>>>
define(
[
'underscore',
<<<<<<<
'map/presenters/layers/BraMapBiomasLayerPresenter'
], function(_, d3, UriTemplate, CanvasLayerClass, Presenter) {
=======
'map/presenters/layers/Forest2010LayerPresenter'
],
function(d3, UriTemplate, CanvasLayerClass, Presenter) {
>>>>>>>
'map/presenters/layers/BraMapBiomasLayerPresenter'
],
function(_, d3, UriTemplate, CanvasLayerClass, Presenter) {
<<<<<<<
year: 2000,
urlTemplate: 'https://storage.googleapis.com/wri-public/mapbiomass/tiles/v4{/year}{/z}{/x}{/y}.png'
=======
dataMaxZoom: 12,
urlTemplate:
'https://storage.googleapis.com/wri-public/mapbiomass/tiles/v4/2016{/z}{/x}{/y}.png'
>>>>>>>
year: 2000,
urlTemplate:
'https://storage.googleapis.com/wri-public/mapbiomass/tiles/v4{/year}{/z}{/x}{/y}.png'
<<<<<<<
this.year = options.year|| this.options.year;
=======
>>>>>>>
this.year = options.year || this.options.year;
<<<<<<<
console.log(this.year);
console.log(this.threshold);
return new UriTemplate(this.options.urlTemplate)
.fillFromObject({x: x, y: y, z: z, year: this.year});
=======
return new UriTemplate(this.options.urlTemplate).fillFromObject({
x: x,
y: y,
z: z,
threshold: this.threshold
});
>>>>>>>
return new UriTemplate(this.options.urlTemplate).fillFromObject({
x: x,
y: y,
z: z,
year: this.year
}); |
<<<<<<<
import { ReactiveVar } from 'meteor/reactive-var';
=======
import { FlowRouter } from 'meteor/kadira:flow-router';
>>>>>>>
import { ReactiveVar } from 'meteor/reactive-var';
import { FlowRouter } from 'meteor/kadira:flow-router';
<<<<<<<
_meetingSeriesID = this.data.meetingSeriesId;
this.activeTabTemplate = new ReactiveVar("minutesList");
this.activeTabId = new ReactiveVar("tab_minutes");
let myTemplate = Template.instance();
this.onSearchChangedHandler = (query) => {
if (myTemplate.activeTabTemplate.get() === 'tabTopicsItems') {
let tab_id = (query.indexOf('is:item') === -1) ? 'tab_topics' : 'tab_items';
myTemplate.activeTabId.set(tab_id);
}
}
=======
this.autorun(() => {
_meetingSeriesID = FlowRouter.getParam('_id');
this.showSettingsDialog = FlowRouter.getQueryParam('edit') === 'true';
let usrRoles = new UserRoles();
if (!usrRoles.hasViewRoleFor(_meetingSeriesID)) {
FlowRouter.go('/');
}
});
Session.setDefault("currentTab", "minutesList");
>>>>>>>
this.autorun(() => {
_meetingSeriesID = FlowRouter.getParam('_id');
this.showSettingsDialog = FlowRouter.getQueryParam('edit') === 'true';
let usrRoles = new UserRoles();
if (!usrRoles.hasViewRoleFor(_meetingSeriesID)) {
FlowRouter.go('/');
}
});
this.activeTabTemplate = new ReactiveVar("minutesList");
this.activeTabId = new ReactiveVar("tab_minutes");
let myTemplate = Template.instance();
this.onSearchChangedHandler = (query) => {
if (myTemplate.activeTabTemplate.get() === 'tabTopicsItems') {
let tab_id = (query.indexOf('is:item') === -1) ? 'tab_topics' : 'tab_items';
myTemplate.activeTabId.set(tab_id);
}
}
<<<<<<<
if (this.data.openMeetingSeriesEditor) {
=======
Session.set("currentTab", "minutesList");
if (this.showSettingsDialog) {
>>>>>>>
if (this.showSettingsDialog) { |
<<<<<<<
import plantationsByType from './layers/plantationsByType';
import Glad from './layers/glad';
=======
import PlantationsBySpecies from './layers/plantations-by-species';
import Viirs from './layers/viirs';
>>>>>>>
import plantationsByType from './layers/plantationsByType';
import Glad from './layers/glad';
import PlantationsBySpecies from './layers/plantations-by-species';
import Viirs from './layers/viirs';
<<<<<<<
loss: Loss,
plantations_by_type: plantationsByType,
umd_as_it_happens: Glad
=======
loss: Loss,
plantations_by_species: PlantationsBySpecies,
viirs_fires_alerts: Viirs
>>>>>>>
loss: Loss,
plantations_by_type: plantationsByType,
plantations_by_species: PlantationsBySpecies,
umd_as_it_happens: Glad,
viirs_fires_alerts: Viirs |
<<<<<<<
import { getNonGlobalDatasets } from 'services/analysis-cached';
=======
import { setDashboardPromptsSettings } from 'components/prompts/dashboard-prompts/actions';
import { getNonGlobalDatasets } from 'services/forest-data-old';
>>>>>>>
import { getNonGlobalDatasets } from 'services/analysis-cached';
import { setDashboardPromptsSettings } from 'components/prompts/dashboard-prompts/actions'; |
<<<<<<<
export const getData = ({ params }) => {
let polyname = 'plantations';
switch (params.indicator) {
case 'primary_forest__wdpa':
polyname = 'plantations__wdpa';
break;
case 'primary_forest__mining':
polyname = 'plantations__mining';
break;
case 'primary_forest__landmark':
polyname = 'plantations__landmark';
break;
default:
break;
}
return axios
=======
export default ({ params }) =>
axios
>>>>>>>
export const getData = ({ params }) =>
axios
<<<<<<<
);
};
export const getDataURL = params => {
if (!params) return null;
let polyname = 'plantations';
switch (params.indicator) {
case 'primary_forest__wdpa':
polyname = 'plantations__wdpa';
break;
case 'primary_forest__mining':
polyname = 'plantations__mining';
break;
case 'primary_forest__landmark':
polyname = 'plantations__landmark';
break;
default:
break;
}
return [
getExtent({ ...params, forestType: '', download: true }),
getExtent({ ...params, download: true }),
getExtent({ ...params, indicator: polyname, download: true })
];
};
export default getData;
=======
);
>>>>>>>
);
export const getDataURL = params => [
getExtent({ ...params, forestType: '', download: true }),
getExtent({ ...params, download: true }),
getExtent({
...params,
forestType:
params.forestType === 'primary_forest'
? 'plantations'
: params.forestType,
download: true
})
];
export default getData; |
<<<<<<<
const selectSection = (state, props) => props.exploreType;
const selectQuery = state => state.location && state.location.query;
=======
const selectSection = (state, props) => props.exploreSection;
>>>>>>>
const selectSection = (state, props) => props.exploreType; |
<<<<<<<
key('s', this.shareMap);
key('t', this.toggleModules);
=======
key('f', this.shareMap);
key('h', this.toggleModules);
>>>>>>>
key('s', this.shareMap);
key('h', this.toggleModules);
<<<<<<<
render: function (mobile) {
if (mobile) {
this.$el.html(this.templateMobile({embedUrl: this._generateEmbedUrl()}));
}else{
this.$el.html(this.template({embedUrl: this._generateEmbedUrl()}));
}
=======
render: function(){
this.$el.html(this.template());
>>>>>>>
render: function (mobile) {
if (mobile) {
this.$el.html(this.templateMobile({embedUrl: this._generateEmbedUrl()}));
}else{
this.$el.html(this.template({embedUrl: this._generateEmbedUrl()}));
}
<<<<<<<
},
toggleControls: function(e){
this.$toggleButtons.children('.toggle-button').toggleClass('hidden');
},
_generateEmbedUrl: function() {
return window.location.origin + '/embed' + window.location.pathname + window.location.search;
=======
>>>>>>>
},
toggleControls: function(e){
this.$toggleButtons.children('.toggle-button').toggleClass('hidden');
},
_generateEmbedUrl: function() {
return window.location.origin + '/embed' + window.location.pathname + window.location.search; |
<<<<<<<
});
export const getCumulative = params =>
range(2015, 2019).map(year => {
const url = `${process.env.GFW_API}/v1/query/?sql=`;
const query = `SELECT sum(alerts) AS alerts,
sum(cumulative_emissions) AS cumulative_emissions,
sum(cumulative_deforestation) AS cumulative_deforestation,
sum(loss_ha) AS loss,
sum(percent_to_emissions_target) AS percent_to_emissions_target,
sum(percent_to_deforestation_target) AS percent_to_deforestation_target,
year as year,
country_iso,
week FROM a98197d2-cd8e-4b17-ab5c-fabf54b25ea0 WHERE country_iso =
'${params.adm0}' AND year IN ('${year}') AND week
<= 53 GROUP BY week, country_iso ORDER BY week ASC`;
return request.get(encodeURI(`${url}${query}`));
});
=======
});
export const getBiomassRanking = ({
adm0,
adm1,
adm2,
variable,
threshold
}) => {
let query;
if (!adm1) {
query = SQL_QUERIES.globalAndCountry
.replace('{variable}', variable)
.replace('{threshold}', threshold);
} else if (adm1 && !adm2) {
query = SQL_QUERIES.adm1
.replace('{variable}', variable)
.replace('{adm0}', adm0)
.replace('{threshold}', threshold);
} else if (adm1 && adm2) {
query = SQL_QUERIES.adm2
.replace('{variable}', variable)
.replace('{adm0}', adm0)
.replace('{adm1}', adm1)
.replace('{threshold}', threshold);
}
const url = `${process.env.CARTO_API}/sql?q=${query}`;
return request.get(url);
};
>>>>>>>
});
export const getCumulative = params =>
range(2015, 2019).map(year => {
const url = `${process.env.GFW_API}/v1/query/?sql=`;
const query = `SELECT sum(alerts) AS alerts,
sum(cumulative_emissions) AS cumulative_emissions,
sum(cumulative_deforestation) AS cumulative_deforestation,
sum(loss_ha) AS loss,
sum(percent_to_emissions_target) AS percent_to_emissions_target,
sum(percent_to_deforestation_target) AS percent_to_deforestation_target,
year as year,
country_iso,
week FROM a98197d2-cd8e-4b17-ab5c-fabf54b25ea0 WHERE country_iso =
'${params.adm0}' AND year IN ('${year}') AND week
<= 53 GROUP BY week, country_iso ORDER BY week ASC`;
return request.get(encodeURI(`${url}${query}`));
});
export const getBiomassRanking = ({
adm0,
adm1,
adm2,
variable,
threshold
}) => {
let query;
if (!adm1) {
query = SQL_QUERIES.globalAndCountry
.replace('{variable}', variable)
.replace('{threshold}', threshold);
} else if (adm1 && !adm2) {
query = SQL_QUERIES.adm1
.replace('{variable}', variable)
.replace('{adm0}', adm0)
.replace('{threshold}', threshold);
} else if (adm1 && adm2) {
query = SQL_QUERIES.adm2
.replace('{variable}', variable)
.replace('{adm0}', adm0)
.replace('{adm1}', adm1)
.replace('{threshold}', threshold);
}
const url = `${process.env.CARTO_API}/sql?q=${query}`;
return request.get(url);
}; |
<<<<<<<
country: (!!iso) ? _.findWhere(this.countries, { iso: iso.country }) : null,
=======
country: (!!iso) ? _.findWhere(this.countries.toJSON(), { iso: iso.country }) : null,
more: more
>>>>>>>
country: (!!iso) ? _.findWhere(this.countries, { iso: iso.country }) : null,
more: more |
<<<<<<<
embedHeight: 600,
embedWidth: 600
=======
hideEmbed: true
>>>>>>>
embedHeight: 600,
embedWidth: 600
hideEmbed: true
<<<<<<<
var url = $(event.currentTarget).data('share-url') || window.location.href;
this.model.set('url', url);
var embedUrl = $(event.currentTarget).data('share-embed-url') || window.location.origin + '/embed' + window.location.pathname + window.location.search;
this.model.set('embedUrl', embedUrl);
this.model.set('embedWidth', $(event.currentTarget).data('share-embed-width'));
this.model.set('embedHeight', $(event.currentTarget).data('share-embed-height'));
=======
var hideEmbed = $(event.currentTarget).data('hide-embed');
this.model.set('hideEmbed', !!hideEmbed);
var url = $(event.currentTarget).data('share-url');
if (url !== undefined) {
this.model.set('url', url);
}else{
this.model.set('url', window.location.href);
}
>>>>>>>
var url = $(event.currentTarget).data('share-url') || window.location.href;
this.model.set('url', url);
var embedUrl = $(event.currentTarget).data('share-embed-url') || window.location.origin + '/embed' + window.location.pathname + window.location.search;
this.model.set('embedUrl', embedUrl);
this.model.set('embedWidth', $(event.currentTarget).data('share-embed-width'));
this.model.set('embedHeight', $(event.currentTarget).data('share-embed-height'));
var hideEmbed = $(event.currentTarget).data('hide-embed');
this.model.set('hideEmbed', !!hideEmbed); |
<<<<<<<
whitelists: handleActions(whitelistsProviderComponent),
datasets: handleActions(datasetsProviderComponent)
=======
datasets: handleActions(datasetsProviderComponent),
layerSpec: handleActions(layerSpecProviderComponent)
>>>>>>>
whitelists: handleActions(whitelistsProviderComponent),
datasets: handleActions(datasetsProviderComponent),
layerSpec: handleActions(layerSpecProviderComponent) |
<<<<<<<
export const TOPICS = 'location/TOPICS';
=======
export const THANKYOU = 'location/THANKYOU';
>>>>>>>
export const TOPICS = 'location/TOPICS';
export const THANKYOU = 'location/THANKYOU'; |
<<<<<<<
const getLatest = state => state.latest || null;
=======
const getCountries = state => state.countries || null;
>>>>>>>
const getLatest = state => state.latest || null;
const getCountries = state => state.countries || null;
<<<<<<<
visibility,
opacity,
active: layers && layers.indexOf(l.id) > -1,
...(!isEmpty(params) && {
params: {
...l.params,
...params
}
}),
...(!isEmpty(sqlParams) && {
sqlParams: {
...l.sqlParams,
...sqlParams
}
}),
...(!isEmpty(l.decodeParams) &&
l.decodeFunction && {
decodeParams: {
...l.decodeParams,
minDate: l.decodeParams && l.decodeParams.startDate,
maxDate: l.decodeParams && l.decodeParams.endDate,
trimEndDate: l.decodeParams && l.decodeParams.endDate,
...(layers &&
layers.indexOf('confirmedOnly') > -1 && {
confirmedOnly: true
}),
...decodeParams
}
}),
=======
...layerConfig,
active:
layerConfig &&
layerConfig.layers &&
layerConfig.layers.includes(l.id),
params: {
...l.params,
...params
},
sqlParams: {
...l.sqlParams,
...sqlParams
},
decodeParams: {
...l.decodeParams,
...decodeParams
},
>>>>>>>
visibility,
opacity,
active: layers && layers.includes(l.id),
...(!isEmpty(params) && {
params: {
...l.params,
...params
}
}),
...(!isEmpty(sqlParams) && {
sqlParams: {
...l.sqlParams,
...sqlParams
}
}),
...(!isEmpty(l.decodeParams) &&
l.decodeFunction && {
decodeParams: {
...l.decodeParams,
minDate: l.decodeParams && l.decodeParams.startDate,
maxDate: l.decodeParams && l.decodeParams.endDate,
trimEndDate: l.decodeParams && l.decodeParams.endDate,
...(layers &&
layers.includes('confirmedOnly') && {
confirmedOnly: true
}),
...decodeParams
}
}), |
<<<<<<<
const mapStateToProps = (
{ countryData, widgets, location, datasets, geostore, latest },
{ widgetKey }
) => ({
=======
const mapStateToProps = ({ location, datasets, geostore }) => ({
>>>>>>>
const mapStateToProps = ({ location, datasets, geostore, latest }) => ({
<<<<<<<
...widgets,
...geostore,
widgetKey,
latest: latest.data
=======
...geostore
>>>>>>>
...geostore,
latest: latest.data |
<<<<<<<
/**
* Checks whether this topic has associated responsibles
* or not. This method must have the same name as the
* actionItem.hasResponsibles method.
*
* @return {boolean}
*/
=======
getLabels(meetingSeriesId) {
return this.getLabelsRawArray().map(labelId => {
return Label.createLabelById(meetingSeriesId, labelId);
})
}
addLabelByName(labelName, meetingSeriesId) {
let label = Label.createLabelByName(meetingSeriesId, labelName);
if (null === label) {
label = new Label({name: labelName});
label.save(meetingSeriesId);
}
if (!this.hasLabelWithId(label.getId())) {
this._topicDoc.labels.push(label.getId());
}
}
hasLabelWithId(labelId) {
let i;
for (i = 0; i < this._topicDoc.labels.length; i++) {
if (this._topicDoc.labels[i] === labelId) {
return true;
}
}
return false;
}
getLabelsString(topic) {
let labels = topic.labels;
let labelsString = "";
let aMinute = new Minutes(topic.createdInMinute);
let aSeries = aMinute.parentMeetingSeries();
labels = labels.map(labelId => {
return Label.createLabelById(aSeries._id, labelId);
})
for (let i in labels) {
labelsString += "#" + labels[i]._labelDoc.name+ ", ";
}
labelsString = labelsString.slice(0, -2); // remove last ", "
return labelsString;
}
getLabelsRawArray() {
if (!this._topicDoc.labels) {
return [];
}
return this._topicDoc.labels;
}
>>>>>>>
getLabels(meetingSeriesId) {
return this.getLabelsRawArray().map(labelId => {
return Label.createLabelById(meetingSeriesId, labelId);
})
}
addLabelByName(labelName, meetingSeriesId) {
let label = Label.createLabelByName(meetingSeriesId, labelName);
if (null === label) {
label = new Label({name: labelName});
label.save(meetingSeriesId);
}
if (!this.hasLabelWithId(label.getId())) {
this._topicDoc.labels.push(label.getId());
}
}
hasLabelWithId(labelId) {
let i;
for (i = 0; i < this._topicDoc.labels.length; i++) {
if (this._topicDoc.labels[i] === labelId) {
return true;
}
}
return false;
}
getLabelsString(topic) {
let labels = topic.labels;
let labelsString = "";
let aMinute = new Minutes(topic.createdInMinute);
let aSeries = aMinute.parentMeetingSeries();
labels = labels.map(labelId => {
return Label.createLabelById(aSeries._id, labelId);
})
for (let i in labels) {
labelsString += "#" + labels[i]._labelDoc.name+ ", ";
}
labelsString = labelsString.slice(0, -2); // remove last ", "
return labelsString;
}
getLabelsRawArray() {
if (!this._topicDoc.labels) {
return [];
}
return this._topicDoc.labels;
}
/**
* Checks whether this topic has associated responsibles
* or not. This method must have the same name as the
* actionItem.hasResponsibles method.
*
* @return {boolean}
*/ |
<<<<<<<
const { setMapSettings } = this.props;
=======
const { setMapSettings, defaultPlanetBasemap } = this.props;
if (value === 'planet') {
triggerEvent(TOGGLE_PLANET_BASEMAP);
}
>>>>>>>
const { setMapSettings } = this.props;
if (value === 'planet') {
triggerEvent(TOGGLE_PLANET_BASEMAP);
} |
<<<<<<<
=======
import LatestProvider from 'providers/latest-provider';
import MyGFW from 'providers/mygfw-provider';
>>>>>>>
import MyGFW from 'providers/mygfw-provider';
<<<<<<<
=======
<LatestProvider />
<MyGFW />
>>>>>>>
<MyGFW /> |
<<<<<<<
import WdigetDynamicSentence from 'pages/country/widget/components/widget-dynamic-sentence';
=======
import WidgetDynamicSentence from 'pages/country/widget/components/widget-dynamic-sentence';
import './widget-tree-gain-styles.scss';
>>>>>>>
import WidgetDynamicSentence from 'pages/country/widget/components/widget-dynamic-sentence';
<<<<<<<
<WdigetDynamicSentence sentence={getSentence()} />
=======
<div className="info">
<p className="title">Hansen - UMD</p>
<WidgetDynamicSentence sentence={getSentence()} />
</div>
>>>>>>>
<WidgetDynamicSentence sentence={getSentence()} /> |
<<<<<<<
import { Minutes } from '../minutes';
import { MeetingSeries } from '../meetingseries';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { TopicSchema } from './topics_private.js';
=======
import { Minutes } from '../minutes'
import { MeetingSeries } from '../meetingseries'
import { UserRoles } from "./../userroles"
>>>>>>>
import { Minutes } from '../minutes'
import { MeetingSeries } from '../meetingseries'
import { UserRoles } from "./../userroles"
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { TopicSchema } from './topics_private.js'; |
<<<<<<<
=======
indicatorChange = value => {
this.props.onIndicatorChange(value.value);
};
canopyChange = value => {
this.props.onCanopyChange(value.value);
};
startYearChange = value => {
this.props.onStartYearChange(value.value);
};
endYearChange = value => {
this.props.onEndYearChange(value.value);
};
iconRenderer = () => (
<svg className="icon icon-angle-arrow-down">
<use xlinkHref="#icon-angle-arrow-down">{}</use>
</svg>
);
>>>>>>>
<<<<<<<
const {
locations,
units,
canopies,
settings,
yearsLoss,
onUnitChange,
onEndYearChange,
onCanopyChange,
onStartYearChange,
onLocationChange
} = this.props;
=======
const { indicators, canopies, settings, yearsLoss } = this.props;
>>>>>>>
const {
indicators,
canopies,
settings,
yearsLoss,
onEndYearChange,
onCanopyChange,
onStartYearChange,
onIndicatorChange
} = this.props;
<<<<<<<
<div className="body">
<Dropdown
theme="theme-select-light"
label="LOCATION"
value={settings.location}
options={locations}
onChange={onLocationChange}
/>
<Dropdown
theme="theme-select-light"
label="UNIT"
value={settings.unit}
options={units}
onChange={onUnitChange}
=======
<div className="c-widget-settings__select">
<div className="c-widget-settings__title">LOCATION</div>
<Select
iconRenderer={this.iconRenderer}
value={settings.indicator}
options={indicators}
onChange={this.indicatorChange}
>>>>>>>
<div className="body">
<Dropdown
theme="theme-select-light"
label="LOCATION"
value={settings.indicator}
options={indicators}
onChange={onIndicatorChange} |
<<<<<<<
this.setNumbersOfLayers();
},
setNumbersOfLayers: function(){
var layersByCategory = _.groupBy(this.layers, function(layer){ return layer.category_slug; });
this.$categoriesNum.text('');
_.each(layersByCategory, _.bind(function(v,k){
$('#'+k+'-category-num').text(v.length);
},this));
=======
this.checkUMD();
>>>>>>>
this.checkUMD();
this.setNumbersOfLayers();
},
setNumbersOfLayers: function(){
var layersByCategory = _.groupBy(this.layers, function(layer){ return layer.category_slug; });
this.$categoriesNum.text('');
_.each(layersByCategory, _.bind(function(v,k){
$('#'+k+'-category-num').text(v.length);
},this));
<<<<<<<
_toggleLayersNav: function(e){
$(e.currentTarget).toggleClass('show');
$(e.currentTarget).parent().children('.layers-nav').toggleClass('show');
},
/**
* Set and update iso
*/
=======
toggleUmd: function(e){
_.each(this.$UMDlayers, _.bind(function(layer){
if (this.$toggleUMD.find('.onoffradio').hasClass('checked')) {
if ($(layer).hasClass('selected')) {
$(layer).trigger('click');
}
}else{
if (!$(layer).hasClass('selected')) {
$(layer).trigger('click');
}
}
}, this));
},
checkUMD: function(){
var count = 0;
_.each(this.$UMDlayers, _.bind(function(layer){
if ($(layer).hasClass('selected')) {
count ++;
}
}, this));
(count == 2) ? this.$toggleUMD.find('.onoffradio').addClass('checked') : this.$toggleUMD.find('.onoffradio').removeClass('checked');
},
>>>>>>>
_toggleLayersNav: function(e){
$(e.currentTarget).toggleClass('show');
$(e.currentTarget).parent().children('.layers-nav').toggleClass('show');
},
toggleUmd: function(e){
_.each(this.$UMDlayers, _.bind(function(layer){
if (this.$toggleUMD.find('.onoffradio').hasClass('checked')) {
if ($(layer).hasClass('selected')) {
$(layer).trigger('click');
}
}else{
if (!$(layer).hasClass('selected')) {
$(layer).trigger('click');
}
}
}, this));
},
checkUMD: function(){
var count = 0;
_.each(this.$UMDlayers, _.bind(function(layer){
if ($(layer).hasClass('selected')) {
count ++;
}
}, this));
(count == 2) ? this.$toggleUMD.find('.onoffradio').addClass('checked') : this.$toggleUMD.find('.onoffradio').removeClass('checked');
},
/**
* Set and update iso
*/ |
<<<<<<<
import * as woodyBiomass from './widgets/climate/whrc-biomass/';
=======
import * as futureCarbonGains from './widgets/climate/future-carbon-gains';
>>>>>>>
import * as woodyBiomass from './widgets/climate/whrc-biomass/';
import * as futureCarbonGains from './widgets/climate/future-carbon-gains';
<<<<<<<
woodyBiomass,
=======
futureCarbonGains,
>>>>>>>
woodyBiomass,
futureCarbonGains, |
<<<<<<<
if (download) {
return { name: 'treecover_loss', url: url.replace('query', 'download') };
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return { name: 'treecover_loss', url: url.replace('query', 'download') };
}
return axios.get(url).then(response => ({
<<<<<<<
export const getLossGrouped = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl(adm0, adm1, adm2, true)}${
=======
export const getLossGrouped = ({ adm0, adm1, adm2, ...params }) => {
const url = `${getRequestUrl({ adm0, adm1, adm2, grouped: true })}${
>>>>>>>
export const getLossGrouped = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl({ adm0, adm1, adm2, grouped: true })}${
<<<<<<<
if (download) {
return {
name: 'treecover_loss__grouped',
url: url.replace('query', 'download')
};
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return {
name: 'treecover_loss__grouped',
url: url.replace('query', 'download')
};
}
return axios.get(url).then(response => ({
<<<<<<<
export const getExtent = ({
adm0,
adm1,
adm2,
extentYear,
download,
...params
}) => {
const url = `${getRequestUrl(adm0, adm1, adm2, false, true)}${
=======
export const getExtent = ({ adm0, adm1, adm2, extentYear, ...params }) => {
const url = `${getRequestUrl({ adm0, adm1, adm2, summary: true })}${
>>>>>>>
export const getExtent = ({
adm0,
adm1,
adm2,
extentYear,
download,
...params
}) => {
const url = `${getRequestUrl({ adm0, adm1, adm2, summary: true })}${
<<<<<<<
if (download) {
return { name: 'area__ha', url: url.replace('query', 'download') };
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return { name: 'area__ha', url: url.replace('query', 'download') };
}
return axios.get(url).then(response => ({
<<<<<<<
if (download) {
return {
name: `treecover_extent_${extentYear}__ha`,
url: url.replace('query', 'download')
};
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return {
name: `treecover_extent_${extentYear}__ha`,
url: url.replace('query', 'download')
};
}
return axios.get(url).then(response => ({
<<<<<<<
export const getGain = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl(adm0, adm1, adm2, false, true)}${
SQL_QUERIES.gain
}`.replace('{WHERE}', getWHEREQuery({ iso: adm0, adm1, adm2, ...params }));
if (download) {
return {
name: 'treecover_gain_2000-2012__ha',
url: url.replace('query', 'download')
};
}
return request.get(url).then(response => ({
=======
export const getGain = ({ adm0, adm1, adm2, ...params }) => {
const url = `${getRequestUrl({
adm0,
adm1,
adm2,
grouped: false,
summary: true
})}${SQL_QUERIES.gain}`.replace(
'{WHERE}',
getWHEREQuery({ iso: adm0, adm1, adm2, ...params })
);
return axios.get(url).then(response => ({
>>>>>>>
export const getGain = ({ adm0, adm1, adm2, download, ...params }) => {
const url = `${getRequestUrl({
adm0,
adm1,
adm2,
grouped: false,
summary: true
})}${SQL_QUERIES.gain}`.replace(
'{WHERE}',
getWHEREQuery({ iso: adm0, adm1, adm2, ...params })
);
if (download) {
return {
name: 'treecover_gain_2000-2012__ha',
url: url.replace('query', 'download')
};
}
return axios.get(url).then(response => ({
<<<<<<<
if (download) {
return {
name: 'area_intersection__ha',
url: url.replace('query', 'download')
};
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return {
name: 'area_intersection__ha',
url: url.replace('query', 'download')
};
}
return axios.get(url).then(response => ({
<<<<<<<
if (download) {
return {
name: 'area_intersection__grouped',
url: url.replace('query', 'download')
};
}
return request.get(url).then(response => ({
=======
return axios.get(url).then(response => ({
>>>>>>>
if (download) {
return {
name: 'area_intersection__grouped',
url: url.replace('query', 'download')
};
}
return axios.get(url).then(response => ({ |
<<<<<<<
if (alerts && alerts.data && latest && latest.data) {
const alertsData = alerts.data.data;
const latestData = latest.data.data;
const latestDate =
latestData &&
latestData.attributes &&
latestData.attributes.updatedAt;
=======
if (alerts && alerts.data && latest) {
>>>>>>>
if (alerts && alerts.data && latest) {
const latestDate =
latest && latest.attributes && latest.attributes.updatedAt;
<<<<<<<
alerts: alertsData,
latest: latestDate,
settings: { latestDate }
=======
alerts: alerts.data.data,
latest: latest && latest.attributes && latest.attributes.updatedAt
>>>>>>>
alerts: alerts.data.data,
latest: latestDate,
settings: { latestDate } |
<<<<<<<
export const getData = ({ params }) => {
const fetchFunc =
!params.type || params.type === 'global'
? fetchExtentRanked(params)
: getLocations(params);
return fetchFunc.then(response => {
=======
export default ({ params }) =>
getExtentGrouped(params).then(response => {
>>>>>>>
export const getData = ({ params }) =>
getExtentGrouped(params).then(response => {
<<<<<<<
});
};
export const getDataURL = params => [
getLocations({ ...params, download: true }),
fetchExtentRanked({ ...params, download: true })
];
export default getData;
=======
});
>>>>>>>
});
export const getDataURL = params => [
getExtentGrouped({ ...params, download: true })
];
export default getData; |
<<<<<<<
'text!map/templates/tabs/countriesButtons.handlebars'
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplMobile, tplIso, tplButtons) {
=======
'text!map/templates/tabs/countriesButtons.handlebars',
'text!map/templates/layersNavByCountryWrapper.handlebars'
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplIso, tplButtons, tplCountryWrapper) {
>>>>>>>
'text!map/templates/tabs/countriesButtons.handlebars',
'text!map/templates/layersNavByCountryWrapper.handlebars',
'text!map/templates/tabs/countries-mobile.handlebars'
], function(_, Handlebars, amplify, chosen, Presenter, tpl, tplIso, tplButtons, tplCountryWrapper, tplMobile) {
<<<<<<<
templateMobile: Handlebars.compile(tplMobile),
=======
templateCountryWrapper: Handlebars.compile(tplCountryWrapper),
>>>>>>>
templateCountryWrapper: Handlebars.compile(tplCountryWrapper),
templateMobile: Handlebars.compile(tplMobile), |
<<<<<<<
import { AttachmentsCollection } from './attachments_private';
import { FinalizeMailHandler } from '../mail/FinalizeMailHandler';
import { GlobalSettings } from '../config/GlobalSettings';
=======
import { AttachmentsCollection, calculateAndCreateStoragePath} from './attachments_private';
>>>>>>>
import { AttachmentsCollection } from './attachments_private'; |
<<<<<<<
import { getExtent } from 'services/analysis-cached';
import axios from 'axios';
=======
import { getExtent } from 'services/forest-data-old';
import { all, spread } from 'axios';
>>>>>>>
import { getExtent } from 'services/analysis-cached';
import { all, spread } from 'axios'; |
<<<<<<<
controller: 'dashboards',
path: '/dashboards/:type?/:country?/:region?/:subRegion?',
=======
path: '/dashboards/:type?/:adm0?/:adm1?/:adm2?',
>>>>>>>
path: '/dashboards/:type?/:adm0?/:adm1?/:adm2?',
<<<<<<<
[DASHBOARDS_EMBED]: {
controller: 'dashboards',
path: '/embed/dashboards/:type?/:country?/:region?/:subRegion?',
component: 'dashboards/embed',
embed: true
=======
[WIDGET_EMBED]: {
path: '/embed/dashboards/:type?/:adm0?/:adm1?/:adm2?',
component: 'dashboards/embed'
>>>>>>>
[DASHBOARDS_EMBED]: {
path: '/embed/dashboards/:type?/:adm0?/:adm1?/:adm2?',
component: 'dashboards/embed' |
<<<<<<<
getCountries();
if (location.country) {
getRegions(location.country);
getGeostore(location.country, location.region, location.subRegion);
}
if (location.region) {
getSubRegions(location.country, location.region);
}
getCountryLinks();
}
componentWillReceiveProps(nextProps) {
const { country, region, subRegion } = nextProps.location;
const { getRegions, getSubRegions, getGeostore, setGeostore } = this.props;
const hasCountryChanged =
country !== this.props.location.country && country;
=======
const hasCountryChanged = country !== this.props.location.country;
>>>>>>>
const hasCountryChanged =
country !== this.props.location.country && country;
<<<<<<<
if (!country && country !== this.props.location.country) {
setGeostore({});
}
=======
if (isParentLoading !== this.props.isParentLoading) {
getCountries();
getRegions(country);
if (region) {
getSubRegions(country, region);
}
getGeostore(country, region, subRegion);
getCountryLinks();
}
>>>>>>>
if (isParentLoading !== this.props.isParentLoading) {
getCountries();
if (country) {
getRegions(country);
getGeostore(country, region, subRegion);
}
if (region) {
getSubRegions(country, region);
}
getCountryLinks();
}
if (!country && country !== this.props.location.country) {
setGeostore({});
} |
<<<<<<<
init() {
window.App = {
Views: {}
};
const router = new Router(this);
=======
init: function() {
var router = new Router(this);
>>>>>>>
init: function() {
window.App = {
Views: {}
};
var router = new Router(this);
<<<<<<<
google.maps.Polygon.prototype.getBounds = function() {
const bounds = new google.maps.LatLngBounds();
const paths = this.getPaths();
let path;
for (let i = 0; i < paths.getLength(); i++) {
=======
google.maps.Polygon.prototype.getBounds = function () {
var bounds = new google.maps.LatLngBounds();
var paths = this.getPaths();
var path;
for (var i = 0; i < paths.getLength(); i++) {
>>>>>>>
google.maps.Polygon.prototype.getBounds = function () {
var bounds = new google.maps.LatLngBounds();
var paths = this.getPaths();
var path;
for (var i = 0; i < paths.getLength(); i++) { |
<<<<<<<
const defaultLayer =
(layer &&
layer.find(l => l.applicationConfig && l.applicationConfig.default)) ||
layer[0];
=======
const { isSelectorLayer, isMultiSelectorLayer } = info || {};
>>>>>>>
const defaultLayer =
(layer &&
layer.find(l => l.applicationConfig && l.applicationConfig.default)) ||
layer[0];
const { isSelectorLayer, isMultiSelectorLayer } = info || {};
<<<<<<<
...(info &&
info.isSelectorLayer && {
selectorLayerConfig: {
options: layer.map(l => l.applicationConfig.selectorConfig)
}
}),
metadata:
defaultLayer &&
defaultLayer.applicationConfig &&
defaultLayer.applicationConfig.metadata,
=======
...((isSelectorLayer || isMultiSelectorLayer) && {
selectorLayerConfig: {
options: layer.map(l => ({
...l.applicationConfig.selectorConfig,
value: l.id
}))
}
}),
>>>>>>>
...((isSelectorLayer || isMultiSelectorLayer) && {
selectorLayerConfig: {
options: layer.map(l => ({
...l.applicationConfig.selectorConfig,
value: l.id
}))
}
}),
metadata:
defaultLayer &&
defaultLayer.applicationConfig &&
defaultLayer.applicationConfig.metadata, |
<<<<<<<
import Widgets from 'components/widgets';
=======
import Meta from 'components/meta';
import Widgets from 'components/widgets-v2';
>>>>>>>
import Widgets from 'components/widgets';
import Widgets from 'components/widgets-v2';
<<<<<<<
<CountryDataProvider />
<WhitelistsProvider />
<LayerSpecProvider />
<DatasetsProvider />
<GeostoreProvider />
=======
{/* <CountryDataProvider location={payload} /> */}
{/* <WhitelistsProvider /> */}
{/* <LayerSpecProvider /> */}
{/* <DatasetsProvider /> */}
{/* <GeostoreProvider /> */}
<Meta
title={title}
description="Data about forest change, tenure, forest related employment and land use in"
/>
>>>>>>>
{/* <CountryDataProvider location={payload} /> */}
{/* <WhitelistsProvider /> */}
{/* <LayerSpecProvider /> */}
{/* <DatasetsProvider /> */}
{/* <GeostoreProvider /> */} |
<<<<<<<
'text!map/templates/legend/urthecast.handlebars',
'text!map/templates/legend/mex_forest_cat.handlebars',
'text!map/templates/legend/mex_forest_subcat.handlebars',
'text!map/templates/legend/pa.handlebars',
'text!map/templates/legend/places2watch.handlebars',
'text!map/templates/legend/mex_landrights.handlebars',
'text!map/templates/legend/mexPA.handlebars',
'text!map/templates/legend/perPA.handlebars',
'text!map/templates/legend/mex_land_cover.handlebars',
], function(_, Handlebars, Presenter, tpl, tplMore, lossTpl, imazonTpl, firesTpl,
forest2000Tpl, pantropicalTpl, idnPrimaryTpl, intact2013Tpl, grumpTpl, storiesTpl, terra_iTpl, concesionesTpl,
concesionesTypeTpl, hondurasForestTPL,colombiaForestChangeTPL, tigersTPL, dam_hotspotsTPL, us_land_coverTPL,
global_land_coverTPL, formaTPL,bra_biomesTPL, gfwPlantationByTypeTpl, gfwPlantationBySpeciesTpl, oil_palmTpl,
gtm_forest_changeTpl,gtm_forest_coverTpl,gtm_forest_densityTpl,khm_eco_land_concTpl,usa_forest_ownershipTpl,guyra_deforestationTpl,logging_roadsTpl,
rus_hrvTpl, raisg_land_rightsTpl, mysPATpl, idn_peatTpl, mys_peatTpl,raisg_miningTpl, per_miningTpl, gladTpl, urtheTpl,mex_forest_catTpl,mex_forest_subcatTpl, paTpl, places2watchTPL, mex_landrightsTpl, mexPATpl, perPATpl,mex_land_coverTpl) {
=======
'text!map/templates/legend/urthecast.handlebars',
'text!map/templates/legend/mex_forest_cat.handlebars',
'text!map/templates/legend/mex_forest_subcat.handlebars',
'text!map/templates/legend/pa.handlebars',
'text!map/templates/legend/places2watch.handlebars',
'text!map/templates/legend/mex_landrights.handlebars',
'text!map/templates/legend/mexPA.handlebars',
'text!map/templates/legend/perPA.handlebars',
'text!map/templates/legend/mex_land_cover.handlebars',
'text!map/templates/legend/mex_forest_conserv.handlebars',
'text!map/templates/legend/mex_forest_prod.handlebars',
'text!map/templates/legend/mex_forest_rest.handlebars',
], function(_, Handlebars, Presenter, tpl, lossTpl, imazonTpl, firesTpl,
forest2000Tpl, pantropicalTpl, idnPrimaryTpl, intact2013Tpl, grumpTpl, storiesTpl, terra_iTpl, concesionesTpl,
concesionesTypeTpl, hondurasForestTPL,colombiaForestChangeTPL, tigersTPL, dam_hotspotsTPL, us_land_coverTPL,
global_land_coverTPL, formaTPL,bra_biomesTPL, gfwPlantationByTypeTpl, gfwPlantationBySpeciesTpl, oil_palmTpl,
gtm_forest_changeTpl,gtm_forest_coverTpl,gtm_forest_densityTpl,khm_eco_land_concTpl,usa_forest_ownershipTpl,guyra_deforestationTpl,logging_roadsTpl,
rus_hrvTpl, raisg_land_rightsTpl, mysPATpl, idn_peatTpl, mys_peatTpl,raisg_miningTpl, per_miningTpl, gladTpl, urtheTpl,mex_forest_catTpl,mex_forest_subcatTpl, paTpl, places2watchTPL, mex_landrightsTpl, mexPATpl, perPATpl,mex_land_coverTpl,mex_forest_conservTPL,mex_forest_prodTPL,mex_forest_restTPL) {
>>>>>>>
'text!map/templates/legend/urthecast.handlebars',
'text!map/templates/legend/mex_forest_cat.handlebars',
'text!map/templates/legend/mex_forest_subcat.handlebars',
'text!map/templates/legend/pa.handlebars',
'text!map/templates/legend/places2watch.handlebars',
'text!map/templates/legend/mex_landrights.handlebars',
'text!map/templates/legend/mexPA.handlebars',
'text!map/templates/legend/perPA.handlebars',
'text!map/templates/legend/mex_land_cover.handlebars',
'text!map/templates/legend/mex_forest_conserv.handlebars',
'text!map/templates/legend/mex_forest_prod.handlebars',
'text!map/templates/legend/mex_forest_rest.handlebars',
], function(_, Handlebars, Presenter, tpl, tplMore, lossTpl, imazonTpl, firesTpl,
forest2000Tpl, pantropicalTpl, idnPrimaryTpl, intact2013Tpl, grumpTpl, storiesTpl, terra_iTpl, concesionesTpl,
concesionesTypeTpl, hondurasForestTPL,colombiaForestChangeTPL, tigersTPL, dam_hotspotsTPL, us_land_coverTPL,
global_land_coverTPL, formaTPL,bra_biomesTPL, gfwPlantationByTypeTpl, gfwPlantationBySpeciesTpl, oil_palmTpl,
gtm_forest_changeTpl,gtm_forest_coverTpl,gtm_forest_densityTpl,khm_eco_land_concTpl,usa_forest_ownershipTpl,guyra_deforestationTpl,logging_roadsTpl,
rus_hrvTpl, raisg_land_rightsTpl, mysPATpl, idn_peatTpl, mys_peatTpl,raisg_miningTpl, per_miningTpl, gladTpl, urtheTpl,mex_forest_catTpl,mex_forest_subcatTpl, paTpl, places2watchTPL, mex_landrightsTpl, mexPATpl, perPATpl,mex_land_coverTpl,mex_forest_conservTPL,mex_forest_prodTPL,mex_forest_restTPL) {
<<<<<<<
umd_as_it_happens_per:Handlebars.compile(gladTpl),
umd_as_it_happens_cog:Handlebars.compile(gladTpl),
umd_as_it_happens_idn:Handlebars.compile(gladTpl),
viirs_fires_alerts: Handlebars.compile(firesTpl),
mex_forest_zoning_cat: Handlebars.compile(mex_forest_catTpl),
mex_forest_zoning_subcat: Handlebars.compile(mex_forest_subcatTpl),
urthe: Handlebars.compile(urtheTpl),
protected_areasCDB:Handlebars.compile(paTpl),
places_to_watch:Handlebars.compile(places2watchTPL),
mex_land_rights:Handlebars.compile(mex_landrightsTpl),
mexican_pa:Handlebars.compile(mexPATpl),
per_protected_areas:Handlebars.compile(perPATpl),
mex_land_cover:Handlebars.compile(mex_land_coverTpl)
=======
umd_as_it_happens_per:Handlebars.compile(gladTpl),
umd_as_it_happens_cog:Handlebars.compile(gladTpl),
umd_as_it_happens_idn:Handlebars.compile(gladTpl),
viirs_fires_alerts: Handlebars.compile(firesTpl),
mex_forest_zoning_cat: Handlebars.compile(mex_forest_catTpl),
mex_forest_zoning_subcat: Handlebars.compile(mex_forest_subcatTpl),
mex_forest_zoning_conserv:Handlebars.compile(mex_forest_conservTPL),
mex_forest_zoning_prod:Handlebars.compile(mex_forest_prodTPL),
mex_forest_zoning_rest:Handlebars.compile(mex_forest_restTPL),
urthe: Handlebars.compile(urtheTpl),
protected_areasCDB:Handlebars.compile(paTpl),
places_to_watch:Handlebars.compile(places2watchTPL),
mex_land_rights:Handlebars.compile(mex_landrightsTpl),
mexican_pa:Handlebars.compile(mexPATpl),
per_protected_areas:Handlebars.compile(perPATpl),
mex_land_cover:Handlebars.compile(mex_land_coverTpl)
>>>>>>>
umd_as_it_happens_per:Handlebars.compile(gladTpl),
umd_as_it_happens_cog:Handlebars.compile(gladTpl),
umd_as_it_happens_idn:Handlebars.compile(gladTpl),
viirs_fires_alerts: Handlebars.compile(firesTpl),
mex_forest_zoning_cat: Handlebars.compile(mex_forest_catTpl),
mex_forest_zoning_subcat: Handlebars.compile(mex_forest_subcatTpl),
mex_forest_zoning_conserv:Handlebars.compile(mex_forest_conservTPL),
mex_forest_zoning_prod:Handlebars.compile(mex_forest_prodTPL),
mex_forest_zoning_rest:Handlebars.compile(mex_forest_restTPL),
urthe: Handlebars.compile(urtheTpl),
protected_areasCDB:Handlebars.compile(paTpl),
places_to_watch:Handlebars.compile(places2watchTPL),
mex_land_rights:Handlebars.compile(mex_landrightsTpl),
mexican_pa:Handlebars.compile(mexPATpl),
per_protected_areas:Handlebars.compile(perPATpl),
mex_land_cover:Handlebars.compile(mex_land_coverTpl)
<<<<<<<
// Render
this.render(this.template({
categories: (_.isEmpty(categoriesGlobal)) ? false : categoriesGlobal,
categoriesIso: (_.isEmpty(categoriesIso)) ? false : categoriesIso,
layersLength: layers.length,
country: (!!iso) ? _.findWhere(this.countries.toJSON(), { iso: iso.country }) : null,
more: more
}));
this.presenter.toggleLayerOptions();
=======
// Render
this.render(this.template({
categories: (_.isEmpty(categoriesGlobal)) ? false : categoriesGlobal,
categoriesIso: (_.isEmpty(categoriesIso)) ? false : categoriesIso,
layersLength: layers.length,
country: (!!iso) ? _.findWhere(this.countries, { iso: iso.country }) : null,
more: more,
countryVisibility: (!!more || !_.isEmpty(categoriesIso))
}));
this.presenter.toggleLayerOptions();
>>>>>>>
// Render
this.render(this.template({
categories: (_.isEmpty(categoriesGlobal)) ? false : categoriesGlobal,
categoriesIso: (_.isEmpty(categoriesIso)) ? false : categoriesIso,
layersLength: layers.length,
country: (!!iso) ? _.findWhere(this.countries, { iso: iso.country }) : null,
more: more,
countryVisibility: (!!more || !_.isEmpty(categoriesIso))
}));
this.presenter.toggleLayerOptions(); |
<<<<<<<
import { shouldQueryPrecomputedTables } from 'components/widgets/utils/helpers';
=======
import {
POLITICAL_BOUNDARIES_DATASET,
FOREST_EXTENT_DATASET
} from 'data/layers-datasets';
import {
DISPUTED_POLITICAL_BOUNDARIES,
POLITICAL_BOUNDARIES,
FOREST_EXTENT
} from 'data/layers';
>>>>>>>
import { shouldQueryPrecomputedTables } from 'components/widgets/utils/helpers';
import {
POLITICAL_BOUNDARIES_DATASET,
FOREST_EXTENT_DATASET
} from 'data/layers-datasets';
import {
DISPUTED_POLITICAL_BOUNDARIES,
POLITICAL_BOUNDARIES,
FOREST_EXTENT
} from 'data/layers'; |
<<<<<<<
'map/views/layers/MexicoPaymentsLayer',
'map/views/layers/MexLandRightsLayer',
'map/views/layers/BraLoggingLayer',
=======
'map/views/layers/MysWoodFiberSabahLayer',
'map/views/layers/MysLoggingSabahLayer',
'map/views/layers/MysPASabahLayer',
>>>>>>>
'map/views/layers/MexicoPaymentsLayer',
'map/views/layers/MexLandRightsLayer',
'map/views/layers/BraLoggingLayer',
'map/views/layers/MysWoodFiberSabahLayer',
'map/views/layers/MysLoggingSabahLayer',
'map/views/layers/MysPASabahLayer',
<<<<<<<
MexicoPaymentsLayer,
MexLandRightsLayer,
BraLoggingLayer,
=======
MysWoodFiberSabahLayer,
MysLoggingSabahLayer,
MysPASabahLayer,
>>>>>>>
MexicoPaymentsLayer,
MexLandRightsLayer,
BraLoggingLayer,
MysWoodFiberSabahLayer,
MysLoggingSabahLayer,
MysPASabahLayer,
<<<<<<<
mexican_psa: {
view: MexicoPaymentsLayer
},
mex_land_rights: {
view: MexLandRightsLayer
},
bra_logging: {
view: BraLoggingLayer
},
=======
mys_wood_fiber_sabah: {
view: MysWoodFiberSabahLayer
},
mys_proteced_areas_sabah: {
view: MysPASabahLayer
},
mys_logging_sabah: {
view: MysLoggingSabahLayer
},
>>>>>>>
mexican_psa: {
view: MexicoPaymentsLayer
},
mex_land_rights: {
view: MexLandRightsLayer
},
bra_logging: {
view: BraLoggingLayer
},
mys_wood_fiber_sabah: {
view: MysWoodFiberSabahLayer
},
mys_proteced_areas_sabah: {
view: MysPASabahLayer
},
mys_logging_sabah: {
view: MysLoggingSabahLayer
}, |
<<<<<<<
/**
* Created by felix on 12.05.16.
*/
import { Minutes } from '/imports/minutes'
import { Topic } from '/imports/topic'
import { InfoItem } from '/imports/infoitem'
import { ActionItem } from '/imports/actionitem'
import { Label } from '/imports/label'
=======
import { Minutes } from '/imports/minutes';
import { Topic } from '/imports/topic';
import { InfoItem } from '/imports/infoitem';
import { ActionItem } from '/imports/actionitem';
import { $ } from 'meteor/jquery';
import submitOnEnter from '../../helpers/submitOnEnter';
>>>>>>>
import { Minutes } from '/imports/minutes'
import { Topic } from '/imports/topic'
import { InfoItem } from '/imports/infoitem'
import { ActionItem } from '/imports/actionitem'
import { Label } from '/imports/label'
import { $ } from 'meteor/jquery';
import submitOnEnter from '../../helpers/submitOnEnter'; |
<<<<<<<
import firesAlertsHistorical from 'components/widgets/forest-change/fires-alerts-historical';
=======
import firesAlertsCumulative from 'components/widgets/forest-change/fires-alerts-cumulative';
>>>>>>>
import firesAlertsHistorical from 'components/widgets/forest-change/fires-alerts-historical';
import firesAlertsCumulative from 'components/widgets/forest-change/fires-alerts-cumulative';
<<<<<<<
firesAlertsHistorical,
=======
firesAlertsCumulative,
>>>>>>>
firesAlertsHistorical,
firesAlertsCumulative, |
<<<<<<<
this.commonIsoChanges();
this.presenter.changeIso({country: this.iso, region: null});
},
changeIsoMobile: function(e){
this.iso = $(e.currentTarget).data('value') || null;
this.commonIsoChanges();
=======
this.setIsoLayers();
this.setButtons(!!this.iso);
>>>>>>>
this.commonIsoChanges();
this.presenter.changeIso({country: this.iso, region: null});
},
changeIsoMobile: function(e){
this.iso = $(e.currentTarget).data('value') || null;
this.commonIsoChanges();
<<<<<<<
if (this.mobile) {
var country = _.find(amplify.store('countries'), _.bind(function(country){
return country.iso === this.iso;
}, this ));
var name = (country) ? country.name + ' Data' : 'Country Data';
this.$countryName.text(name);
if(!!this.iso) {
this.$countryReset.show(0);
this.$countryUl.addClass('hidden');
}else{
this.$countryReset.hide(0);
this.$countryUl.removeClass('hidden');
}
};
=======
this.$countrySelect.val(this.iso).trigger("liszt:updated");
// this.$regionSelect.val(this.area).trigger("liszt:updated");
if (this.iso) {
this.getAdditionalInfoCountry();
}
},
getAdditionalInfoCountry: function(){
if (!amplify.store('country-'+this.iso)) {
$.ajax({
url: window.gfw.config.GFW_API_HOST + '/countries/'+this.iso,
dataType: 'json',
success: _.bind(function(data){
amplify.store('country-'+this.iso, data);
this.setAdditionalInfoCountry();
}, this ),
error: function(error){
console.log(error);
}
});
}else{
this.setAdditionalInfoCountry()
}
// #{ENV['GFW_API_HOST']}/countries/#{iso}
},
setAdditionalInfoCountry: function(){
var country = amplify.store('country-'+this.iso);
this.setButtons(!!this.iso, country);
>>>>>>>
if (this.mobile) {
var country = _.find(amplify.store('countries'), _.bind(function(country){
return country.iso === this.iso;
}, this ));
var name = (country) ? country.name + ' Data' : 'Country Data';
this.$countryName.text(name);
if(!!this.iso) {
this.$countryReset.show(0);
this.$countryUl.addClass('hidden');
}else{
this.$countryReset.hide(0);
this.$countryUl.removeClass('hidden');
}
};
this.$countrySelect.val(this.iso).trigger("liszt:updated");
// this.$regionSelect.val(this.area).trigger("liszt:updated");
if (this.iso) {
this.getAdditionalInfoCountry();
}
},
getAdditionalInfoCountry: function(){
if (!amplify.store('country-'+this.iso)) {
$.ajax({
url: window.gfw.config.GFW_API_HOST + '/countries/'+this.iso,
dataType: 'json',
success: _.bind(function(data){
amplify.store('country-'+this.iso, data);
this.setAdditionalInfoCountry();
}, this ),
error: function(error){
console.log(error);
}
});
}else{
this.setAdditionalInfoCountry()
}
},
setAdditionalInfoCountry: function(){
var country = amplify.store('country-'+this.iso);
this.setButtons(!!this.iso, country); |
<<<<<<<
var iso = this.status.get('iso');
if(!!iso && !!iso.country && iso.country !== 'ALL'){
countryService.show(iso.country, _.bind(function(results) {
var is_more = (!!results.indepth);
var is_idn = (!!iso && !!iso.country && iso.country == 'IDN');
if (is_more) {
this.view.renderMore({
name: results.name,
url: results.indepth,
is_idn: is_idn
});
}
},this));
}
=======
return new Promise(function(resolve) {
var iso = this.status.get('iso');
if(!!iso && !!iso.country && iso.country !== 'ALL'){
countryService.execute(iso.country, _.bind(function(results) {
var is_more = (!!results.indepth);
var is_idn = (!!iso && !!iso.country && iso.country == 'IDN');
if (is_more) {
this.status.set('more', {
name: results.name,
url: results.indepth,
is_idn: is_idn
});
} else {
this.status.set('more', null);
}
resolve();
},this));
} else {
resolve();
}
}.bind(this));
>>>>>>>
return new Promise(function(resolve) {
var iso = this.status.get('iso');
if(!!iso && !!iso.country && iso.country !== 'ALL'){
countryService.show(iso.country, _.bind(function(results) {
var is_more = (!!results.indepth);
var is_idn = (!!iso && !!iso.country && iso.country == 'IDN');
if (is_more) {
this.status.set('more', {
name: results.name,
url: results.indepth,
is_idn: is_idn
});
} else {
this.status.set('more', null);
}
resolve();
},this));
} else {
resolve();
}
}.bind(this)); |
<<<<<<<
// drafts_mbox, editor_wait, fwdattach, hash_hdrs, hash_msg,
// hash_msgOrig, hash_sig, hash_sigOrig, is_popup, knl, last_identity,
// onload_show, old_action, old_identity, rte, rte_loaded, sc_submit,
// skip_spellcheck, spellcheck, tasks, uploading
=======
// drafts_mbox, editor_wait, fwdattach, is_popup, knl, md5_hdrs,
// md5_msg, md5_msgOrig, onload_show, old_action, old_identity, rte,
// rte_loaded, sc_submit, skip_spellcheck, spellcheck, tasks, uploading,
// upload_limit
>>>>>>>
// drafts_mbox, editor_wait, fwdattach, hash_hdrs, hash_msg,
// hash_msgOrig, hash_sig, hash_sigOrig, is_popup, knl, last_identity,
// onload_show, old_action, old_identity, rte, rte_loaded, sc_submit,
// skip_spellcheck, spellcheck, tasks, uploading, upload_limit
<<<<<<<
this.hash_hdrs = this.hash_msg = this.hash_msgOrig = this.hash_sig = this.hash_sigOrig = '';
=======
this.md5_hdrs = this.md5_msg = this.md5_msgOrig = '';
this.upload_limit = false;
>>>>>>>
this.hash_hdrs = this.hash_msg = this.hash_msgOrig = this.hash_sig = this.hash_sigOrig = '';
this.upload_limit = false; |
<<<<<<<
}), {
=======
}, {
ajaxopts: { asynchronous: false },
>>>>>>>
}), {
ajaxopts: { asynchronous: false }, |
<<<<<<<
contextOnClick: function(parentfunc, e)
{
var id = e.memo.elt.readAttribute('id'), tmp;
switch (id) {
case 'ctx_msg_other_rr':
tmp = !$F('request_read_receipt');
$('request_read_receipt').setValue(tmp);
DimpCore.toggleCheck($('ctx_msg_other_rr').down('DIV'), tmp);
break;
case 'ctx_msg_other_saveatc':
tmp = !$F('save_attachments_select');
$('save_attachments_select').setValue(tmp);
DimpCore.toggleCheck($('ctx_msg_other_saveatc').down('DIV'), tmp);
break;
default:
parentfunc(e);
break;
}
},
=======
onContactsUpdate: function(e)
{
switch (e.memo.field) {
case 'bcc':
case 'cc':
if (!$('send' + e.memo.field).visible()) {
this.toggleCC(e.memo.field);
}
break;
case 'to':
if (DIMP.conf_compose.redirect) {
e.memo.field = 'redirect_to';
}
break;
}
ImpComposeBase.updateAddressField($(e.memo.field), e.memo.value);
},
>>>>>>>
contextOnClick: function(parentfunc, e)
{
var id = e.memo.elt.readAttribute('id'), tmp;
switch (id) {
case 'ctx_msg_other_rr':
tmp = !$F('request_read_receipt');
$('request_read_receipt').setValue(tmp);
DimpCore.toggleCheck($('ctx_msg_other_rr').down('DIV'), tmp);
break;
case 'ctx_msg_other_saveatc':
tmp = !$F('save_attachments_select');
$('save_attachments_select').setValue(tmp);
DimpCore.toggleCheck($('ctx_msg_other_saveatc').down('DIV'), tmp);
break;
default:
parentfunc(e);
break;
}
},
onContactsUpdate: function(e)
{
switch (e.memo.field) {
case 'bcc':
case 'cc':
if (!$('send' + e.memo.field).visible()) {
this.toggleCC(e.memo.field);
}
break;
case 'to':
if (DIMP.conf_compose.redirect) {
e.memo.field = 'redirect_to';
}
break;
}
ImpComposeBase.updateAddressField($(e.memo.field), e.memo.value);
}, |
<<<<<<<
toggleRemove (e) {
this.setState({ removeSelected: e.target.checked });
},
toggleDisabled (e) {
this.setState({ disabled: e.target.checked });
},
toggleChocolate (e) {
let crazy = e.target.checked;
=======
toggleCheckbox (e) {
>>>>>>>
toggleCheckbox (e) {
<<<<<<<
<h3 className="section-heading">{this.props.label}</h3>
<Select multi simpleValue removeSelected={this.state.removeSelected} disabled={this.state.disabled} value={this.state.value} placeholder="Select your favourite(s)" options={this.state.options} onChange={this.handleSelectChange} />
=======
<h3 className="section-heading">{this.props.label} <a href="https://github.com/JedWatson/react-select/tree/master/examples/src/components/Multiselect.js">(Source)</a></h3>
<Select
closeOnSelect={!stayOpen}
disabled={disabled}
multi
onChange={this.handleSelectChange}
options={options}
placeholder="Select your favourite(s)"
simpleValue
value={value}
/>
>>>>>>>
<h3 className="section-heading">{this.props.label} <a href="https://github.com/JedWatson/react-select/tree/master/examples/src/components/Multiselect.js">(Source)</a></h3>
<Select
closeOnSelect={!stayOpen}
disabled={this.state.disabled}
multi
onChange={this.handleSelectChange}
options={this.state.options}
placeholder="Select your favourite(s)"
removeSelected={this.state.removeSelected}
simpleValue
value={this.state.value}
/>
<<<<<<<
<input type="checkbox" className="checkbox-control" checked={this.state.removeSelected} onChange={this.toggleRemove} />
<span className="checkbox-label">Remove selected options</span>
</label>
<label className="checkbox">
<input type="checkbox" className="checkbox-control" checked={this.state.disabled} onChange={this.toggleDisabled} />
=======
<input type="checkbox" className="checkbox-control" name="disabled" checked={disabled} onChange={this.toggleCheckbox} />
>>>>>>>
<input type="checkbox" className="checkbox-control" checked={this.state.removeSelected} onChange={this.toggleRemove} />
<span className="checkbox-label">Remove selected options</span>
</label>
<label className="checkbox">
<input type="checkbox" className="checkbox-control" checked={this.state.disabled} onChange={this.toggleDisabled} /> |
<<<<<<<
import Select from 'react-select-plus';
=======
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select';
>>>>>>>
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select-plus'; |
<<<<<<<
import Select from 'react-select-plus';
=======
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select';
>>>>>>>
import createClass from 'create-react-class';
import PropTypes from 'prop-types';
import Select from 'react-select-plus'; |
<<<<<<<
import Async from './Async';
import AsyncCreatable from './AsyncCreatable';
import Creatable from './Creatable';
import Dropdown from './Dropdown';
=======
>>>>>>>
import Dropdown from './Dropdown';
<<<<<<<
function clone(obj) {
const copy = {};
for (let attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = obj[attr];
};
}
return copy;
}
function isGroup (option) {
return option && Array.isArray(option.options);
}
function stringifyValue (value) {
const valueType = typeof value;
if (valueType === 'string') {
return value;
} else if (valueType === 'object') {
return JSON.stringify(value);
} else if (valueType === 'number' || valueType === 'boolean') {
return String(value);
} else {
return '';
}
}
=======
const stringifyValue = value =>
typeof value === 'string'
? value
: (value !== null && JSON.stringify(value)) || '';
>>>>>>>
function clone(obj) {
const copy = {};
for (let attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = obj[attr];
};
}
return copy;
}
function isGroup (option) {
return option && Array.isArray(option.options);
}
const stringifyValue = value =>
typeof value === 'string'
? value
: (value !== null && JSON.stringify(value)) || ''; |
<<<<<<<
},{"./Select":"react-select-plus","./utils/stripDiacritics":6,"react":undefined}],2:[function(require,module,exports){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var Dropdown = _react2['default'].createClass({
displayName: 'Dropdown',
propTypes: {
children: _react2['default'].PropTypes.node
},
render: function render() {
// This component adds no markup
return this.props.children;
}
});
module.exports = Dropdown;
},{"react":undefined}],3:[function(require,module,exports){
=======
},{"./Select":"react-select","./utils/stripDiacritics":5,"react":undefined}],3:[function(require,module,exports){
>>>>>>>
},{"./Select":"react-select-plus","./utils/stripDiacritics":7,"react":undefined}],3:[function(require,module,exports){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var Dropdown = _react2['default'].createClass({
displayName: 'Dropdown',
propTypes: {
children: _react2['default'].PropTypes.node
},
render: function render() {
// This component adds no markup
return this.props.children;
}
});
module.exports = Dropdown;
},{"react":undefined}],4:[function(require,module,exports){
<<<<<<<
},{"classnames":undefined,"react":undefined}],4:[function(require,module,exports){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var OptionGroup = _react2['default'].createClass({
displayName: 'OptionGroup',
propTypes: {
children: _react2['default'].PropTypes.any,
className: _react2['default'].PropTypes.string, // className (based on mouse position)
label: _react2['default'].PropTypes.node, // the heading to show above the child options
option: _react2['default'].PropTypes.object.isRequired },
// object that is base for that option group
blockEvent: function blockEvent(event) {
event.preventDefault();
event.stopPropagation();
if (event.target.tagName !== 'A' || !('href' in event.target)) {
return;
}
if (event.target.target) {
window.open(event.target.href, event.target.target);
} else {
window.location.href = event.target.href;
}
},
handleMouseDown: function handleMouseDown(event) {
event.preventDefault();
event.stopPropagation();
},
handleTouchEnd: function handleTouchEnd(event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if (this.dragging) return;
this.handleMouseDown(event);
},
handleTouchMove: function handleTouchMove(event) {
// Set a flag that the view is being dragged
this.dragging = true;
},
handleTouchStart: function handleTouchStart(event) {
// Set a flag that the view is not being dragged
this.dragging = false;
},
render: function render() {
var option = this.props.option;
var className = (0, _classnames2['default'])(this.props.className, option.className);
return option.disabled ? _react2['default'].createElement(
'div',
{ className: className,
onMouseDown: this.blockEvent,
onClick: this.blockEvent },
this.props.children
) : _react2['default'].createElement(
'div',
{ className: className,
style: option.style,
onMouseDown: this.handleMouseDown,
onMouseEnter: this.handleMouseEnter,
onMouseMove: this.handleMouseMove,
onTouchStart: this.handleTouchStart,
onTouchMove: this.handleTouchMove,
onTouchEnd: this.handleTouchEnd,
title: option.title },
_react2['default'].createElement(
'div',
{ className: 'Select-option-group-label' },
this.props.label
),
this.props.children
);
}
});
module.exports = OptionGroup;
},{"classnames":undefined,"react":undefined}],5:[function(require,module,exports){
=======
},{"classnames":undefined,"react":undefined}],4:[function(require,module,exports){
>>>>>>>
},{"classnames":undefined,"react":undefined}],5:[function(require,module,exports){
'use strict';
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var OptionGroup = _react2['default'].createClass({
displayName: 'OptionGroup',
propTypes: {
children: _react2['default'].PropTypes.any,
className: _react2['default'].PropTypes.string, // className (based on mouse position)
label: _react2['default'].PropTypes.node, // the heading to show above the child options
option: _react2['default'].PropTypes.object.isRequired },
// object that is base for that option group
blockEvent: function blockEvent(event) {
event.preventDefault();
event.stopPropagation();
if (event.target.tagName !== 'A' || !('href' in event.target)) {
return;
}
if (event.target.target) {
window.open(event.target.href, event.target.target);
} else {
window.location.href = event.target.href;
}
},
handleMouseDown: function handleMouseDown(event) {
event.preventDefault();
event.stopPropagation();
},
handleTouchEnd: function handleTouchEnd(event) {
// Check if the view is being dragged, In this case
// we don't want to fire the click event (because the user only wants to scroll)
if (this.dragging) return;
this.handleMouseDown(event);
},
handleTouchMove: function handleTouchMove(event) {
// Set a flag that the view is being dragged
this.dragging = true;
},
handleTouchStart: function handleTouchStart(event) {
// Set a flag that the view is not being dragged
this.dragging = false;
},
render: function render() {
var option = this.props.option;
var className = (0, _classnames2['default'])(this.props.className, option.className);
return option.disabled ? _react2['default'].createElement(
'div',
{ className: className,
onMouseDown: this.blockEvent,
onClick: this.blockEvent },
this.props.children
) : _react2['default'].createElement(
'div',
{ className: className,
style: option.style,
onMouseDown: this.handleMouseDown,
onMouseEnter: this.handleMouseEnter,
onMouseMove: this.handleMouseMove,
onTouchStart: this.handleTouchStart,
onTouchMove: this.handleTouchMove,
onTouchEnd: this.handleTouchEnd,
title: option.title },
_react2['default'].createElement(
'div',
{ className: 'Select-option-group-label' },
this.props.label
),
this.props.children
);
}
});
module.exports = OptionGroup;
},{"classnames":undefined,"react":undefined}],6:[function(require,module,exports){
<<<<<<<
},{"classnames":undefined,"react":undefined}],6:[function(require,module,exports){
=======
},{"classnames":undefined,"react":undefined}],5:[function(require,module,exports){
>>>>>>>
},{"classnames":undefined,"react":undefined}],7:[function(require,module,exports){
<<<<<<<
optionGroupComponent: _OptionGroup2['default'],
pageSize: 5,
=======
pageSize: 5,
>>>>>>>
optionGroupComponent: _OptionGroup2['default'],
pageSize: 5,
<<<<<<<
if (nextProps.options !== this.props.options) {
this._flatOptions = this.flattenOptions(nextProps.options);
}
var valueArray = this.getValueArray(nextProps.value);
=======
var valueArray = this.getValueArray(nextProps.value, nextProps);
>>>>>>>
if (nextProps.options !== this.props.options) {
this._flatOptions = this.flattenOptions(nextProps.options);
}
var valueArray = this.getValueArray(nextProps.value, nextProps);
<<<<<<<
var _props = this.props;
var labelKey = _props.labelKey;
var valueKey = _props.valueKey;
var renderInvalidValues = _props.renderInvalidValues;
=======
var options = props.options;
var valueKey = props.valueKey;
>>>>>>>
var _props = this.props;
var labelKey = _props.labelKey;
var valueKey = _props.valueKey;
var renderInvalidValues = _props.renderInvalidValues;
<<<<<<<
filterOptions: function filterOptions(options, excludeOptions) {
var _this3 = this;
=======
filterOptions: function filterOptions(excludeOptions) {
var _this5 = this;
>>>>>>>
filterOptions: function filterOptions(options, excludeOptions) {
var _this5 = this;
<<<<<<<
var _ret2 = (function () {
var OptionGroup = _this4.props.optionGroupComponent;
var Option = _this4.props.optionComponent;
var renderLabel = _this4.props.optionRenderer || _this4.getOptionLabel;
=======
var _ret = (function () {
var Option = _this6.props.optionComponent;
var renderLabel = _this6.props.optionRenderer || _this6.getOptionLabel;
>>>>>>>
var _ret2 = (function () {
var OptionGroup = _this6.props.optionGroupComponent;
var Option = _this6.props.optionComponent;
var renderLabel = _this6.props.optionRenderer || _this6.getOptionLabel;
<<<<<<<
if (_this4.isGroup(option)) {
var optionGroupClass = (0, _classnames2['default'])({
'Select-option-group': true
});
return _react2['default'].createElement(
OptionGroup,
{
className: optionGroupClass,
key: 'option-group-' + i,
label: renderLabel(option),
option: option
},
_this4.renderMenu(option.options, valueArray, focusedOption)
);
} else {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this4.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this4._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this4.props.valueKey],
onSelect: _this4.selectValue,
onFocus: _this4.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
}
=======
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this6.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this6._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this6.props.valueKey],
onSelect: _this6.selectValue,
onFocus: _this6.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
>>>>>>>
if (_this6.isGroup(option)) {
var optionGroupClass = (0, _classnames2['default'])({
'Select-option-group': true
});
return _react2['default'].createElement(
OptionGroup,
{
className: optionGroupClass,
key: 'option-group-' + i,
label: renderLabel(option),
option: option
},
_this6.renderMenu(option.options, valueArray, focusedOption)
);
} else {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this6.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this6._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this6.props.valueKey],
onSelect: _this6.selectValue,
onFocus: _this6.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
}
<<<<<<<
},{"./Async":1,"./Dropdown":2,"./Option":3,"./OptionGroup":4,"./Value":5,"./utils/stripDiacritics":6,"classnames":undefined,"react":undefined,"react-dom":undefined,"react-input-autosize":undefined}]},{},[]);
=======
},{"./Async":2,"./Option":3,"./Value":4,"./utils/stripDiacritics":5,"blacklist":1,"classnames":undefined,"react":undefined,"react-dom":undefined,"react-input-autosize":undefined}]},{},[]);
>>>>>>>
},{"./Async":2,"./Dropdown":3,"./Option":4,"./OptionGroup":5,"./Value":6,"./utils/stripDiacritics":7,"blacklist":1,"classnames":undefined,"react":undefined,"react-dom":undefined,"react-input-autosize":undefined}]},{},[]); |
<<<<<<<
import {createItem} from './helpers/create-item';
import {configureSelect2Labels} from './helpers/configure-select2-labels';
import {handlerShowMarkdownHint} from './helpers/handler-show-markdown-hint';
=======
import {LabelExtractor} from '../../../imports/services/labelExtractor';
import {configureSelect2Responsibles} from '/imports/client/ResponsibleSearch';
>>>>>>>
import {createItem} from './helpers/create-item';
import {configureSelect2Labels} from './helpers/configure-select2-labels';
import {handlerShowMarkdownHint} from './helpers/handler-show-markdown-hint';
import {configureSelect2Responsibles} from '/imports/client/ResponsibleSearch';
<<<<<<<
function configureSelect2Responsibles() {
let freeTextValidator = (text) => {
return emailAddressRegExpTest.test(text);
};
let preparer = new ResponsiblePreparer(new Minutes(_minutesID), getEditInfoItem(), Meteor.users, freeTextValidator);
let selectResponsibles = $('#id_selResponsibleActionItem');
selectResponsibles.find('optgroup') // clear all <option>s
.remove();
let possResp = preparer.getPossibleResponsibles();
let remainingUsers = preparer.getRemainingUsers();
let selectOptions = [{
text: 'Participants',
children: possResp
}, {
text: 'Other Users',
children: remainingUsers
}];
selectResponsibles.select2({
placeholder: 'Select...',
tags: true, // Allow freetext adding
tokenSeparators: [',', ';'],
data: selectOptions // push <option>s data
});
// select the options that where stored with this topic last time
let editItem = getEditInfoItem();
if (editItem) {
selectResponsibles.val(editItem.getResponsibleRawArray());
}
selectResponsibles.trigger('change');
}
=======
function configureSelect2Labels() {
let aMin = new Minutes(_minutesID);
let aSeries = aMin.parentMeetingSeries();
let selectLabels = $('#id_item_selLabelsActionItem');
selectLabels.find('option') // clear all <option>s
.remove();
let selectOptions = [];
aSeries.getAvailableLabels().forEach(label => {
selectOptions.push ({id: label._id, text: label.name});
});
selectLabels.select2({
placeholder: 'Select...',
tags: true, // Allow freetext adding
tokenSeparators: [',', ';'],
data: selectOptions // push <option>s data
});
// select the options that where stored with this topic last time
let editItem = getEditInfoItem();
if (editItem) {
selectLabels.val(editItem.getLabelsRawArray());
}
selectLabels.trigger('change');
}
>>>>>>> |
<<<<<<<
optionGroupComponent: OptionGroup,
=======
pageSize: 5,
>>>>>>>
optionGroupComponent: OptionGroup,
pageSize: 5,
<<<<<<<
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
=======
componentWillMount () {
this._instancePrefix = 'react-select-' + (++instanceId) + '-';
>>>>>>>
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + (++instanceId) + '-';
<<<<<<<
if (this.isGroup(option)) {
let optionGroupClass = classNames({
'Select-option-group': true,
});
return (
<OptionGroup
className={optionGroupClass}
key={`option-group-${i}`}
label={renderLabel(option)}
option={option}
>
{this.renderMenu(option.options, valueArray, focusedOption)}
</OptionGroup>
);
} else {
let isSelected = valueArray && valueArray.indexOf(option) > -1;
let isFocused = option === focusedOption;
let optionRef = isFocused ? 'focused' : null;
let optionClass = classNames(this.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled,
});
return (
<Option
className={optionClass}
isDisabled={option.disabled}
isFocused={isFocused}
key={`option-${i}-${option[this.props.valueKey]}`}
onSelect={this.selectValue}
onFocus={this.focusOption}
option={option}
isSelected={isSelected}
ref={optionRef}
>
{renderLabel(option)}
</Option>
);
}
=======
let isSelected = valueArray && valueArray.indexOf(option) > -1;
let isFocused = option === focusedOption;
let optionRef = isFocused ? 'focused' : null;
let optionClass = classNames(this.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled,
});
return (
<Option
instancePrefix={this._instancePrefix}
optionIndex={i}
className={optionClass}
isDisabled={option.disabled}
isFocused={isFocused}
key={`option-${i}-${option[this.props.valueKey]}`}
onSelect={this.selectValue}
onFocus={this.focusOption}
option={option}
isSelected={isSelected}
ref={optionRef}
>
{renderLabel(option)}
</Option>
);
>>>>>>>
if (this.isGroup(option)) {
let optionGroupClass = classNames({
'Select-option-group': true,
});
return (
<OptionGroup
className={optionGroupClass}
key={`option-group-${i}`}
label={renderLabel(option)}
option={option}
>
{this.renderMenu(option.options, valueArray, focusedOption)}
</OptionGroup>
);
} else {
let isSelected = valueArray && valueArray.indexOf(option) > -1;
let isFocused = option === focusedOption;
let optionRef = isFocused ? 'focused' : null;
let optionClass = classNames(this.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled,
});
return (
<Option
instancePrefix={this._instancePrefix}
optionIndex={i}
className={optionClass}
isDisabled={option.disabled}
isFocused={isFocused}
key={`option-${i}-${option[this.props.valueKey]}`}
onSelect={this.selectValue}
onFocus={this.focusOption}
option={option}
isSelected={isSelected}
ref={optionRef}
>
{renderLabel(option)}
</Option>
);
}
<<<<<<<
<Dropdown>
<div ref="menuContainer" className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref="menu" className="Select-menu"
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
</Dropdown>
=======
<div ref="menuContainer" className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref="menu" role="listbox" className="Select-menu" id={this._instancePrefix + '-list'}
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
>>>>>>>
<Dropdown>
<div ref="menuContainer" className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref="menu" role="listbox" className="Select-menu" id={this._instancePrefix + '-list'}
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
</Dropdown> |
<<<<<<<
describe('with grouped options, multi=true, and searchable=false', () => {
beforeEach(() => {
options = [
{ label: 'Negative Numbers', options: [
{ value: '-2', label: '-2' },
{ value: '-1', label: '-1' },
] },
{ label: 'Positive Numbers', options: [
{ value: '1', label: '+1' },
{ value: '2', label: '+2' },
] }
];
// Render an instance of the component
wrapper = createControlWithWrapper({
value: '',
closeOnSelect: false,
options: options,
searchable: false,
multi: true
}, {
wireUpOnChangeToValue: true
});
// We need a hack here.
// JSDOM (at least v3.x) doesn't appear to support div's with tabindex
// This just hacks that we are focused
// This is (obviously) implementation dependent, and may need to change
instance.setState({
isFocused: true
});
});
it('removes the selected options from the menu', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
var groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items, 'to have length', 4);
expect(groups, 'to have length', 2);
// Click the option "-1" to select it
expect(items[1], 'to have text', '-1');
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Now get the list again
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items, 'to have length', 3);
expect(groups, 'to have length', 2);
expect(items[0], 'to have text', '-2');
expect(items[1], 'to have text', '+1');
expect(items[2], 'to have text', '+2');
expect(groups[0], 'to have text', 'Negative Numbers');
expect(groups[1], 'to have text', 'Positive Numbers');
// Click the option "-2" to select it
TestUtils.Simulate.mouseDown(items[0]);
expect(onChange, 'was called times', 2);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items[0], 'to have text', '+1');
expect(items[1], 'to have text', '+2');
expect(items, 'to have length', 2);
expect(groups[0], 'to have text', 'Positive Numbers');
expect(groups, 'to have length', 1);
});
});
=======
describe('with removeSelected=false', () => {
beforeEach(() => {
options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
{ value: 'four', label: 'Four' }
];
// Render an instance of the component
wrapper = createControlWithWrapper({
value: '',
options: options,
multi: true,
closeOnSelect: false,
removeSelected: false
}, {
wireUpOnChangeToValue: true
});
// We need a hack here.
// JSDOM (at least v3.x) doesn't appear to support div's with tabindex
// This just hacks that we are focused
// This is (obviously) implementation dependent, and may need to change
instance.setState({
isFocused: true
});
});
it('does not remove the selected options from the menu', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
// Click the option "Two" to select it
expect(items[1], 'to have text', 'Two');
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Now get the list again
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
// Click first item, 'One'
TestUtils.Simulate.mouseDown(items[0]);
expect(onChange, 'was called times', 2);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
// Click last item, 'Four'
TestUtils.Simulate.mouseDown(items[3]);
expect(onChange, 'was called times', 3);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
expect(onChange.args, 'to equal', [
[[{ value: 'two', label: 'Two' }]],
[[{ value: 'two', label: 'Two' }, { value: 'one', label: 'One' }]],
[
[
{ value: 'two', label: 'Two' },
{ value: 'one', label: 'One' },
{ value: 'four', label: 'Four' },
],
],
]);
});
it('removes a selected value if chosen again', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
// Click the option "Two" to select it
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Click the option "Two" again to deselect it
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 2);
expect(onChange.args, 'to equal', [
[[{ value: 'two', label: 'Two' }]],
[[]],
]);
});
});
>>>>>>>
describe('with grouped options, multi=true, and searchable=false', () => {
beforeEach(() => {
options = [
{ label: 'Negative Numbers', options: [
{ value: '-2', label: '-2' },
{ value: '-1', label: '-1' },
] },
{ label: 'Positive Numbers', options: [
{ value: '1', label: '+1' },
{ value: '2', label: '+2' },
] }
];
// Render an instance of the component
wrapper = createControlWithWrapper({
value: '',
closeOnSelect: false,
options: options,
searchable: false,
multi: true
}, {
wireUpOnChangeToValue: true
});
// We need a hack here.
// JSDOM (at least v3.x) doesn't appear to support div's with tabindex
// This just hacks that we are focused
// This is (obviously) implementation dependent, and may need to change
instance.setState({
isFocused: true
});
});
it('removes the selected options from the menu', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
var groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items, 'to have length', 4);
expect(groups, 'to have length', 2);
// Click the option "-1" to select it
expect(items[1], 'to have text', '-1');
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Now get the list again
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items, 'to have length', 3);
expect(groups, 'to have length', 2);
expect(items[0], 'to have text', '-2');
expect(items[1], 'to have text', '+1');
expect(items[2], 'to have text', '+2');
expect(groups[0], 'to have text', 'Negative Numbers');
expect(groups[1], 'to have text', 'Positive Numbers');
// Click the option "-2" to select it
TestUtils.Simulate.mouseDown(items[0]);
expect(onChange, 'was called times', 2);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
groups = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option-group-label');
expect(items[0], 'to have text', '+1');
expect(items[1], 'to have text', '+2');
expect(items, 'to have length', 2);
expect(groups[0], 'to have text', 'Positive Numbers');
expect(groups, 'to have length', 1);
});
});
describe('with removeSelected=false', () => {
beforeEach(() => {
options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
{ value: 'four', label: 'Four' }
];
// Render an instance of the component
wrapper = createControlWithWrapper({
value: '',
options: options,
multi: true,
closeOnSelect: false,
removeSelected: false
}, {
wireUpOnChangeToValue: true
});
// We need a hack here.
// JSDOM (at least v3.x) doesn't appear to support div's with tabindex
// This just hacks that we are focused
// This is (obviously) implementation dependent, and may need to change
instance.setState({
isFocused: true
});
});
it('does not remove the selected options from the menu', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
// Click the option "Two" to select it
expect(items[1], 'to have text', 'Two');
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Now get the list again
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
// Click first item, 'One'
TestUtils.Simulate.mouseDown(items[0]);
expect(onChange, 'was called times', 2);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
// Click last item, 'Four'
TestUtils.Simulate.mouseDown(items[3]);
expect(onChange, 'was called times', 3);
items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
expect(items[0], 'to have text', 'One');
expect(items[1], 'to have text', 'Two');
expect(items[2], 'to have text', 'Three');
expect(items[3], 'to have text', 'Four');
expect(items, 'to have length', 4);
expect(onChange.args, 'to equal', [
[[{ value: 'two', label: 'Two' }]],
[[{ value: 'two', label: 'Two' }, { value: 'one', label: 'One' }]],
[
[
{ value: 'two', label: 'Two' },
{ value: 'one', label: 'One' },
{ value: 'four', label: 'Four' },
],
],
]);
});
it('removes a selected value if chosen again', () => {
clickArrowToOpen();
var items = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-option');
// Click the option "Two" to select it
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 1);
// Click the option "Two" again to deselect it
TestUtils.Simulate.mouseDown(items[1]);
expect(onChange, 'was called times', 2);
expect(onChange.args, 'to equal', [
[[{ value: 'two', label: 'Two' }]],
[[]],
]);
});
}); |
<<<<<<<
import Dropdown from './Dropdown';
=======
import Creatable from './Creatable';
>>>>>>>
import Dropdown from './Dropdown';
import Creatable from './Creatable';
<<<<<<<
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + (++instanceId) + '-';
=======
componentWillMount() {
this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-';
>>>>>>>
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-';
<<<<<<<
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
let focusedOptionNode = ReactDOM.findDOMNode(this.refs.focused);
let focusedOptionPreviousSibling = focusedOptionNode.previousSibling;
let focusedOptionParent = focusedOptionNode.parentElement;
let menuNode = ReactDOM.findDOMNode(this.refs.menu);
if (focusedOptionPreviousSibling) {
menuNode.scrollTop = focusedOptionPreviousSibling.offsetTop;
} else if (focusedOptionParent && focusedOptionParent === 'Select-menu') {
menuNode.scrollTop = focusedOptionParent.offsetTop;
} else {
menuNode.scrollTop = focusedOptionNode.offsetTop;
}
=======
if (this.menu && this.focused && this.state.isOpen && !this.hasScrolledToOption) {
let focusedOptionNode = ReactDOM.findDOMNode(this.focused);
let menuNode = ReactDOM.findDOMNode(this.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
>>>>>>>
if (this.menu && this.focused && this.state.isOpen && !this.hasScrolledToOption) {
let focusedOptionNode = ReactDOM.findDOMNode(this.focused);
let focusedOptionPreviousSibling = focusedOptionNode.previousSibling;
let focusedOptionParent = focusedOptionNode.parentElement;
let menuNode = ReactDOM.findDOMNode(this.menu);
if (focusedOptionPreviousSibling) {
menuNode.scrollTop = focusedOptionPreviousSibling.offsetTop;
} else if (focusedOptionParent && focusedOptionParent === 'Select-menu') {
menuNode.scrollTop = focusedOptionParent.offsetTop;
} else {
menuNode.scrollTop = focusedOptionNode.offsetTop;
}
<<<<<<<
if (this.props.menuRenderer) {
return this.props.menuRenderer({
focusedOption,
focusOption: this.focusOption,
labelKey: this.props.labelKey,
options,
selectValue: this.selectValue,
valueArray,
});
} else {
let OptionGroup = this.props.optionGroupComponent;
let Option = this.props.optionComponent;
let renderLabel = this.props.optionRenderer || this.getOptionLabel;
return options.map((option, i) => {
if (this.isGroup(option)) {
let optionGroupClass = classNames({
'Select-option-group': true,
});
return (
<OptionGroup
className={optionGroupClass}
key={`option-group-${i}`}
label={renderLabel(option)}
option={option}
>
{this.renderMenu(option.options, valueArray, focusedOption)}
</OptionGroup>
);
} else {
let isSelected = valueArray && valueArray.indexOf(option) > -1;
let isFocused = option === focusedOption;
let optionRef = isFocused ? 'focused' : null;
let optionClass = classNames(this.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled,
});
return (
<Option
instancePrefix={this._instancePrefix}
optionIndex={i}
className={optionClass}
isDisabled={option.disabled}
isFocused={isFocused}
key={`option-${i}-${option[this.props.valueKey]}`}
onSelect={this.selectValue}
onFocus={this.focusOption}
option={option}
isSelected={isSelected}
ref={optionRef}
>
{renderLabel(option)}
</Option>
);
}
});
}
=======
return this.props.menuRenderer({
focusedOption,
focusOption: this.focusOption,
instancePrefix: this._instancePrefix,
labelKey: this.props.labelKey,
onFocus: this.focusOption,
onSelect: this.selectValue,
optionClassName: this.props.optionClassName,
optionComponent: this.props.optionComponent,
optionRenderer: this.props.optionRenderer || this.getOptionLabel,
options,
selectValue: this.selectValue,
valueArray,
valueKey: this.props.valueKey,
});
>>>>>>>
return this.props.menuRenderer({
focusedOption,
focusOption: this.focusOption,
instancePrefix: this._instancePrefix,
labelKey: this.props.labelKey,
onFocus: this.focusOption,
onSelect: this.selectValue,
optionClassName: this.props.optionClassName,
optionComponent: this.props.optionComponent,
optionGroupComponent: this.props.optionGroupComponent,
optionRenderer: this.props.optionRenderer || this.getOptionLabel,
options,
selectValue: this.selectValue,
valueArray,
valueKey: this.props.valueKey,
});
<<<<<<<
<Dropdown>
<div ref="menuContainer" className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref="menu" role="listbox" className="Select-menu" id={this._instancePrefix + '-list'}
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
</Dropdown>
=======
<div ref={ref => this.menuContainer = ref} className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref={ref => this.menu = ref} role="listbox" className="Select-menu" id={this._instancePrefix + '-list'}
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
>>>>>>>
<Dropdown>
<div ref={ref => this.menuContainer = ref} className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref={ref => this.menu = ref} role="listbox" className="Select-menu" id={this._instancePrefix + '-list'}
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{menu}
</div>
</div>
</Dropdown>
<<<<<<<
let valueArray = this.getValueArray(this.props.value);
let options = this.filterOptions(this.props.options || [], this.props.multi ? valueArray : null);
this._visibleOptions = this.flattenOptions(options);
let isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen;
=======
let valueArray = this.getValueArray(this.props.value);
let options = this._visibleOptions = this.filterOptions(this.props.multi ? this.getValueArray(this.props.value) : null);
let isOpen = this.state.isOpen;
>>>>>>>
let valueArray = this.getValueArray(this.props.value);
this._visibleOptions = this.filterFlatOptions(this.props.multi ? valueArray : null);
let options = this.unflattenOptions(this._visibleOptions);
let isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen; |
<<<<<<<
var _Dropdown = require('./Dropdown');
var _Dropdown2 = _interopRequireDefault(_Dropdown);
var _Option = require('./Option');
=======
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
>>>>>>>
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
<<<<<<<
var _OptionGroup = require('./OptionGroup');
var _OptionGroup2 = _interopRequireDefault(_OptionGroup);
var _Value = require('./Value');
=======
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
>>>>>>>
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
<<<<<<<
function clone(obj) {
var copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = obj[attr];
};
}
return copy;
}
function isGroup(option) {
return option && Array.isArray(option.options);
}
function stringifyValue(value) {
var valueType = typeof value;
if (valueType === 'string') {
return value;
} else if (valueType === 'object') {
return JSON.stringify(value);
} else if (valueType === 'number' || valueType === 'boolean') {
return String(value);
} else {
return '';
}
}
=======
>>>>>>>
function clone(obj) {
var copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = obj[attr];
};
}
return copy;
}
function isGroup(option) {
return option && Array.isArray(option.options);
} |
<<<<<<<
var _reactSelectPlus = require('react-select-plus');
=======
var _createReactClass = require('create-react-class');
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactSelect = require('react-select');
>>>>>>>
var _createReactClass = require('create-react-class');
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactSelectPlus = require('react-select-plus');
<<<<<<<
},{"../data/states":15,"react":undefined,"react-select-plus":undefined}],12:[function(require,module,exports){
=======
},{"../data/states":14,"create-react-class":undefined,"prop-types":undefined,"react":undefined,"react-select":undefined}],11:[function(require,module,exports){
>>>>>>>
},{"../data/states":15,"create-react-class":undefined,"prop-types":undefined,"react":undefined,"react-select-plus":undefined}],12:[function(require,module,exports){
<<<<<<<
},{"../data/cities":13,"react":undefined,"react-virtualized-select":47}],13:[function(require,module,exports){
=======
},{"../data/cities":12,"create-react-class":undefined,"react":undefined,"react-virtualized-select":35}],12:[function(require,module,exports){
>>>>>>>
},{"../data/cities":13,"create-react-class":undefined,"react":undefined,"react-virtualized-select":33}],13:[function(require,module,exports){ |
<<<<<<<
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
},
=======
componentWillMount () {
const valueArray = this.getValueArray(this.props.value);
if (this.props.required) {
this.setState({
required: this.handleRequired(valueArray[0], this.props.multi),
});
}
},
>>>>>>>
componentWillMount() {
this._flatOptions = this.flattenOptions(this.props.options);
const valueArray = this.getValueArray(this.props.value);
if (this.props.required) {
this.setState({
required: this.handleRequired(valueArray[0], this.props.multi),
});
}
},
<<<<<<<
if (nextProps.options !== this.props.options) {
this._flatOptions = this.flattenOptions(nextProps.options);
}
if (this.props.value !== nextProps.value && nextProps.required) {
=======
const valueArray = this.getValueArray(nextProps.value);
if (nextProps.required) {
>>>>>>>
if (nextProps.options !== this.props.options) {
this._flatOptions = this.flattenOptions(nextProps.options);
}
const valueArray = this.getValueArray(nextProps.value);
if (nextProps.required) {
<<<<<<<
let valueArray = this.getValueArray();
let options = this.filterOptions(this.props.options || [], this.props.multi ? valueArray : null);
this._visibleOptions = this.flattenOptions(options);
let isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen;
=======
let valueArray = this.getValueArray(this.props.value);
let options = this._visibleOptions = this.filterOptions(this.props.multi ? valueArray : null);
let isOpen = this.state.isOpen;
>>>>>>>
let valueArray = this.getValueArray(this.props.value);
let options = this.filterOptions(this.props.options || [], this.props.multi ? valueArray : null);
this._visibleOptions = this.flattenOptions(options);
let isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen;
<<<<<<<
let Dropdown = this.props.dropdownComponent;
=======
>>>>>>>
<<<<<<<
{isOpen ? (
<Dropdown>
<div ref="menuContainer" className="Select-menu-outer" style={this.props.menuContainerStyle}>
<div ref="menu" className="Select-menu"
style={this.props.menuStyle}
onScroll={this.handleMenuScroll}
onMouseDown={this.handleMouseDownOnMenu}>
{this.renderMenu(options, !this.props.multi ? valueArray : null, focusedOption)}
</div>
</div>
</Dropdown>
) : null}
=======
{isOpen ? this.renderOuter(options, !this.props.multi ? valueArray : null, focusedOption) : null}
>>>>>>>
{isOpen ? this.renderOuter(options, !this.props.multi ? valueArray : null, focusedOption) : null} |
<<<<<<<
describe('arrowRenderer', () => {
beforeEach(() => {
instance = createControl({
arrowRenderer: null
});
});
it('doesn\'t render arrow if arrowRenderer props is null', () => {
var arrow = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-arrow-zone')[0];
expect(arrow, 'to be', undefined);
});
});
=======
describe('with autoFocus', () => {
it('focuses select input on mount', () => {
wrapper = createControl({
autoFocus: true,
options: defaultOptions,
});
var input = ReactDOM.findDOMNode(instance.input).querySelector('input');
expect(input, 'to equal', document.activeElement);
});
it('with autofocus as well, calls focus() only once', () => {
wrapper = createControl({
autofocus: true,
autoFocus: true,
options: defaultOptions,
});
var focus = sinon.spy(instance, 'focus');
instance.componentDidMount();
expect(focus, 'was called once');
});
});
describe('with autofocus', () => {
it('focuses the select input on mount', () => {
wrapper = createControl({
autofocus: true,
options: defaultOptions,
});
var input = ReactDOM.findDOMNode(instance.input).querySelector('input');
expect(input, 'to equal', document.activeElement);
});
it('calls console.warn', () => {
var warn = sinon.spy(console, 'warn');
wrapper = createControl({
autofocus: true,
options: defaultOptions,
});
expect(warn, 'was called once');
});
});
>>>>>>>
describe('arrowRenderer', () => {
beforeEach(() => {
instance = createControl({
arrowRenderer: null
});
});
it('doesn\'t render arrow if arrowRenderer props is null', () => {
var arrow = ReactDOM.findDOMNode(instance).querySelectorAll('.Select-arrow-zone')[0];
expect(arrow, 'to be', undefined);
});
});
describe('with autoFocus', () => {
it('focuses select input on mount', () => {
wrapper = createControl({
autoFocus: true,
options: defaultOptions,
});
var input = ReactDOM.findDOMNode(instance.input).querySelector('input');
expect(input, 'to equal', document.activeElement);
});
it('with autofocus as well, calls focus() only once', () => {
wrapper = createControl({
autofocus: true,
autoFocus: true,
options: defaultOptions,
});
var focus = sinon.spy(instance, 'focus');
instance.componentDidMount();
expect(focus, 'was called once');
});
});
describe('with autofocus', () => {
it('focuses the select input on mount', () => {
wrapper = createControl({
autofocus: true,
options: defaultOptions,
});
var input = ReactDOM.findDOMNode(instance.input).querySelector('input');
expect(input, 'to equal', document.activeElement);
});
it('calls console.warn', () => {
var warn = sinon.spy(console, 'warn');
wrapper = createControl({
autofocus: true,
options: defaultOptions,
});
expect(warn, 'was called once');
});
}); |
<<<<<<<
this._flatOptions = this.flattenOptions(this.props.options);
=======
this._instancePrefix = 'react-select-' + ++instanceId + '-';
>>>>>>>
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + ++instanceId + '-';
<<<<<<<
if (_this4.isGroup(option)) {
var optionGroupClass = (0, _classnames2['default'])({
'Select-option-group': true
});
return _react2['default'].createElement(
OptionGroup,
{
className: optionGroupClass,
key: 'option-group-' + i,
label: renderLabel(option),
option: option
},
_this4.renderMenu(option.options, valueArray, focusedOption)
);
} else {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this4.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this4.props.valueKey],
onSelect: _this4.selectValue,
onFocus: _this4.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
}
=======
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this4.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this4._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this4.props.valueKey],
onSelect: _this4.selectValue,
onFocus: _this4.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
>>>>>>>
if (_this4.isGroup(option)) {
var optionGroupClass = (0, _classnames2['default'])({
'Select-option-group': true
});
return _react2['default'].createElement(
OptionGroup,
{
className: optionGroupClass,
key: 'option-group-' + i,
label: renderLabel(option),
option: option
},
_this4.renderMenu(option.options, valueArray, focusedOption)
);
} else {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this4.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this4._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this4.props.valueKey],
onSelect: _this4.selectValue,
onFocus: _this4.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
}
<<<<<<<
{ ref: 'menuContainer', className: 'Select-menu-outer', style: this.props.menuContainerStyle },
_react2['default'].createElement(
'div',
{ ref: 'menu', className: 'Select-menu',
style: this.props.menuStyle,
onScroll: this.handleMenuScroll,
onMouseDown: this.handleMouseDownOnMenu },
menu
)
=======
{ ref: 'menu', role: 'listbox', className: 'Select-menu', id: this._instancePrefix + '-list',
style: this.props.menuStyle,
onScroll: this.handleMenuScroll,
onMouseDown: this.handleMouseDownOnMenu },
menu
>>>>>>>
{ ref: 'menuContainer', className: 'Select-menu-outer', style: this.props.menuContainerStyle },
_react2['default'].createElement(
'div',
{ ref: 'menu', role: 'listbox', className: 'Select-menu', id: this._instancePrefix + '-list',
style: this.props.menuStyle,
onScroll: this.handleMenuScroll,
onMouseDown: this.handleMouseDownOnMenu },
menu
) |
<<<<<<<
var _Dropdown = require('./Dropdown');
var _Dropdown2 = _interopRequireDefault(_Dropdown);
=======
var _Creatable = require('./Creatable');
var _Creatable2 = _interopRequireDefault(_Creatable);
>>>>>>>
var _Dropdown = require('./Dropdown');
var _Dropdown2 = _interopRequireDefault(_Dropdown);
var _Creatable = require('./Creatable');
var _Creatable2 = _interopRequireDefault(_Creatable);
<<<<<<<
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + ++instanceId + '-';
=======
this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-';
>>>>>>>
this._flatOptions = this.flattenOptions(this.props.options);
this._instancePrefix = 'react-select-' + (this.props.instanceId || ++instanceId) + '-';
<<<<<<<
if (this.refs.menu && this.refs.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.refs.focused);
var focusedOptionPreviousSibling = focusedOptionNode.previousSibling;
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.refs.menu);
if (focusedOptionPreviousSibling) {
menuNode.scrollTop = focusedOptionPreviousSibling.offsetTop;
} else if (focusedOptionParent && focusedOptionParent === 'Select-menu') {
menuNode.scrollTop = focusedOptionParent.offsetTop;
} else {
menuNode.scrollTop = focusedOptionNode.offsetTop;
}
=======
if (this.menu && this.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.focused);
var menuNode = _reactDom2['default'].findDOMNode(this.menu);
menuNode.scrollTop = focusedOptionNode.offsetTop;
>>>>>>>
if (this.menu && this.focused && this.state.isOpen && !this.hasScrolledToOption) {
var focusedOptionNode = _reactDom2['default'].findDOMNode(this.focused);
var focusedOptionPreviousSibling = focusedOptionNode.previousSibling;
var focusedOptionParent = focusedOptionNode.parentElement;
var menuNode = _reactDom2['default'].findDOMNode(this.menu);
if (focusedOptionPreviousSibling) {
menuNode.scrollTop = focusedOptionPreviousSibling.offsetTop;
} else if (focusedOptionParent && focusedOptionParent === 'Select-menu') {
menuNode.scrollTop = focusedOptionParent.offsetTop;
} else {
menuNode.scrollTop = focusedOptionNode.offsetTop;
}
<<<<<<<
filterOptions: function filterOptions(options, excludeOptions) {
var _this5 = this;
var excludeOptionValues = null;
=======
filterOptions: function filterOptions(excludeOptions) {
>>>>>>>
filterFlatOptions: function filterFlatOptions(excludeOptions) {
<<<<<<<
if (this.props.menuRenderer) {
return this.props.menuRenderer({
focusedOption: focusedOption,
focusOption: this.focusOption,
labelKey: this.props.labelKey,
options: options,
selectValue: this.selectValue,
valueArray: valueArray
});
} else {
var _ret2 = (function () {
var OptionGroup = _this6.props.optionGroupComponent;
var Option = _this6.props.optionComponent;
var renderLabel = _this6.props.optionRenderer || _this6.getOptionLabel;
return {
v: options.map(function (option, i) {
if (_this6.isGroup(option)) {
var optionGroupClass = (0, _classnames2['default'])({
'Select-option-group': true
});
return _react2['default'].createElement(
OptionGroup,
{
className: optionGroupClass,
key: 'option-group-' + i,
label: renderLabel(option),
option: option
},
_this6.renderMenu(option.options, valueArray, focusedOption)
);
} else {
var isSelected = valueArray && valueArray.indexOf(option) > -1;
var isFocused = option === focusedOption;
var optionRef = isFocused ? 'focused' : null;
var optionClass = (0, _classnames2['default'])(_this6.props.optionClassName, {
'Select-option': true,
'is-selected': isSelected,
'is-focused': isFocused,
'is-disabled': option.disabled
});
return _react2['default'].createElement(
Option,
{
instancePrefix: _this6._instancePrefix,
optionIndex: i,
className: optionClass,
isDisabled: option.disabled,
isFocused: isFocused,
key: 'option-' + i + '-' + option[_this6.props.valueKey],
onSelect: _this6.selectValue,
onFocus: _this6.focusOption,
option: option,
isSelected: isSelected,
ref: optionRef
},
renderLabel(option)
);
}
})
};
})();
if (typeof _ret2 === 'object') return _ret2.v;
}
=======
return this.props.menuRenderer({
focusedOption: focusedOption,
focusOption: this.focusOption,
instancePrefix: this._instancePrefix,
labelKey: this.props.labelKey,
onFocus: this.focusOption,
onSelect: this.selectValue,
optionClassName: this.props.optionClassName,
optionComponent: this.props.optionComponent,
optionRenderer: this.props.optionRenderer || this.getOptionLabel,
options: options,
selectValue: this.selectValue,
valueArray: valueArray,
valueKey: this.props.valueKey
});
>>>>>>>
return this.props.menuRenderer({
focusedOption: focusedOption,
focusOption: this.focusOption,
instancePrefix: this._instancePrefix,
labelKey: this.props.labelKey,
onFocus: this.focusOption,
onSelect: this.selectValue,
optionClassName: this.props.optionClassName,
optionComponent: this.props.optionComponent,
optionGroupComponent: this.props.optionGroupComponent,
optionRenderer: this.props.optionRenderer || this.getOptionLabel,
options: options,
selectValue: this.selectValue,
valueArray: valueArray,
valueKey: this.props.valueKey
});
<<<<<<<
var Dropdown = this.props.dropdownComponent;
=======
var _this7 = this;
>>>>>>>
var _this7 = this;
var Dropdown = this.props.dropdownComponent;
<<<<<<<
var options = this.filterOptions(this.props.options || [], this.props.multi ? valueArray : null);
this._visibleOptions = this.flattenOptions(options);
var isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen;
=======
var options = this._visibleOptions = this.filterOptions(this.props.multi ? this.getValueArray(this.props.value) : null);
var isOpen = this.state.isOpen;
>>>>>>>
this._visibleOptions = this.filterFlatOptions(this.props.multi ? valueArray : null);
var options = this.unflattenOptions(this._visibleOptions);
var isOpen = typeof this.props.isOpen === 'boolean' ? this.props.isOpen : this.state.isOpen; |
<<<<<<<
* @return {Promise} A promise that will be fulfilled when the connection has
=======
* @example
* // Test the connection to the runtime
* var businessNetwork = new BusinessNetworkConnection();
* var client;
* return businessNetwork.connect('testprofile', 'businessNetworkIdentifier', 'WebAppAdmin', 'DJY27pEnl16d')
* .then(function(businessNetworkDefinition){
* client = businessNetworkDefinition;
* })
* .then(function(){
* return client.ping();
* })
* .then(function(ping){
* // Connection tested.
* });
* @return {Promise} A promise that will be fufilled when the connection has
>>>>>>>
* @example
* // Test the connection to the runtime
* var businessNetwork = new BusinessNetworkConnection();
* var client;
* return businessNetwork.connect('testprofile', 'businessNetworkIdentifier', 'WebAppAdmin', 'DJY27pEnl16d')
* .then(function(businessNetworkDefinition){
* client = businessNetworkDefinition;
* })
* .then(function(){
* return client.ping();
* })
* .then(function(){
* // Connection tested.
* });
* @return {Promise} A promise that will be fufilled when the connection has |
<<<<<<<
await fs.outputFile('./build/homebrew/render.js', render);
await fs.copy('./client/homebrew/phbStyle/fonts', './build/fonts');
=======
>>>>>>>
await fs.copy('./client/homebrew/phbStyle/fonts', './build/fonts'); |
<<<<<<<
function paletteForMimeType(mimeType) {
if (mimeType == 'text/x-pencilcode') return palette.COFFEESCRIPT_PALETTE;
if (mimeType == 'text/coffeescript') return palette.COFFEESCRIPT_PALETTE;
if (mimeType == 'text/javascript') return palette.JAVASCRIPT_PALETTE;
if (mimeType == 'application/x-javascript') return palette.JAVASCRIPT_PALETTE;
if (mimeType.replace(/;.*$/, '') == 'text/html') return palette.HTML_PALETTE;
=======
function paletteForPane(paneState, selfname) {
var mimeType = editorMimeType(paneState),
basePalette = paneState.palette;
if (!basePalette) {
if (mimeType == 'text/x-pencilcode' || mimeType == 'text/coffeescript') {
basePalette = palette.COFFEESCRIPT_PALETTE;
}
if (mimeType == 'text/javascript' ||
mimeType == 'application/x-javascript') {
basePalette = palette.JAVASCRIPT_PALETTE;
}
}
if (basePalette) {
return palette.expand(basePalette, paneState.selfname);
}
>>>>>>>
function paletteForPane(paneState, selfname) {
var mimeType = editorMimeType(paneState),
basePalette = paneState.palette;
if (!basePalette) {
if (mimeType == 'text/x-pencilcode' || mimeType == 'text/coffeescript') {
basePalette = palette.COFFEESCRIPT_PALETTE;
}
if (mimeType == 'text/javascript' ||
mimeType == 'application/x-javascript') {
basePalette = palette.JAVASCRIPT_PALETTE;
}
if (mimeType.replace(/;.*$/, '') == 'text/html') {
basePalette = palette.HTML_PALETTE;
}
}
if (basePalette) {
return palette.expand(basePalette, paneState.selfname);
} |
<<<<<<<
name: 'Move',
color: 'red',
blocks: [
=======
name: 'Draw',
color: 'blue',
blocks: filterblocks([
>>>>>>>
name: 'Move',
color: 'red',
blocks: filterblocks([
<<<<<<<
=======
block: 'for x in [1..3]\n ``',
title: 'Do something multiple times...?',
id: 'forvar'
}, {
>>>>>>>
<<<<<<<
block: 'random [1..100]',
=======
block: '`` is ``',
title: 'Compare two values',
id: 'is'
}, {
block: '`` < ``',
title: 'Compare two values',
id: 'lessthan'
}, {
block: '`` > ``',
title: 'Compare two values',
id: 'greaterthan'
}, {
block: 'random 1, 7',
>>>>>>>
block: 'random 6',
title: 'Get a random number less than n'
}, {
block: 'round ``',
title: 'Round to the nearest integer'
}, {
block: 'abs ``',
title: 'Absolute value'
}, {
block: 'max ``, ``',
title: 'Get the larger of two numbers'
}, {
block: 'min ``, ``',
title: 'Get the smaller on two numbers'
}, {
block: 'x.match /pattern/',
title: 'Test if a text pattern is found in x'
}, {
block: 'f = (x) ->\n ``',
title: 'Define a new function'
}, {
block: 'f(x)',
title: 'Use a custom function'
}
])
}, {
name: 'Text',
color: 'yellow',
blocks: filterblocks([
{
block: 'write \'Hello.\'',
title: 'Write text in the document'
}, {
block: 'type \'zz*(-.-)*zz\'',
title: 'Typewrite text in the document'
}, {
block: 'label \'spot\'',
title: 'Write text at the turtle'
}, {
block: 'read \'?\', (x) ->\n write x',
title: 'Read input from the user'
}, {
block: 'readnum \'?\', (x) ->\n write x',
title: 'Read a number from the user'
}, {
block: 'log [1..10]',
title: 'Log an object to debug'
}
])
}, {
name: 'Sprites',
color: 'violet',
blocks: filterblocks([
{
block: 't = new Turtle red',
title: 'Make a new turtle',
id: 'newturtle'
}, {
block: 's = new Sprite',
title: 'Make a blank sprite',
id: 'newsprite'
}, {
block: 'p = new Piano',
title: 'Make a visible instrument',
id: 'newpiano'
}, {
block: 'q = new Pencil',
title: 'Make an invisible and fast drawing sprite'
}
])
}, {
name: 'Sound',
color: 'violet',
blocks: filterblocks([
{
block: 'p.play \'CDEDC\'',
title: 'Play and show music notes'
}
])
}, {
name: 'Snippets',
color: 'yellow',
blocks: filterblocks([
{
block: "tick 10, ->\n if pressed 'W'\n fd 2",
title: 'Poll a key and move while it is depressed'
}, {
block: "click (e) ->\n moveto e",
title: 'Move to a location when document is clicked'
}
])
}
],
JAVASCRIPT_PALETTE: [
{
name: 'Draw',
color: 'blue',
blocks: [
{
block: 'pen(red);',
title: 'Set the pen color'
}, {
block: 'fd(100);',
title: 'Move forward'
}, {
block: 'rt(90);',
title: 'Turn right'
}, {
block: 'lt(90);',
title: 'Turn left'
}, {
block: 'bk(100);',
title: 'Move backward'
}, {
block: 'speed(10);',
title: 'Set the speed of the turtle'
}, {
block: 'dot(blue, 50);',
title: 'Make a dot'
}, {
block: 'box(green, 50);',
title: 'Make a square'
}, {
block: 'write(\'hello\');',
title: 'Write text on the screen'
}, {
block: 'label(\'hello\');',
title: 'Write text at the turtle'
}, {
block: 'ht();',
title: 'Hide the turtle'
}, {
block: 'st();',
title: 'Show the turtle'
}, {
block: 'pu();',
title: 'Pick the pen up'
}, {
block: 'pd();',
title: 'Put the pen down'
}, {
block: 'pen(purple, 10);',
title: 'Set the pen color and thickness'
}, {
block: 'rt(180, 100);',
title: 'Make a wide right turn'
}, {
block: 'lt(180, 100);',
title: 'Make a wide left turn'
}, {
block: 'slide(100, 20);',
title: 'Slide sideways or diagonally'
}, {
block: 'jump(100, 20);',
title: 'Jump without drawing'
}, {
block: 'play(\'GEC\');',
title: 'Play music notes'
}, {
block: 'wear(\'/img/cat-icon\');',
title: 'Change the turtle image'
}
]
}, {
name: 'Control',
color: 'orange',
blocks: [
{
block: 'for (var i = 0; i < 4; i++) {\n __;\n}',
title: 'Do something multiple times'
}, {
block: 'if (__) {\n __;\n}',
title: 'Do something only if a condition is true'
}, {
block: 'if (__) {\n __;\n} else {\n __;\n}',
title: 'Do something if a condition is true, otherwise do something else'
}, {
block: 'while (__) {\n __;\n}',
title: 'Repeat something while a condition is true'
}
]
}, {
name: 'Math',
color: 'green',
blocks: [
{
block: 'var x = __;',
title: 'Create a variable for the first time'
}, {
block: 'x = __;',
title: 'Reassign a variable'
}, {
block: '__ + __',
title: 'Add two numbers'
}, {
block: '__ - __',
title: 'Subtract two numbers'
}, {
block: '__ * __',
title: 'Multiply two numbers'
}, {
block: '__ / __',
title: 'Divide two numbers'
}, {
block: '__ === __',
title: 'Compare two numbers'
}, {
block: '__ > __',
title: 'Compare two numbers'
}, {
block: '__ < __',
title: 'Compare two numbers'
}, {
block: 'random(1, 100)',
<<<<<<<
block: 'read \'?\', (x) ->\n write x',
=======
block: 'say \'Try this.\'',
title: 'Speak text aloud'
}, {
block: 'read \'Name?\', (n) ->\n write \'Hello\' + n',
>>>>>>>
block: 'read \'?\', (x) ->\n write x',
<<<<<<<
=======
}, {
block: 'd = write \'dice\'',
title: 'Remember d as a text element',
id: 'writevar'
}, {
block: 'forever 1, ->\n d.text random [1..6]',
title: 'Change d text content',
id: 'forevertext'
>>>>>>>
<<<<<<<
=======
block: 't.fd 100',
title: 'Move turtle t forward',
id: 'objfd'
}, {
block: 't.rt 90',
title: 'Turn turtle t right',
id: 'objrt'
}, {
block: 't.lt 90',
title: 'Turn turtle t left',
id: 'objlt'
}, {
block: 't.bk 100',
title: 'Move turtle t backward',
id: 'objbk'
}, {
>>>>>>>
<<<<<<<
=======
block: 's.wear \'/img/dragon\'',
title: 'Load an image in sprite s',
id: 'objwear'
}, {
block: 'drawon s',
title: 'Draw on sprite s'
}, {
block: 'drawon document',
title: 'Draw on the document'
}, {
>>>>>>>
<<<<<<<
=======
block: 'p.play \'CDEDC\'',
title: 'Play and show music notes',
id: 'objplay'
}, {
>>>>>>> |
<<<<<<<
...Portal.propTypes,
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.element,
]).isRequired,
=======
onOpen: PropTypes.func,
>>>>>>>
...Portal.propTypes,
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.element,
]).isRequired,
onOpen: PropTypes.func,
<<<<<<<
const { children } = this.props;
=======
if (!ExecutionEnvironment.canUseDOM) return null;
>>>>>>>
const { children } = this.props;
if (!ExecutionEnvironment.canUseDOM) return null;
<<<<<<<
const pickProps = pick(this.props, keysPortalPropTypes);
return (
<Portal
{...pickProps}
isOpened={this.props.visible}
onOpen={this._handleOpen}
>
=======
return !this.props.visible ? null : (
<Portal>
>>>>>>>
return !this.props.visible ? null : (
<Portal> |
<<<<<<<
var waiting = this.props.waiting ? <WaitingForUser /> : null;
return (
<AvatarBlankWrapper key={this.props.key}>
<div className="row" style={{height:"100%"}}>
<div className="col-xs-12 text-center inviteNewperson" style={{backgroundColor:bgcolor, height:"100%", position: "relative"}}>
{inviteOrWait}
</div>
</div>
</AvatarBlankWrapper>
);
}
});
=======
// <AvatarBlankWrapper key={this.props.key}>
>>>>>>>
// <AvatarBlankWrapper key={this.props.key}>
<<<<<<<
<div className="col-xs-12 invitePlusbtn" style={{position: "absolute", left:"0", top:"20%", fontSize: "40px", cursor: "pointer"}} onClick={this.clickInvite}>+</div>
=======
<div style={{fontSize: "50", lineHeight:"100px"}} onClick={this.clickInvite}>+
</div>
>>>>>>>
<div style={{fontSize: "50", lineHeight:"100px"}} onClick={this.clickInvite}>+
</div>
<<<<<<<
=======
console.log("waiting:",blankId,waiting);
>>>>>>> |
<<<<<<<
=======
viewer.channel;
viewer.draw = function() {
>>>>>>>
<<<<<<<
if (!pick) {
$('#zoom').text('currentZoom is ' + currentZoom);
$('#rot').text('currentRotation is ' + currentRotationX.toFixed(2) + ',' + currentRotationY.toFixed(2));
}
=======
$('#zoom').text('currentZoom is ' + viewer.currentZoom);
$('#rot').text('currentRotation is ' + viewer.currentRotationX.toFixed(2) + ',' + viewer.currentRotationY.toFixed(2));
>>>>>>>
if (!pick) {
$('#zoom').text('currentZoom is ' + viewer.currentZoom);
$('#rot').text('currentRotation is ' + viewer.currentRotationX.toFixed(2) + ',' + viewer.currentRotationY.toFixed(2));
}
<<<<<<<
if (pick)
Channel.clear(channel, [0,0,0,0]);
else
Channel.clear(channel, [0,0,0,0]); // transparent background - so we see through the canvas
=======
Channel.clear(viewer.channel, 1., 0., 0., 1.); // red opaque
>>>>>>>
if (pick)
Channel.clear(viewer.channel, [0,0,0,0]);
else
Channel.clear(viewer.channel, [0,0,0,0]); // transparent background - so we see through the canvas |
<<<<<<<
this.forceMatch = this.options.forceMatch
=======
this.placeholder = this.options.placeholder || this.placeholder
this.$element.attr('placeholder', this.placeholder)
>>>>>>>
this.forceMatch = this.options.forceMatch
this.placeholder = this.options.placeholder || this.placeholder
this.$element.attr('placeholder', this.placeholder)
<<<<<<<
, forceMatch: false
=======
, placeholder: null
>>>>>>>
, forceMatch: false
, placeholder: null |
<<<<<<<
=======
<div className="sc-user-input--button"></div>
<div className="sc-user-input--button">
{this.props.showEmoji && <EmojiIcon onEmojiPicked={this._handleEmojiPicked.bind(this)} />}
</div>
>>>>>>>
<div className="sc-user-input--button"></div>
<div className="sc-user-input--button">
{this.props.showEmoji && <EmojiIcon onEmojiPicked={this._handleEmojiPicked.bind(this)} />}
</div>
<<<<<<<
onFilesSelected: PropTypes.func.isRequired
=======
showEmoji: PropTypes.bool
>>>>>>>
onFilesSelected: PropTypes.func.isRequired
showEmoji: PropTypes.bool |
<<<<<<<
export class UIButton extends React.Component {
=======
class UIButton extends React.Component {
>>>>>>>
export class UIButton extends React.Component {
<<<<<<<
small: React.PropTypes.bool
}
=======
small: React.PropTypes.bool,
icon: React.PropTypes.node
};
>>>>>>>
small: React.PropTypes.bool,
icon: React.PropTypes.node
};
<<<<<<<
};
export const DefaultButton = defButton({kind: 'default'});
export const PrimaryButton = defButton({kind: 'primary'});
export const DangerButton = defButton({kind: 'danger'});
export const BrandButton = defButton({kind: 'brand'});
=======
}
module.exports = {
UIButton,
DefaultButton: defButton({kind: 'default'}),
DangerButton: defButton({kind: 'danger'}),
PrimaryButton: defButton({kind: 'primary'}),
BrandButton: defButton({kind: 'brand'})
};
>>>>>>>
}
export const DefaultButton = defButton({kind: 'default'});
export const PrimaryButton = defButton({kind: 'primary'});
export const DangerButton = defButton({kind: 'danger'});
export const BrandButton = defButton({kind: 'brand'}); |
<<<<<<<
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "select:not(:jqmData(role='slider'))"
=======
preventFocusZoom: true,
initSelector: "select:not(:jqmData(role='slider'))",
mini: false
>>>>>>>
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "select:not(:jqmData(role='slider'))",
mini: false |
<<<<<<<
_toggleClasses: function( destination, varNameForOldClasses, newClasses ) {
if ( this[ varNameForOldClasses ] !== newClasses ) {
if ( this[ varNameForOldClasses ] ) {
destination.removeClass( this[ varNameForOldClasses ] );
this[ varNameForOldClasses ] = "";
}
if ( newClasses ) {
this[ varNameForOldClasses ] = newClasses;
destination.addClass( newClasses );
}
}
return this;
},
=======
// FIXME: These have to stay in place until we're running on a version of
// the widget factory that does enable()/disable() via _setOptions, as in
// https://github.com/jquery/jquery-ui/pull/1024
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
>>>>>>>
_toggleClasses: function( destination, varNameForOldClasses, newClasses ) {
if ( this[ varNameForOldClasses ] !== newClasses ) {
if ( this[ varNameForOldClasses ] ) {
destination.removeClass( this[ varNameForOldClasses ] );
this[ varNameForOldClasses ] = "";
}
if ( newClasses ) {
this[ varNameForOldClasses ] = newClasses;
destination.addClass( newClasses );
}
}
return this;
},
// FIXME: These have to stay in place until we're running on a version of
// the widget factory that does enable()/disable() via _setOptions, as in
// https://github.com/jquery/jquery-ui/pull/1024
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
}, |
<<<<<<<
=======
// Load a page into the DOM.
$.mobile.loadPage = function( url, options ) {
// This function uses deferred notifications to let callers
// know when the page is done loading, or if an error has occurred.
var deferred = $.Deferred(),
// The default loadPage options with overrides specified by
// the caller.
settings = $.extend( {}, $.mobile.loadPage.defaults, options ),
// The DOM element for the page after it has been loaded.
page = null,
// If the reloadPage option is true, and the page is already
// in the DOM, dupCachedPage will be set to the page element
// so that it can be removed after the new version of the
// page is loaded off the network.
dupCachedPage = null,
// The absolute version of the URL passed into the function. This
// version of the URL may contain dialog/subpage params in it.
absUrl = path.makeUrlAbsolute( url, findBaseWithDefault() ),
fileUrl, dataUrl,
mpc, pblEvent, triggerData,
loadMsgDelay, hideMsg;
// If the caller provided data, and we're using "get" request,
// append the data to the URL.
if ( settings.data && settings.type === "get" ) {
absUrl = path.addSearchParams( absUrl, settings.data );
settings.data = undefined;
}
// If the caller is using a "post" request, reloadPage must be true
if ( settings.data && settings.type === "post" ) {
settings.reloadPage = true;
}
// The absolute version of the URL minus any dialog/subpage params.
// In otherwords the real URL of the page to be loaded.
fileUrl = path.getFilePath( absUrl );
// The version of the Url actually stored in the data-url attribute of
// the page. For embedded pages, it is just the id of the page. For pages
// within the same domain as the document base, it is the site relative
// path. For cross-domain pages (Phone Gap only) the entire absolute Url
// used to load the page.
dataUrl = path.convertUrlToDataUrl( absUrl );
// Make sure we have a pageContainer to work with.
settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
// Check to see if the page already exists in the DOM.
// NOTE do _not_ use the :jqmData psuedo selector because parenthesis
// are a valid url char and it breaks on the first occurence
page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
// If we failed to find the page, check to see if the url is a
// reference to an embedded page. If so, it may have been dynamically
// injected by a developer, in which case it would be lacking a data-url
// attribute and in need of enhancement.
if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
page = settings.pageContainer.children( path.hashToSelector( "#" + dataUrl ) )
.attr( "data-" + $.mobile.ns + "url", dataUrl )
.jqmData( "url", dataUrl );
}
// If we failed to find a page in the DOM, check the URL to see if it
// refers to the first page in the application. If it isn't a reference
// to the first page and refers to non-existent embedded page, error out.
if ( page.length === 0 ) {
if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
// Check to make sure our cached-first-page is actually
// in the DOM. Some user deployed apps are pruning the first
// page from the DOM for various reasons, we check for this
// case here because we don't want a first-page with an id
// falling through to the non-existent embedded page error
// case. If the first-page is not in the DOM, then we let
// things fall through to the ajax loading code below so
// that it gets reloaded.
if ( $.mobile.firstPage.parent().length ) {
page = $( $.mobile.firstPage );
}
} else if ( path.isEmbeddedPage( fileUrl ) ) {
deferred.reject( absUrl, options );
return deferred.promise();
}
}
// Reset base to the default document base.
base.reset();
// If the page we are interested in is already in the DOM,
// and the caller did not indicate that we should force a
// reload of the file, we are done. Otherwise, track the
// existing page as a duplicated.
if ( page.length ) {
if ( !settings.reloadPage ) {
enhancePage( page, settings.role );
deferred.resolve( absUrl, options, page );
//if we are reloading the page make sure we update the base if its not a prefetch
if( base && !options.prefetch ){
base.set(url);
}
return deferred.promise();
}
dupCachedPage = page;
}
mpc = settings.pageContainer;
pblEvent = new $.Event( "pagebeforeload" );
triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings };
// Let listeners know we're about to load a page.
mpc.trigger( pblEvent, triggerData );
// If the default behavior is prevented, stop here!
if ( pblEvent.isDefaultPrevented() ) {
return deferred.promise();
}
if ( settings.showLoadMsg ) {
// This configurable timeout allows cached pages a brief delay to load without showing a message
loadMsgDelay = setTimeout(function() {
$.mobile.showPageLoadingMsg();
}, settings.loadMsgDelay ),
// Shared logic for clearing timeout and removing message.
hideMsg = function() {
// Stop message show timer
clearTimeout( loadMsgDelay );
// Hide loading message
$.mobile.hidePageLoadingMsg();
};
}
// Reset base to the default document base.
// only reset if we are not prefetching
if ( base && ( typeof options === "undefined" || typeof options.prefetch === "undefined" ) ) {
base.reset();
}
if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) {
deferred.reject( absUrl, options );
} else {
// Load the new page.
$.ajax({
url: fileUrl,
type: settings.type,
data: settings.data,
contentType: settings.contentType,
dataType: "html",
success: function( html, textStatus, xhr ) {
//pre-parse html to check for a data-url,
//use it as the new fileUrl, base path, etc
var all = $( "<div></div>" ),
//page title regexp
newPageTitle = html.match( /<title[^>]*>([^<]*)/ ) && RegExp.$1,
// TODO handle dialogs again
pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ),
dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" );
// data-url must be provided for the base tag so resource requests can be directed to the
// correct url. loading into a temprorary element makes these requests immediately
if ( pageElemRegex.test( html ) &&
RegExp.$1 &&
dataUrlRegex.test( RegExp.$1 ) &&
RegExp.$1 ) {
url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
}
//dont update the base tag if we are prefetching
if ( base && ( typeof options === "undefined" || typeof options.prefetch === "undefined" )) {
base.set( fileUrl );
}
//workaround to allow scripts to execute when included in page divs
all.get( 0 ).innerHTML = html;
page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
//if page elem couldn't be found, create one and insert the body element's contents
if ( !page.length ) {
page = $( "<div data-" + $.mobile.ns + "role='page'>" + ( html.split( /<\/?body[^>]*>/gmi )[1] || "" ) + "</div>" );
}
if ( newPageTitle && !page.jqmData( "title" ) ) {
if ( ~newPageTitle.indexOf( "&" ) ) {
newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
}
page.jqmData( "title", newPageTitle );
}
base.rewrite( fileUrl, page );
//append to page and enhance
// TODO taging a page with external to make sure that embedded pages aren't removed
// by the various page handling code is bad. Having page handling code in many
// places is bad. Solutions post 1.0
page
.attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
.attr( "data-" + $.mobile.ns + "external-page", true )
.appendTo( settings.pageContainer );
// wait for page creation to leverage options defined on widget
page.one( "pagecreate", $.mobile._bindPageRemove );
enhancePage( page, settings.role );
// Enhancing the page may result in new dialogs/sub pages being inserted
// into the DOM. If the original absUrl refers to a sub-page, that is the
// real page we are interested in.
if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
}
// Remove loading message.
if ( settings.showLoadMsg ) {
hideMsg();
}
// Add the page reference and xhr to our triggerData.
triggerData.xhr = xhr;
triggerData.textStatus = textStatus;
triggerData.page = page;
// Let listeners know the page loaded successfully.
settings.pageContainer.trigger( "pageload", triggerData );
deferred.resolve( absUrl, options, page, dupCachedPage );
},
error: function( xhr, textStatus, errorThrown ) {
//set base back to current path
base.set( path.get() );
// Add error info to our triggerData.
triggerData.xhr = xhr;
triggerData.textStatus = textStatus;
triggerData.errorThrown = errorThrown;
var plfEvent = new $.Event( "pageloadfailed" );
// Let listeners know the page load failed.
settings.pageContainer.trigger( plfEvent, triggerData );
// If the default behavior is prevented, stop here!
// Note that it is the responsibility of the listener/handler
// that called preventDefault(), to resolve/reject the
// deferred object within the triggerData.
if ( plfEvent.isDefaultPrevented() ) {
return;
}
// Remove loading message.
if ( settings.showLoadMsg ) {
// Remove loading message.
hideMsg();
// show error message
$.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true );
// hide after delay
setTimeout( $.mobile.hidePageLoadingMsg, 1500 );
}
deferred.reject( absUrl, options );
}
});
}
return deferred.promise();
};
$.mobile.loadPage.defaults = {
type: "get",
data: undefined,
reloadPage: false,
role: undefined, // By default we rely on the role defined by the @data-role attribute.
showLoadMsg: false,
pageContainer: undefined,
loadMsgDelay: 50 // This delay allows loads that pull from browser cache to occur without showing the loading message.
};
>>>>>>> |
<<<<<<<
for ( var i = 0; i < $workingSet.length; i++ ) {
var el = $workingSet.eq( i ),
e = el[ 0 ],
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
icon: options.icon !== undefined ? options.icon : getAttrFixed( e, nsKey + "icon" ),
iconpos: options.iconpos !== undefined ? options.iconpos : getAttrFixed( e, nsKey + "iconpos" ),
theme: options.theme !== undefined ? options.theme : getAttrFixed( e, nsKey + "theme" ) || $.mobile.getInheritedTheme( el, "a" ),
inline: options.inline !== undefined ? options.inline : getAttrFixed( e, nsKey + "inline" ),
shadow: options.shadow !== undefined ? options.shadow : getAttrFixed( e, nsKey + "shadow" ),
corners: options.corners !== undefined ? options.corners : getAttrFixed( e, nsKey + "corners" ),
iconshadow: options.iconshadow !== undefined ? options.iconshadow : getAttrFixed( e, nsKey + "iconshadow" ),
mini: options.mini !== undefined ? options.mini : getAttrFixed( e, nsKey + "mini" )
}, options ),
// Classes Defined
innerClass = "ui-btn-inner",
textClass = "ui-btn-text",
buttonClass, iconClass,
hover = false,
state = "up",
// Button inner markup
buttonInner,
buttonText,
buttonIcon,
buttonElements;
=======
for ( i = 0; i < $workingSet.length; i++ ) {
el = $workingSet.eq( i );
e = el[ 0 ];
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
icon: options.icon !== undefined ? options.icon : getAttrFixed( e, "icon", true ),
iconpos: options.iconpos !== undefined ? options.iconpos : getAttrFixed( e, "iconpos", true ),
theme: options.theme !== undefined ? options.theme : getAttrFixed( e, "theme", true ) || $.mobile.getInheritedTheme( el, "c" ),
inline: options.inline !== undefined ? options.inline : getAttrFixed( e, "inline", true ),
shadow: options.shadow !== undefined ? options.shadow : getAttrFixed( e, "shadow", true ),
corners: options.corners !== undefined ? options.corners : getAttrFixed( e, "corners", true ),
iconshadow: options.iconshadow !== undefined ? options.iconshadow : getAttrFixed( e, "iconshadow", true ),
mini: options.mini !== undefined ? options.mini : getAttrFixed( e, "mini", true )
}, options );
innerClass = "ui-btn-inner";
textClass = "ui-btn-text";
hover = false;
state = "up";
>>>>>>>
for ( i = 0; i < $workingSet.length; i++ ) {
el = $workingSet.eq( i );
e = el[ 0 ];
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
icon: options.icon !== undefined ? options.icon : getAttrFixed( e, "icon", true ),
iconpos: options.iconpos !== undefined ? options.iconpos : getAttrFixed( e, "iconpos", true ),
theme: options.theme !== undefined ? options.theme : getAttrFixed( e, "theme", true ) || $.mobile.getInheritedTheme( el, "a" ),
inline: options.inline !== undefined ? options.inline : getAttrFixed( e, "inline", true ),
shadow: options.shadow !== undefined ? options.shadow : getAttrFixed( e, "shadow", true ),
corners: options.corners !== undefined ? options.corners : getAttrFixed( e, "corners", true ),
iconshadow: options.iconshadow !== undefined ? options.iconshadow : getAttrFixed( e, "iconshadow", true ),
mini: options.mini !== undefined ? options.mini : getAttrFixed( e, "mini", true )
}, options );
innerClass = "ui-btn-inner";
textClass = "ui-btn-text";
hover = false;
state = "up"; |
<<<<<<<
function(){
=======
function() {
>>>>>>>
function() {
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
asyncTest( "loading an embeded page with query params works", function() {
$.testHelper.pageSequence([
function() {
$.mobile.changePage( "#bar?baz=bak", { dataUrl: false } );
},
function() {
ok( location.hash.indexOf( "bar?baz=bak" ) >= -1, "the hash is targeted at the page to be loaded" );
ok( $.mobile.activePage.attr( "id" ), "bar", "the correct page is loaded" );
start();
}
]);
});
asyncTest( "external page is accessed correctly even if it has a space in the url", function(){
$.testHelper.pageSequence([
function(){
$.mobile.changePage( " external.html" );
},
function(){
equal( $.mobile.activePage.attr( "id" ), "external-test", "the correct page is loaded" );
start();
}
]);
});
=======
asyncTest( "loading an embeded page with query params works", function() {
$.testHelper.pageSequence([
function() {
$.mobile.changePage( "#bar?baz=bak", { dataUrl: false } );
},
function() {
ok( location.hash.indexOf( "bar?baz=bak" ) >= -1, "the hash is targeted at the page to be loaded" );
ok( $.mobile.activePage.attr( "id" ), "bar", "the correct page is loaded" );
start();
}
]);
});
var absHomeUrl = $.mobile.path.parseLocation().hrefNoHash,
homeDomain = $.mobile.path.parseLocation().domain;
asyncTest( "page load events are providided with the absolute url for the content", function() {
var requestPath;
expect( 3 );
$( document ).one( "pagebeforechange", function( event, data ) {
equal( data.absUrl, absHomeUrl + "#bar");
});
$( document ).one( "pagechange", function( event, data ) {
equal( data.absUrl, absHomeUrl + "#bar" );
});
$.mobile.changePage( "#bar" );
requestPath = "/theres/no/way/this/page/exists.html";
$( document ).one( "pagechangefailed", function( event, data ) {
equal( data.absUrl, homeDomain + requestPath );
start();
});
$.mobile.changePage( requestPath );
});
>>>>>>>
asyncTest( "loading an embeded page with query params works", function() {
$.testHelper.pageSequence([
function() {
$.mobile.changePage( "#bar?baz=bak", { dataUrl: false } );
},
function() {
ok( location.hash.indexOf( "bar?baz=bak" ) >= -1, "the hash is targeted at the page to be loaded" );
ok( $.mobile.activePage.attr( "id" ), "bar", "the correct page is loaded" );
start();
}
]);
});
asyncTest( "external page is accessed correctly even if it has a space in the url", function(){
$.testHelper.pageSequence([
function(){
$.mobile.changePage( " external.html" );
},
function(){
equal( $.mobile.activePage.attr( "id" ), "external-test", "the correct page is loaded" );
start();
}
]);
});
var absHomeUrl = $.mobile.path.parseLocation().hrefNoHash,
homeDomain = $.mobile.path.parseLocation().domain;
asyncTest( "page load events are providided with the absolute url for the content", function() {
var requestPath;
expect( 3 );
$( document ).one( "pagebeforechange", function( event, data ) {
equal( data.absUrl, absHomeUrl + "#bar");
});
$( document ).one( "pagechange", function( event, data ) {
equal( data.absUrl, absHomeUrl + "#bar" );
});
$.mobile.changePage( "#bar" );
requestPath = "/theres/no/way/this/page/exists.html";
$( document ).one( "pagechangefailed", function( event, data ) {
equal( data.absUrl, homeDomain + requestPath );
start();
});
$.mobile.changePage( requestPath );
}); |
<<<<<<<
_toggleClasses: function( destination, varNameForOldClasses, newClasses ) {
if ( this[ varNameForOldClasses ] !== newClasses ) {
if ( this[ varNameForOldClasses ] ) {
destination.removeClass( this[ varNameForOldClasses ] );
this[ varNameForOldClasses ] = "";
}
if ( newClasses ) {
this[ varNameForOldClasses ] = newClasses;
destination.addClass( newClasses );
}
}
return this;
},
=======
// FIXME: These have to stay in place until we're running on a version of
// the widget factory that does enable()/disable() via _setOptions, as in
// https://github.com/jquery/jquery-ui/pull/1024
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
>>>>>>>
_toggleClasses: function( destination, varNameForOldClasses, newClasses ) {
if ( this[ varNameForOldClasses ] !== newClasses ) {
if ( this[ varNameForOldClasses ] ) {
destination.removeClass( this[ varNameForOldClasses ] );
this[ varNameForOldClasses ] = "";
}
if ( newClasses ) {
this[ varNameForOldClasses ] = newClasses;
destination.addClass( newClasses );
}
}
return this;
},
// FIXME: These have to stay in place until we're running on a version of
// the widget factory that does enable()/disable() via _setOptions, as in
// https://github.com/jquery/jquery-ui/pull/1024
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
}, |
<<<<<<<
},
//create a string for ID/subpage url creation
_idStringEscape: function( str ) {
return str.replace(/[^a-zA-Z0-9]/g, "-");
},
_createSubPages: function() {
var parentList = this.element,
parentPage = parentList.closest( ".ui-page" ),
parentUrl = getAttr( parentPage[ 0 ], "url", true ),
parentId = parentUrl || parentPage[ 0 ][ $.expando ],
parentListId = parentList.attr( "id" ),
o = this.options,
dns = "data-" + $.mobile.ns,
self = this,
persistentFooter = parentPage.find( ":jqmData(role='footer')" ),
persistentFooterID = ( persistentFooter.length > 0 ? getAttr( persistentFooter[ 0 ], "id", true ) : undefined ),
hasSubPages,
newRemove = function( e, ui ) {
var nextPage = ui.nextPage, npURL,
prEvent = new $.Event( "pageremove" );
if ( ui.nextPage ) {
npURL = getAttr( nextPage[ 0 ], "url", true );
if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
self.childPages().remove();
parentPage.trigger( prEvent );
if ( !prEvent.isDefaultPrevented() ) {
parentPage.removeWithDependents();
}
}
}
};
if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
listCountPerPage[ parentId ] = -1;
}
parentListId = parentListId || ++listCountPerPage[ parentId ];
$( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
var list = $( this ),
listId = list.attr( "id" ) || parentListId + "-" + i,
parent = list.parent(),
nodeElsFull = $( list.prevAll().toArray().reverse() ),
nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
theme = getAttr( list[ 0 ], "theme", true ) || o.theme,
countTheme = getAttr( list[ 0 ], "counttheme", true ) || getAttr( parentList[ 0 ], "counttheme", true ) || o.countTheme,
newPage, anchor;
//define hasSubPages for use in later removal
hasSubPages = true;
newPage = list.detach()
.wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
.parent()
.before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
.after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )
.parent()
.appendTo( $.mobile.pageContainer );
newPage.page();
anchor = parent.find( "a:first" );
if ( !anchor.length ) {
anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
}
anchor.attr( "href", "#" + id );
}).listview();
// on pagehide, remove any nested pages along with the parent page, as long as they aren't active
// and aren't embedded
if ( hasSubPages &&
parentPage.is( ":jqmData(external-page='true')" ) &&
parentPage.data( "mobile-page" ).options.domCache === false ) {
// unbind the original page remove and replace with our specialized version
parentPage
.unbind( "pagehide.remove" )
.page( "bindRemove", newRemove );
}
},
// TODO sort out a better way to track sub pages of the listview this is brittle
childPages: function() {
var parentUrl = this.parentPage.jqmData( "url" );
return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
}
}, $.mobile.behaviors.addFirstLastClasses ) );
=======
}}, $.mobile.behaviors.addFirstLastClasses ) );
>>>>>>>
}
}, $.mobile.behaviors.addFirstLastClasses ) ); |
<<<<<<<
=======
findNativeByFiberID: (id: number) => ?Array<NativeType>,
>>>>>>>
<<<<<<<
getCommitDetails: (rootID: number, commitIndex: number) => CommitDetails,
getFiberCommits: (rootID: number, fiberID: number) => FiberCommits,
getInteractions: (rootID: number) => Interactions,
getInternalIDFromNative: GetInternalIDFromNative,
getNativeFromInternal: GetNativeFromInternal,
getProfilingDataForDownload: (rootID: number) => Object,
getProfilingSummary: (rootID: number) => ProfilingSummary,
handleCommitFiberRoot: (fiber: Object) => void,
=======
getBestMatchForTrackedPath: () => PathMatch | null,
getFiberIDFromNative: (
component: NativeType,
findNearestUnfilteredAncestor?: boolean
) => number | null,
getProfilingData(): ProfilingDataBackend,
getOwnersList: (id: number) => Array<Owner> | null,
getPathForElement: (id: number) => Array<PathFrame> | null,
handleCommitFiberRoot: (fiber: Object, commitPriority?: number) => void,
>>>>>>>
getBestMatchForTrackedPath: () => PathMatch | null,
getInternalIDFromNative: GetInternalIDFromNative,
getNativeFromInternal: GetNativeFromInternal,
getProfilingData(): ProfilingDataBackend,
getOwnersList: (id: number) => Array<Owner> | null,
getPathForElement: (id: number) => Array<PathFrame> | null,
handleCommitFiberRoot: (fiber: Object, commitPriority?: number) => void,
<<<<<<<
=======
setInProps: (id: number, path: Array<string | number>, value: any) => void,
setInState: (id: number, path: Array<string | number>, value: any) => void,
setTrackedPath: (path: Array<PathFrame> | null) => void,
>>>>>>>
setInProps: (id: number, path: Array<string | number>, value: any) => void,
setInState: (id: number, path: Array<string | number>, value: any) => void,
setTrackedPath: (path: Array<PathFrame> | null) => void, |
<<<<<<<
} from 'src/devtools/types';
import { getDisplayName, getUID, utfEncodeString } from '../utils';
=======
} from 'src/types';
import {
getDisplayName,
getDefaultComponentFilters,
getUID,
utfEncodeString,
} from 'src/utils';
>>>>>>>
} from 'src/types';
import {
getDisplayName,
getDefaultComponentFilters,
getUID,
utfEncodeString,
} from 'src/utils';
<<<<<<<
function getDataForFiber(fiber: Fiber): FiberData {
const { elementType, type, key, tag } = fiber;
=======
// NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
function getDisplayNameForFiber(fiber: Fiber): string | null {
const { elementType, type, tag } = fiber;
>>>>>>>
// NOTICE Keep in sync with shouldFilterFiber() and other get*ForFiber methods
function getDisplayNameForFiber(fiber: Fiber): string | null {
const { elementType, type, tag } = fiber;
<<<<<<<
function getNativeFromInternal(id: number) {
=======
function findAllCurrentHostFibers(id: number): $ReadOnlyArray<Fiber> {
const fibers = [];
const fiber = findCurrentFiberUsingSlowPathById(id);
if (!fiber) {
return fibers;
}
// Next we'll drill down this component to find all HostComponent/Text.
let node: Fiber = fiber;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
fibers.push(node);
} else if (node.child) {
node.child.return = node;
node = node.child;
continue;
}
if (node === fiber) {
return fibers;
}
while (!node.sibling) {
if (!node.return || node.return === fiber) {
return fibers;
}
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
// Flow needs the return here, but ESLint complains about it.
// eslint-disable-next-line no-unreachable
return fibers;
}
function findNativeByFiberID(id: number) {
>>>>>>>
function findAllCurrentHostFibers(id: number): $ReadOnlyArray<Fiber> {
const fibers = [];
const fiber = findCurrentFiberUsingSlowPathById(id);
if (!fiber) {
return fibers;
}
// Next we'll drill down this component to find all HostComponent/Text.
let node: Fiber = fiber;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
fibers.push(node);
} else if (node.child) {
node.child.return = node;
node = node.child;
continue;
}
if (node === fiber) {
return fibers;
}
while (!node.sibling) {
if (!node.return || node.return === fiber) {
return fibers;
}
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
// Flow needs the return here, but ESLint complains about it.
// eslint-disable-next-line no-unreachable
return fibers;
}
function getNativeFromInternal(id: number) {
<<<<<<<
const nativeNode = getNativeFromInternal(id);
if (nativeNode !== null) {
console.log('Node:', nativeNode);
=======
const nativeNodes = findNativeByFiberID(id);
if (nativeNodes !== null) {
console.log('Nodes:', nativeNodes);
>>>>>>>
const nativeNodes = getNativeFromInternal(id);
if (nativeNodes !== null) {
console.log('Nodes:', nativeNodes);
<<<<<<<
getCommitDetails,
getInternalIDFromNative,
getFiberCommits,
getInteractions,
getNativeFromInternal,
getProfilingDataForDownload,
getProfilingSummary,
=======
getBestMatchForTrackedPath,
getFiberIDFromNative,
findNativeByFiberID,
getOwnersList,
getPathForElement,
getProfilingData,
>>>>>>>
getBestMatchForTrackedPath,
getInternalIDFromNative,
getNativeFromInternal,
getOwnersList,
getPathForElement,
getProfilingData, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.