conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
config: { redirect: 'second' },
router
=======
config: { redirect: 'second' },
router: new AppRouter(new Container(), new MockHistory(), new PipelineProvider(new Container()))
});
redirectSecondInstruction = new NavigationInstruction({
fragment: 'first/10',
queryString: 'q=1',
params: {id: 10},
config: { name:'first', route: 'first/:id', redirect: 'second/:id' },
router: new AppRouter(new Container(), new MockHistory(), new PipelineProvider(new Container()))
>>>>>>>
config: { redirect: 'second' },
router
});
redirectSecondInstruction = new NavigationInstruction({
fragment: 'first/10',
queryString: 'q=1',
params: {id: 10},
config: { name:'first', route: 'first/:id', redirect: 'second/:id' },
router: new AppRouter(new Container(), new MockHistory(), new PipelineProvider(new Container())) |
<<<<<<<
beforeEach( () => {
modelDoc = new ModelDocument();
modelRoot = modelDoc.createRoot();
modelSelection = modelDoc.selection;
modelDoc.schema.allow( { name: '$text', inside: '$root' } );
viewDoc = new ViewDocument();
viewRoot = viewDoc.createRoot( 'div' );
viewSelection = viewDoc.selection;
mapper = new Mapper();
mapper.bindElements( modelRoot, viewRoot );
dispatcher = new ModelConversionDispatcher( { mapper, viewSelection } );
dispatcher.on( 'insert:$text', insertText() );
dispatcher.on( 'addAttribute:bold', wrapItem( new ViewAttributeElement( 'strong' ) ) );
// Default selection converters.
dispatcher.on( 'selection', clearAttributes(), { priority: 'low' } );
dispatcher.on( 'selection', convertRangeSelection(), { priority: 'low' } );
dispatcher.on( 'selection', convertCollapsedSelection(), { priority: 'low' } );
} );
afterEach( () => {
viewDoc.destroy();
} );
describe( 'default converters', () => {
=======
>>>>>>>
<<<<<<<
describe( 'clearAttributes', () => {
it( 'should remove all ranges before adding new range', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrapItem( new ViewAttributeElement( 'b' ) ) );
=======
describe( 'clearAttributes', () => {
it( 'should remove all ranges before adding new range', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrap( new ViewAttributeElement( 'b' ) ) );
>>>>>>>
describe( 'clearAttributes', () => {
it( 'should remove all ranges before adding new range', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrapItem( new ViewAttributeElement( 'b' ) ) );
<<<<<<<
it( 'should do nothing if the attribute element had been already removed', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrapItem( new ViewAttributeElement( 'b' ) ) );
=======
it( 'should do nothing if the attribute element had been already removed', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrap( new ViewAttributeElement( 'b' ) ) );
>>>>>>>
it( 'should do nothing if the attribute element had been already removed', () => {
dispatcher.on( 'selectionAttribute:bold', convertSelectionAttribute( new ViewAttributeElement( 'b' ) ) );
dispatcher.on( 'addAttribute:style', wrapItem( new ViewAttributeElement( 'b' ) ) );
<<<<<<<
}
dispatcher.on( 'selectionAttribute:theme', convertSelectionAttribute( themeElementCreator ) );
dispatcher.on( 'addAttribute:theme', wrapItem( themeElementCreator ) );
dispatcher.on( 'selectionAttribute:italic', convertSelectionAttribute( new ViewAttributeElement( 'em' ) ) );
} );
=======
>>>>>>> |
<<<<<<<
<CustomSocketsDialog />
<InnerToolbar>
=======
<SocketsDialog />
<SocketsInnerToolbar>
>>>>>>>
<SocketsDialog />
<InnerToolbar> |
<<<<<<<
=======
moveDirectoryUp(depth) {
const { previousFolders, directoryDepth } = this.state;
const depthLevel = _.isFinite(depth) ? depth : 1;
this.setState({
directoryDepth: directoryDepth - depthLevel,
currentFolderName: previousFolders[directoryDepth - 1 - depthLevel] || '',
previousFolders: _.dropRight(previousFolders, depthLevel)
});
},
moveDirectoryDown(nextFolderName) {
const { directoryDepth, previousFolders } = this.state;
this.setState({
directoryDepth: directoryDepth + 1,
currentFolderName: nextFolderName,
previousFolders: [...previousFolders, nextFolderName]
});
},
>>>>>>>
<<<<<<<
const { directoryDepth, currentFolderName } = this.props;
=======
const { currentFolderName, directoryDepth, previousFolders } = this.state;
>>>>>>>
const { currentFolderName, directoryDepth, previousFolders } = this.props;
<<<<<<<
const { moveDirectoryUp } = this.props;
return (
<DotsListItem onClickDots={moveDirectoryUp} />
);
=======
return <DotsListItem onDotsClick={this.moveDirectoryUp} />;
>>>>>>>
const { moveDirectoryUp } = this.props;
return <DotsListItem onDotsClick={moveDirectoryUp} />; |
<<<<<<<
import { DialogsMixin, SnackbarNotificationMixin } from '../../mixins';
=======
import { FormMixin, SnackbarNotificationMixin } from '../../mixins';
>>>>>>>
import { DialogsMixin, FormMixin, SnackbarNotificationMixin } from '../../mixins';
<<<<<<<
DialogsMixin,
=======
FormMixin,
>>>>>>>
DialogsMixin,
FormMixin,
<<<<<<<
currentFileIndex,
errorResponses,
filesToUpload,
hideDialogs,
hostingDetails,
isUploading,
isCanceled,
isDeleting,
isLoading,
items,
lastFileIndex
=======
currentFileIndex,
currentFolderName,
directoryDepth,
errorResponses,
filesToUpload,
hideDialogs,
isDeleting,
isLoading,
isUploading,
items,
lastFileIndex,
previousFolders,
hostingDetails
>>>>>>>
currentFileIndex,
currentFolderName,
errorResponses,
filesToUpload,
hideDialogs,
hostingDetails,
isUploading,
isCanceled,
isDeleting,
isLoading,
items,
lastFileIndex,
directoryDepth,
previousFolders
<<<<<<<
<div>
<Show if={items.length && !isLoading}>
<RaisedButton
label="Upload files"
primary={true}
icon={<FontIcon className="synicon-cloud-upload" />}
style={{ marginRight: 10 }}
onTouchTap={this.handleShowUploadDialog}
/>
</Show>
=======
<div style={styles.buttonsWrapper}>
<Show if={items.length && !isLoading}>
{this.renderNewFolderButtons()}
</Show>
>>>>>>>
<Show if={items.length && !isLoading}>
<RaisedButton
label="Upload files"
primary={true}
icon={<FontIcon className="synicon-cloud-upload" />}
style={{ marginRight: 10 }}
onTouchTap={this.handleShowUploadDialog}
/>
</Show>
<div style={styles.buttonsWrapper}>
<Show if={items.length && !isLoading}>
{this.renderNewFolderButtons()}
</Show>
<<<<<<<
currentFileIndex={currentFileIndex}
currentInstanceName={currentInstanceName}
isCanceled={isCanceled}
isDeleting={isDeleting}
isUploading={isUploading}
isLoading={isLoading}
items={items}
errorResponses={errorResponses}
=======
currentFolderName={currentFolderName}
currentFileIndex={currentFileIndex}
currentInstanceName={currentInstanceName}
directoryDepth={directoryDepth}
>>>>>>>
currentFileIndex={currentFileIndex}
currentFolderName={currentFolderName}
currentInstanceName={currentInstanceName}
directoryDepth={directoryDepth}
errorResponses={errorResponses}
isCanceled={isCanceled}
isDeleting={isDeleting}
isUploading={isUploading}
isLoading={isLoading}
items={items}
<<<<<<<
handleClearFiles={this.handleClearFiles}
handleCancelUploading={HostingFilesActions.cancelUploading}
handleErrorsButtonClick={HostingFilesActions.finishUploading}
=======
errorResponses={errorResponses}
handleErrorsButtonClick={HostingFilesActions.finishUploading}
handleClearFiles={this.handleClearFiles}
>>>>>>>
handleClearFiles={this.handleClearFiles}
handleCancelUploading={HostingFilesActions.cancelUploading}
handleErrorsButtonClick={HostingFilesActions.finishUploading}
<<<<<<<
hideDialogs={hideDialogs}
lastFileIndex={lastFileIndex}
=======
hideDialogs={hideDialogs}
isDeleting={isDeleting}
isLoading={isLoading}
isUploading={isUploading}
items={items}
lastFileIndex={lastFileIndex}
moveDirectoryDown={this.moveDirectoryDown}
moveDirectoryUp={this.moveDirectoryUp}
previousFolders={previousFolders}
>>>>>>>
hideDialogs={hideDialogs}
lastFileIndex={lastFileIndex}
moveDirectoryDown={this.moveDirectoryDown}
moveDirectoryUp={this.moveDirectoryUp}
previousFolders={previousFolders} |
<<<<<<<
urlLabel="Hosting Socket"
=======
urlLabel="Hosting"
description={description}
docsUrl="http://docs.syncano.io/docs/"
actionButton={actionButton}
CLITitle="Use Syncano CLI"
CLIDescription="The best way to manage your hosting files is with "
bashSnippets={bashSnippets}
hostingDocsUrl="http://docs.syncano.io/docs/hosting"
hostingDocsButtonLabel="View Hosting Docs"
>>>>>>>
urlLabel="Hosting" |
<<<<<<<
const client = new hello_proto.Greeter(
=======
// start client and create credentials
const client = new hello_proto.Greeter(
>>>>>>>
// start client and create credentials
const client = new hello_proto.Greeter(
<<<<<<<
// set request value
let user;
// returns an array containing the command line arguments passed when the Node.js process was launched
// starts on 2 because process.argv contains the whole command-line invocation
// argv[0] and argv[1] will be node example.js
=======
// CLI prompt or hard code the variable for the message "name": "string"
let user;
>>>>>>>
// set request value
// CLI prompt or hard code the variable for the message "name": "string"
let user;
// returns an array containing the command line arguments passed when the Node.js process was launched
// starts on 2 because process.argv contains the whole command-line invocation
// argv[0] and argv[1] will be node example.js
<<<<<<<
=======
>>>>>>> |
<<<<<<<
it( 'change attribute of split element that reinserts from graveyard', () => {
const gy = doc.graveyard;
const splitDelta = new SplitDelta();
splitDelta.operations[ 0 ] = new ReinsertOperation(
new Position( gy, [ 1 ] ),
1,
new Position( root, [ 2 ] ),
baseVersion
);
splitDelta.operations[ 1 ] = new MoveOperation(
new Position( root, [ 1, 4 ] ),
4,
new Position( root, [ 2, 0 ] ),
baseVersion
);
const attributeDelta = new AttributeDelta();
const range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 0 ] ) );
attributeDelta.addOperation( new AttributeOperation( range, 'key', 'oldValue', 'newValue', baseVersion ) );
// The split delta was undone.
context.bWasUndone = true;
const transformed = transform( attributeDelta, splitDelta, context );
baseVersion = attributeDelta.operations.length;
// We expect only one delta. Split delta should not affect attribute delta transformation. It was undone.
expect( transformed.length ).to.equal( 1 );
expectDelta( transformed[ 0 ], {
type: AttributeDelta,
operations: [
{
type: AttributeOperation,
range,
key: 'key',
oldValue: 'oldValue',
newValue: 'newValue',
baseVersion
}
]
} );
} );
=======
it( 'should use default algorithm and not throw if split delta has NoOperation', () => {
const range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 2, 3 ] ) );
const attrDelta = getAttributeDelta( range, 'foo', null, 'bar', 0 );
const splitDelta = getSplitDelta( new Position( root, [ 0, 2 ] ), new Element( 'paragraph' ), 3, 0 );
splitDelta.operations[ 1 ] = new NoOperation( 1 );
const transformed = transform( attrDelta, splitDelta, context );
baseVersion = splitDelta.operations.length;
expect( transformed.length ).to.equal( 1 );
expectDelta( transformed[ 0 ], {
type: AttributeDelta,
operations: [
{
type: AttributeOperation,
range: new Range( new Position( root, [ 2 ] ), new Position( root, [ 3, 3 ] ) ),
key: 'foo',
oldValue: null,
newValue: 'bar',
baseVersion
}
]
} );
} );
>>>>>>>
it( 'change attribute of split element that reinserts from graveyard', () => {
const gy = doc.graveyard;
const splitDelta = new SplitDelta();
splitDelta.operations[ 0 ] = new ReinsertOperation(
new Position( gy, [ 1 ] ),
1,
new Position( root, [ 2 ] ),
baseVersion
);
splitDelta.operations[ 1 ] = new MoveOperation(
new Position( root, [ 1, 4 ] ),
4,
new Position( root, [ 2, 0 ] ),
baseVersion
);
const attributeDelta = new AttributeDelta();
const range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 0 ] ) );
attributeDelta.addOperation( new AttributeOperation( range, 'key', 'oldValue', 'newValue', baseVersion ) );
// The split delta was undone.
context.bWasUndone = true;
const transformed = transform( attributeDelta, splitDelta, context );
baseVersion = attributeDelta.operations.length;
// We expect only one delta. Split delta should not affect attribute delta transformation. It was undone.
expect( transformed.length ).to.equal( 1 );
expectDelta( transformed[ 0 ], {
type: AttributeDelta,
operations: [
{
type: AttributeOperation,
range,
key: 'key',
oldValue: 'oldValue',
newValue: 'newValue',
baseVersion
}
]
} );
} );
it( 'should use default algorithm and not throw if split delta has NoOperation', () => {
const range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 2, 3 ] ) );
const attrDelta = getAttributeDelta( range, 'foo', null, 'bar', 0 );
const splitDelta = getSplitDelta( new Position( root, [ 0, 2 ] ), new Element( 'paragraph' ), 3, 0 );
splitDelta.operations[ 1 ] = new NoOperation( 1 );
const transformed = transform( attrDelta, splitDelta, context );
baseVersion = splitDelta.operations.length;
expect( transformed.length ).to.equal( 1 );
expectDelta( transformed[ 0 ], {
type: AttributeDelta,
operations: [
{
type: AttributeOperation,
range: new Range( new Position( root, [ 2 ] ), new Position( root, [ 3, 3 ] ) ),
key: 'foo',
oldValue: null,
newValue: 'bar',
baseVersion
}
]
} );
} ); |
<<<<<<<
console.log("reqStream at THIS moment : ", { ...reqStream });
=======
>>>>>>>
<<<<<<<
console.log("ending request");
=======
>>>>>>>
<<<<<<<
console.log("reqStream at THIS moment : ", { ...reqStream });
=======
>>>>>>>
<<<<<<<
console.log(
"connectionArry before push: ",
JSON.parse(JSON.stringify(connectionArray)),
" openConnectionObj : ",
JSON.parse(JSON.stringify(openConnectionObj))
);
=======
>>>>>>> |
<<<<<<<
const undoMode = context.aWasUndone || context.bWasUndone;
=======
// Do not apply special transformation case if `SplitDelta` has `NoOperation` as the second operation.
if ( !b.position ) {
return defaultTransform( a, b, context );
}
>>>>>>>
// Do not apply special transformation case if `SplitDelta` has `NoOperation` as the second operation.
if ( !b.position ) {
return defaultTransform( a, b, context );
}
const undoMode = context.aWasUndone || context.bWasUndone;
<<<<<<<
addTransformationCase( SplitDelta, AttributeDelta, ( a, b, context ) => {
=======
addTransformationCase( SplitDelta, AttributeDelta, ( a, b, context ) => {
// Do not apply special transformation case if `SplitDelta` has `NoOperation` as the second operation.
if ( !a.position ) {
return defaultTransform( a, b, context );
}
>>>>>>>
addTransformationCase( SplitDelta, AttributeDelta, ( a, b, context ) => {
// Do not apply special transformation case if `SplitDelta` has `NoOperation` as the second operation.
if ( !a.position ) {
return defaultTransform( a, b, context );
}
<<<<<<<
if ( b.operations[ 0 ].position.isEqual( posBeforeSplitParent ) ) {
=======
if ( insertPosition && !undoMode && b.operations[ 0 ].position.isEqual( insertPosition ) ) {
>>>>>>>
if ( insertPosition && !undoMode && b.operations[ 0 ].position.isEqual( insertPosition ) ) {
<<<<<<<
additionalRenameDelta.operations[ 0 ].position = posBeforeSplitParent.getShiftedBy( 1 );
=======
additionalRenameDelta.operations[ 0 ].position = insertPosition.getShiftedBy( 1 );
// `nodes` is a property that is available only if `SplitDelta` `a` has `InsertOperation`.
// `SplitDelta` may have `ReinsertOperation` instead of `InsertOperation`.
// However, such delta is only created when `MergeDelta` is reversed.
// So if this is not undo mode, it means that `SplitDelta` has `InsertOperation`.
>>>>>>>
additionalRenameDelta.operations[ 0 ].position = insertPosition.getShiftedBy( 1 ); |
<<<<<<<
"fetch-meta-and-client",
=======
"open-http",
>>>>>>>
"fetch-meta-and-client",
"open-http",
<<<<<<<
"meta-and-client",
=======
"reqResUpdate",
>>>>>>>
"meta-and-client",
"reqResUpdate", |
<<<<<<<
const { app, BrowserWindow, TouchBar } = require('electron');
const path = require('path');
const url = require('url');
const {
TouchBarLabel,
TouchBarButton,
TouchBarSpacer,
TouchBarColorPicker,
TouchBarSlider,
TouchBarPopover,
} = TouchBar;
=======
const { app, BrowserWindow, TouchBar } = require('electron')
const path = require('path')
const url = require('url')
const { default: installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = require('electron-devtools-installer');
// const player = require('play-sound')
// const wave = new Audio('./src/assets/audio/wavebig.mpg')
const { TouchBarLabel, TouchBarButton, TouchBarSpacer, TouchBarColorPicker, TouchBarSlider, TouchBarPopover } = TouchBar;
>>>>>>>
const { app, BrowserWindow, TouchBar } = require('electron');
const path = require('path');
const url = require('url');
const {
default: installExtension,
REACT_DEVELOPER_TOOLS,
REDUX_DEVTOOLS,
} = require('electron-devtools-installer');
// const player = require('play-sound')
// const wave = new Audio('./src/assets/audio/wavebig.mpg')
const {
TouchBarLabel,
TouchBarButton,
TouchBarSpacer,
TouchBarColorPicker,
TouchBarSlider,
TouchBarPopover,
} = TouchBar;
<<<<<<<
const touchBar = new TouchBar([
tbLabel,
tbSpacer,
tbOpenAllButton,
tbCloseAllButton,
tbClearAllButton,
tbFlexSpacer,
tbRefreshButton,
]);
=======
const touchBar = new TouchBar([ tbLabel, tbSpacer, tbSelectAllButton, tbDeselectAllButton, tbOpenSelectedButton, tbCloseSelectedButton, tbClearAllButton, tbFlexSpacer, tbRefreshButton ]);
>>>>>>>
const touchBar = new TouchBar([
tbLabel,
tbSpacer,
tbSelectAllButton,
tbDeselectAllButton,
tbOpenSelectedButton,
tbCloseSelectedButton,
tbClearAllButton,
tbFlexSpacer,
tbRefreshButton,
]);
<<<<<<<
mainWindow.on('page-title-updated', e => e.preventDefault());
=======
mainWindow.on('page-title-updated', (e) => e.preventDefault())
>>>>>>>
mainWindow.on('page-title-updated', e => e.preventDefault());
<<<<<<<
mainWindow.show();
[winHeight] = mainWindow.getSize();
=======
mainWindow.show()
console.log('app data path', app.getPath('appData'));
// wave.play()
// play wave crash on open
// player.Play('./src/assets/audio/wavebig.mpg', (err) => {
// if (err) throw err
// })
winHeight = mainWindow.getSize()[1]
>>>>>>>
mainWindow.show();
console.log('app data path', app.getPath('appData'));
// wave.play()
// play wave crash on open
// player.Play('./src/assets/audio/wavebig.mpg', (err) => {
// if (err) throw err
// })
[winHeight] = mainWindow.getSize(); |
<<<<<<<
view.attachDomRoot( domEditor );
viewDocument.selection.removeAllRanges();
=======
viewDocument.attachDomRoot( domEditor );
viewDocument.selection.setTo( null );
>>>>>>>
view.attachDomRoot( domEditor );
viewDocument.selection.setTo( null ); |
<<<<<<<
// formattedHeaders["Access-Control-Allow-Origin"] = '*';
=======
console.log(formattedHeaders);
>>>>>>>
// formattedHeaders["Access-Control-Allow-Origin"] = '*';
<<<<<<<
const signal = abortController.signal;
=======
// const controller = new AbortController();
const signal = abortController.signal;
>>>>>>>
const signal = abortController.signal;
<<<<<<<
isStream ? this.handleSSE(response, originalObj, timeSentSnap) : this.handleSingleEvent(response.json(), originalObj, timeSentSnap);
=======
switch (contentType) {
case 'text/event-stream' :
console.log('text/event-stream');
this.handleSSE(response, originalObj, timeSentSnap, heads);
break;
case 'text/event-stream; charset=UTF-8' :
console.log('text/event-stream');
this.handleSSE(response, originalObj, timeSentSnap);
break;
case 'text/plain' :
console.log('text/plain');
this.handleSingleEvent();
break;
case 'application/json' :
console.log('application/json');
this.handleSSE(response, originalObj, timeSentSnap);
break;
case 'application/javascript' :
console.log('application/javascript');
this.handleSingleEvent();
break;
case 'application/xml' :
console.log('application/xml');
this.handleSingleEvent();
break;
case 'text/xml' :
console.log('text/xml');
this.handleSingleEvent();
break;
case 'text/html' :
console.log('text/html');
this.handleSingleEvent();
break;
default :
console.log('content-type not recognized')
}
>>>>>>>
isStream ? this.handleSSE(response, originalObj, timeSentSnap) : this.handleSingleEvent(response.json(), originalObj, timeSentSnap);
<<<<<<<
=======
//merge all fields into a single object
let parsedEventObject = (Object.assign({},...receivedEventFields));
parsedEventObject.timeReceived = Date.now();
newObj.response.events.push(parsedEventObject);
>>>>>>>
//merge all fields into a single object
let parsedEventObject = (Object.assign({},...receivedEventFields));
parsedEventObject.timeReceived = Date.now();
newObj.response.events.push(parsedEventObject);
<<<<<<<
toggleEndPoint(e) {
console.log('log')
},
=======
>>>>>>>
toggleEndPoint(e) {
console.log('log')
}, |
<<<<<<<
const formattedHeaders = {};
headers.forEach((head) => {
formattedHeaders[head.key] = head.value;
});
const outputObj = {
method,
mode: 'cors', // no-cors, cors, *same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
=======
let formattedHeaders = {};
headers.forEach(head => {
if (head.active) {
formattedHeaders[head.key] = head.value;
}
})
let outputObj = {
method: method,
mode: "cors", // no-cors, cors, *same-origin
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
credentials: "same-origin", // include, *same-origin, omit
>>>>>>>
const formattedHeaders = {};
headers.forEach((head) => {
if (head.active) {
formattedHeaders[head.key] = head.value;
}
});
const outputObj = {
method,
mode: 'cors', // no-cors, cors, *same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit |
<<<<<<<
// Quest storage config settings
'GCLOUD_PROJECT', // This is the id of your project in the Google Cloud Developers Console.
'CLOUD_BUCKET', // Bucket for compiled quest XML
'DATABASE_URL', // URL of postgres database storing quest metadata, user data, feedback, etc.
// Feedback email sender config settings
'MAIL_EMAIL',
'MAIL_PASSWORD',
// Authentication config settings
'OAUTH2_CLIENT_ID',
'OAUTH2_CLIENT_SECRET',
// Web server config settings
'PORT',
'SESSION_SECRET',
// Monitoring config settings
'NEW_RELIC_LICENSE_KEY',
// (Optional) Pay-what-you-want config settings
'BRAINTREE_ENVIRONMENT',
'BRAINTREE_MERCHANT_ID',
'BRAINTREE_PUBLIC_KEY',
'BRAINTREE_PRIVATE_KEY',
// (Optional) mailing list config settings
=======
'ENABLE_PAYMENT',
'CLOUD_BUCKET',
'GCLOUD_PROJECT',
'MAIL_EMAIL',
'MAIL_PASSWORD',
>>>>>>>
// Quest storage config settings
'GCLOUD_PROJECT', // This is the id of your project in the Google Cloud Developers Console.
'CLOUD_BUCKET', // Bucket for compiled quest XML
'DATABASE_URL', // URL of postgres database storing quest metadata, user data, feedback, etc.
// Feedback email sender config settings
'MAIL_EMAIL',
'MAIL_PASSWORD',
// Authentication config settings
'OAUTH2_CLIENT_ID',
'OAUTH2_CLIENT_SECRET',
// Web server config settings
'PORT',
'SESSION_SECRET',
// Monitoring config settings
'NEW_RELIC_LICENSE_KEY',
// (Optional) Pay-what-you-want config settings
'ENABLE_PAYMENT',
// (Optional) mailing list config settings
<<<<<<<
PORT: 8080,
BRAINTREE_ENVIRONMENT: 'Sandbox',
=======
ENABLE_PAYMENT: false,
// Typically you will create a bucket with the same name as your project ID.
CLOUD_BUCKET: '',
// This is the id of your project in the Google Cloud Developers Console.
GCLOUD_PROJECT: '',
MAILCHIMP_CREATORS_LIST_ID: 'baafc66d1b',
MAILCHIMP_PLAYERS_LIST_ID: '541cd63169',
OAUTH2_CLIENT_ID: '',
OAUTH2_CLIENT_SECRET: '',
OAUTH2_CALLBACK: 'http://localhost:8080/auth/google/callback',
DATABASE_URL: '',
PORT: 8081,
SESSION_SECRET: '',
>>>>>>>
PORT: 8080,
ENABLE_PAYMENT: false,
OAUTH2_CLIENT_ID: '',
OAUTH2_CLIENT_SECRET: '',
OAUTH2_CALLBACK: 'http://localhost:8080/auth/google/callback', |
<<<<<<<
});
test('impossibleOneWays', function(t) {
t.plan(2);
logInterceptor();
processors.impossibleOneWays(opts, mbtiles, function() {
var logs = logInterceptor.end();
var geoJSON = JSON.parse(logs[0]);
t.equal(geoJSON.features[0].properties._osmlint, 'impossibleoneways', 'Should be impossibleoneways');
t.equal(geoJSON.features[0].geometry.type, 'LineString', 'Should be LineString');
t.end();
});
=======
});
test('fixmeTag', function(t) {
t.plan(7);
logInterceptor();
processors.fixmeTag(opts, mbtiles, function() {
var logs = logInterceptor.end();
for (var i = 0; i < logs.length; i++) {
var geoJSON = JSON.parse(logs[i]);
for (var j = 0; j < geoJSON.features.length; j++) {
t.comment('Pass: ' + (i + 1));
t.equal(geoJSON.features[j].properties._osmlint, 'fixmetag', 'Should be fixmetag');
}
}
t.end();
});
>>>>>>>
});
test('fixmeTag', function(t) {
t.plan(7);
logInterceptor();
processors.fixmeTag(opts, mbtiles, function() {
var logs = logInterceptor.end();
for (var i = 0; i < logs.length; i++) {
var geoJSON = JSON.parse(logs[i]);
for (var j = 0; j < geoJSON.features.length; j++) {
t.comment('Pass: ' + (i + 1));
t.equal(geoJSON.features[j].properties._osmlint, 'fixmetag', 'Should be fixmetag');
}
}
t.end();
});
});
test('impossibleOneWays', function(t) {
t.plan(2);
logInterceptor();
processors.impossibleOneWays(opts, mbtiles, function() {
var logs = logInterceptor.end();
var geoJSON = JSON.parse(logs[0]);
t.equal(geoJSON.features[0].properties._osmlint, 'impossibleoneways', 'Should be impossibleoneways');
t.equal(geoJSON.features[0].geometry.type, 'LineString', 'Should be LineString');
t.end();
}); |
<<<<<<<
it('should merge a path with colon properly', function(){
urljoin('/users/:userId', '/cars/:carId')
.should.eql('/users/:userId/cars/:carId');
});
it('should merge slashes in protocol correctly', function () {
=======
it('should merge a simple path with a number correctly', function() {
urljoin('http://blabla.com/', 1)
.should.eql('http://blabla.com/1');
});
it('should merge a path with colon properly', function(){
urljoin('/users/:userId', '/cars/:carId')
.should.eql('/users/:userId/cars/:carId');
});
it.skip('should merge slashes in protocol correctly', function () {
>>>>>>>
it('should merge a simple path with a number correctly', function() {
urljoin('http://blabla.com/', 1)
.should.eql('http://blabla.com/1');
});
it('should merge a path with colon properly', function(){
urljoin('/users/:userId', '/cars/:carId')
.should.eql('/users/:userId/cars/:carId');
});
it('should merge slashes in protocol correctly', function () { |
<<<<<<<
CREATE_APPLICATION,
CREATE_APPLICATION_SUCCESS,
CREATE_APPLICATION_ERROR,
=======
TOGGLE_DRAGGING,
MOVE_TO_BOTTOM,
OPEN_EXPANSION_PANEL,
>>>>>>>
CREATE_APPLICATION,
CREATE_APPLICATION_SUCCESS,
CREATE_APPLICATION_ERROR,
TOGGLE_DRAGGING,
MOVE_TO_BOTTOM,
OPEN_EXPANSION_PANEL,
<<<<<<<
});
export const createApplication = ({ path, components = [], appName = 'proto_app' }) => (dispatch) => {
dispatch({
type: CREATE_APPLICATION,
});
createApplicationUtil({ path, appName })
.then(() => {
dispatch({
type: CREATE_APPLICATION_SUCCESS,
});
dispatch(exportFiles({ path: `${path}/${appName}/src`, components }));
})
.catch(err => dispatch({
type: CREATE_APPLICATION_ERROR,
payload: { err },
}));
};
=======
});
export const toggleDragging = status => ({
type: TOGGLE_DRAGGING,
payload: status,
});
export const moveToBottom = componentId => ({
type: MOVE_TO_BOTTOM,
payload: componentId,
});
export const openExpansionPanel = componentId => ({
type: OPEN_EXPANSION_PANEL,
payload: componentId,
});
>>>>>>>
});
export const createApplication = ({ path, components = [], appName = 'proto_app' }) => (dispatch) => {
dispatch({
type: CREATE_APPLICATION,
});
createApplicationUtil({ path, appName })
.then(() => {
dispatch({
type: CREATE_APPLICATION_SUCCESS,
});
dispatch(exportFiles({ path: `${path}/${appName}/src`, components }));
})
.catch(err => dispatch({
type: CREATE_APPLICATION_ERROR,
payload: { err },
}));
};
export const toggleDragging = status => ({
type: TOGGLE_DRAGGING,
payload: status,
});
export const moveToBottom = componentId => ({
type: MOVE_TO_BOTTOM,
payload: componentId,
});
export const openExpansionPanel = componentId => ({
type: OPEN_EXPANSION_PANEL,
payload: componentId,
}); |
<<<<<<<
* @param {module:engine/model/selection~Selection} data.selection
* @param {Object} data.options See {@link module:engine/controller/modifyselection~modifySelection}'s options.
=======
* @param {engine.model.Selection} data.selection
* @param {Object} data.options See {@link engine.controller.modifySelection}'s options.
*/
/**
* Event fired when {@link engine.controller.DataController#getSelectedContent} method is called.
* The {@link engine.controller.getSelectedContent default action of that method} is implemented as a
* listener to this event so it can be fully customized by the features.
*
* @event engine.controller.DataController#getSelectedContent
* @param {Object} data
* @param {engine.model.Selection} data.selection
* @param {engine.model.DocumentFragment} data.content The document fragment to return
* (holding a clone of the selected content).
>>>>>>>
* @param {module:engine/model/selection~Selection} data.selection
* @param {Object} data.options See {@link module:engine/controller/modifyselection~modifySelection}'s options.
*/
/**
* Event fired when {@link engine.controller.DataController#getSelectedContent} method is called.
* The {@link engine.controller.getSelectedContent default action of that method} is implemented as a
* listener to this event so it can be fully customized by the features.
*
* @event engine.controller.DataController#getSelectedContent
* @param {Object} data
* @param {engine.model.Selection} data.selection
* @param {engine.model.DocumentFragment} data.content The document fragment to return
* (holding a clone of the selected content). |
<<<<<<<
legend:PropTypes.object,
scaleX: PropTypes.number,
scaleY: PropTypes.number,
translateX: PropTypes.number,
translateY: PropTypes.number,
rotation: PropTypes.number,
renderToHardwareTextureAndroid: React.PropTypes.bool,
onLayout: React.PropTypes.bool,
accessibilityLiveRegion: React.PropTypes.string,
accessibilityComponentType: React.PropTypes.string,
importantForAccessibility: React.PropTypes.string,
accessibilityLabel: React.PropTypes.string,
testID: React.PropTypes.string,
viewCenter: React.PropTypes.array,
zoomTo: PropTypes.object
},
};
=======
legend:PropTypes.object
}
var MPBarChart = requireNativeComponent('MPBarChart', BarChart);
>>>>>>>
legend:PropTypes.object,
scaleX: PropTypes.number,
scaleY: PropTypes.number,
translateX: PropTypes.number,
translateY: PropTypes.number,
rotation: PropTypes.number,
renderToHardwareTextureAndroid: React.PropTypes.bool,
onLayout: React.PropTypes.bool,
accessibilityLiveRegion: React.PropTypes.string,
accessibilityComponentType: React.PropTypes.string,
importantForAccessibility: React.PropTypes.string,
accessibilityLabel: React.PropTypes.string,
testID: React.PropTypes.string,
viewCenter: React.PropTypes.array,
zoomTo: PropTypes.object
}
var MPBarChart = requireNativeComponent('MPBarChart', BarChart); |
<<<<<<<
'use strict';
import {
getNodesAndText,
jsonParseStringify,
wrapInDelta,
itemAt,
getText
} from '/tests/engine/model/_utils/utils.js';
=======
import { getNodesAndText, jsonParseStringify, wrapInDelta } from '/tests/engine/model/_utils/utils.js';
>>>>>>>
import {
getNodesAndText,
jsonParseStringify,
wrapInDelta,
itemAt,
getText
} from '/tests/engine/model/_utils/utils.js'; |
<<<<<<<
_scopes: {
'Aloha.empty' : {
'name' : 'Aloha.empty',
'extendedScopes' : [],
'buttons' : []
},
'Aloha.global' : {
'name' : 'Aloha.global',
'extendedScopes' : ['Aloha.empty'],
'buttons' : []
},
'Aloha.continuoustext' : {
'name' : 'Aloha.continuoustext',
'extendedScopes' : ['Aloha.global'],
'buttons' : []
}
},
_allButtons: [],
=======
_instances: {},
>>>>>>>
<<<<<<<
var instance = new ComponentType();
componentInstances[type].push(instance);
var scopeProps = this._scopes[instance.scope];
if (scopeProps) {
scopeProps.buttons.push(instance);
}
this._allButtons.push(instance);
=======
var instance = new ComponentType( editable );
this._instances[name] = instance;
>>>>>>>
var instance = new ComponentType();
componentInstances[type].push(instance); |
<<<<<<<
'aloha/copypaste'
=======
'aloha/copypaste',
'util/dom',
'aloha/contenthandlermanager'
>>>>>>>
'aloha/copypaste',
'aloha/contenthandlermanager'
<<<<<<<
CopyPaste
=======
CopyPaste,
Dom,
ContentHandlerManager
>>>>>>>
CopyPaste,
ContentHandlerManager |
<<<<<<<
register: function(repository) {
// if (repository instanceof Aloha.AbstractRepository) {
if ( !this.getRepository(repository.repositoryId) ) {
this.repositories.push(repository);
=======
Aloha.RepositoryManager = Class.extend({
repositories : [],
openCallbacks : [],
/**
* Initialize all registered repositories
* Before we invoke each repositories init method, we merge the global
* repository settings into each repository's custom settings
*
* TODO: Write unit tests to check that global and custom settings are
* applied correctly
*
* @return void
* @hide
*/
init: function () {
var repositories = this.repositories,
i = 0,
j = repositories.length,
repository,
settings;
if ( Aloha.settings && Aloha.settings.repositories ) {
settings = Aloha.settings.repositories;
>>>>>>>
Aloha.RepositoryManager = Class.extend({
repositories : [],
/**
* Initialize all registered repositories
* Before we invoke each repositories init method, we merge the global
* repository settings into each repository's custom settings
*
* TODO: Write unit tests to check that global and custom settings are
* applied correctly
*
* @return void
* @hide
*/
init: function () {
var repositories = this.repositories,
i = 0,
j = repositories.length,
repository,
settings;
if ( Aloha.settings && Aloha.settings.repositories ) {
settings = Aloha.settings.repositories; |
<<<<<<<
define([
'aloha/jquery',
'table/table-plugin-utils',
'table/table-selection'
], function (
jQuery,
Utils,
TableSelection
) {
=======
define([
'jquery',
'aloha/ephemera',
'table/table-plugin-utils'
], function (
jQuery,
Ephemera,
Utils
) {
>>>>>>>
define([
'aloha/jquery',
'aloha/ephemera',
'table/table-plugin-utils',
'table/table-selection'
], function (
jQuery,
Ephemera,
Utils,
TableSelection
) { |
<<<<<<<
if ( b.type == 'remove' && !context.wasUndone( b ) ) {
=======
if ( b instanceof RemoveOperation && !context.bWasUndone ) {
>>>>>>>
if ( b.type == 'remove' && !context.bWasUndone ) { |
<<<<<<<
//me.insertAbbrButton.hide();
//me.formatAbbrButton.setState( true );
FloatingmenuPortHelper.hideAll('insertAbbr');
FloatingmenuPortHelper.setStateTrueAll('formatAbbrButton');
Toolbar.setScope( 'abbr' );
=======
me.insertAbbrButton.hide();
me.formatAbbrButton.setState( true );
Component.setScope( 'abbr' );
>>>>>>>
//me.insertAbbrButton.hide();
//me.formatAbbrButton.setState( true );
FloatingmenuPortHelper.hideAll('insertAbbr');
FloatingmenuPortHelper.setStateTrueAll('formatAbbrButton');
Component.setScope( 'abbr' ); |
<<<<<<<
var _savedRange;
=======
var _savedRange;
>>>>>>>
var _savedRange;
<<<<<<<
if ( typeof Aloha.settings.plugins != 'undefined'
&& typeof Aloha.settings.plugins.characterpicker != 'undefined' ) {
self.settings = Aloha.settings.plugins.characterpicker;
}
this._characterPickerButton = Ui.adopt("characterPicker", Button, {
tooltip: i18n.t('button.addcharacter.tooltip'),
icon: "aloha-icon-characterpicker",
scope: 'Aloha.continuoustext',
click: function() {
if (false !== self.characterOverlay) {
_savedRange = Aloha.Selection.rangeObject;
self.characterOverlay.show(this.element);
}
}
=======
self.insertButton = new Aloha.ui.Button({
'name': 'characterpicker',
'iconClass': 'aloha-button-characterpicker',
'size': 'small',
'onclick': function (element, event) {
_savedRange = Aloha.Selection.rangeObject;
self.characterOverlay.show(element.btnEl.dom);
},
'tooltip': i18n.t('button.addcharacter.tooltip'),
'toggle': false
>>>>>>>
if ( typeof Aloha.settings.plugins != 'undefined'
&& typeof Aloha.settings.plugins.characterpicker != 'undefined' ) {
self.settings = Aloha.settings.plugins.characterpicker;
}
this._characterPickerButton = Ui.adopt("characterPicker", Button, {
tooltip: i18n.t('button.addcharacter.tooltip'),
icon: "aloha-icon-characterpicker",
scope: 'Aloha.continuoustext',
click: function() {
if (false !== self.characterOverlay) {
_savedRange = Aloha.Selection.rangeObject;
self.characterOverlay.show(this.element);
}
}
<<<<<<<
},
});
=======
}
});
/**
* insert a character after selecting it from the list
*/
function onCharacterSelect(character) {
if (Aloha.activeEditable) {
//Select the range that was selected before the overlay was opened
_savedRange.select();
Aloha.execCommand('insertHTML', false, character);
}
}
>>>>>>>
}
}); |
<<<<<<<
it( 'should skip context.aIsStrong and be less important than MoveOperation', () => {
const transOp = transform.transform( op, transformBy, { aIsStrong: true } );
=======
it( 'should skip context.aIsStrong and be less important than RemoveOperation', () => {
const transOp = transform.transform( op, transformBy, contextIsStrong );
>>>>>>>
it( 'should skip context.aIsStrong and be less important than MoveOperation', () => {
const transOp = transform.transform( op, transformBy, contextIsStrong ); |
<<<<<<<
* Sets the currently selected elements as headers of the table, or removes header-status
* if the whole selection is already used as a header
*
* @param {Aloha.Table} table the table-object for which the headers are to be set
* @param {string} scope for which the header should be used (i.e. 'row' or 'column')
*/
function toggleHeaderStatus(table, scope) {
var i,
j,
allHeaders = table.selection.isHeader(),
domCell, // representation of the cell in the dom
tableCell, // table-cell object
bufferCell; // temporary buffer
for (i = 0; i < table.selection.selectedCells.length; i++) {
domCell = table.selection.selectedCells[i];
// tries to match the current cell with a cell-object in the table
for (j = 0; j < table.cells.length; j++) {
if (domCell === table.cells[j].obj[0]) {
cell = table.cells[j];
break;
}
}
// the transformed dom objects are first stored in a buffer, and only applied to
// the table-cell-object if a match was found
if (allHeaders) {
bufferCell = Aloha.Markup.transformDomObject(domCell, 'td').removeAttr('scope').get(0);
} else {
bufferCell = Aloha.Markup.transformDomObject(domCell, 'th').attr('scope', scope).get(0);
}
if (cell != null) {
// assign the changed dom-element to the table-cell
cell.obj[0] = bufferCell;
// reactivate the table cell in order to bind events to the changed dom object
// TODO: re-attaching event-handlers should be factored out into a utility function
// so we don't have to do the whole activation/deactivation process for the cells
cell.deactivate();
cell.activate();
}
// uncommented code-segment, presumably added to force IE to target the wrapper
// on mouse-down by applying a timeout after event propagation
jQuery(table.selection.selectedCells[i]).bind('mousedown', function (jqEvent) {
var wrapper = jQuery(this).children('div').eq(0);
window.setTimeout(function () {
wrapper.trigger( 'focus' );
}, 1);
});
}
}
/**
=======
* If the specified style is not already active in all selected cells, it is applied;
* otherwise, it is removed from the cells
*
* @param {Array} config defined styles as defined in the configuration
* @param {String} cssClass
* @param {Array} sc the selection of target table cells
*/
function applyStyle(config, cssClass, sc) {
var appliedToAll = true;
for (var i = 0; i < sc.length; i++) {
if (jQuery(sc[i]).attr('class').indexOf(cssClass) < 0 ) {
appliedToAll = false;
break;
}
}
if (!appliedToAll) {
for (var i = 0; i < sc.length; i++) {
jQuery(sc[i]).addClass(cssClass);
for (var f = 0; f < config.length; f++) {
if (config[f].cssClass != cssClass) {
jQuery(sc[i]).removeClass(config[f].cssClass);
}
}
}
} else {
for (var i = 0; i < sc.length; i++) {
jQuery(sc[i]).removeClass(cssClass);
}
}
}
/**
>>>>>>>
* Sets the currently selected elements as headers of the table, or removes header-status
* if the whole selection is already used as a header
*
* @param {Aloha.Table} table the table-object for which the headers are to be set
* @param {string} scope for which the header should be used (i.e. 'row' or 'column')
*/
function toggleHeaderStatus(table, scope) {
var i,
j,
allHeaders = table.selection.isHeader(),
domCell, // representation of the cell in the dom
tableCell, // table-cell object
bufferCell; // temporary buffer
for (i = 0; i < table.selection.selectedCells.length; i++) {
domCell = table.selection.selectedCells[i];
// tries to match the current cell with a cell-object in the table
for (j = 0; j < table.cells.length; j++) {
if (domCell === table.cells[j].obj[0]) {
cell = table.cells[j];
break;
}
}
// the transformed dom objects are first stored in a buffer, and only applied to
// the table-cell-object if a match was found
if (allHeaders) {
bufferCell = Aloha.Markup.transformDomObject(domCell, 'td').removeAttr('scope').get(0);
} else {
bufferCell = Aloha.Markup.transformDomObject(domCell, 'th').attr('scope', scope).get(0);
}
if (cell != null) {
// assign the changed dom-element to the table-cell
cell.obj[0] = bufferCell;
// reactivate the table cell in order to bind events to the changed dom object
// TODO: re-attaching event-handlers should be factored out into a utility function
// so we don't have to do the whole activation/deactivation process for the cells
cell.deactivate();
cell.activate();
}
// uncommented code-segment, presumably added to force IE to target the wrapper
// on mouse-down by applying a timeout after event propagation
jQuery(table.selection.selectedCells[i]).bind('mousedown', function (jqEvent) {
var wrapper = jQuery(this).children('div').eq(0);
window.setTimeout(function () {
wrapper.trigger( 'focus' );
}, 1);
});
/**
* If the specified style is not already active in all selected cells, it is applied;
* otherwise, it is removed from the cells
*
* @param {Array} config defined styles as defined in the configuration
* @param {String} cssClass
* @param {Array} sc the selection of target table cells
*/
function applyStyle(config, cssClass, sc) {
var appliedToAll = true;
for (var i = 0; i < sc.length; i++) {
if (jQuery(sc[i]).attr('class').indexOf(cssClass) < 0 ) {
appliedToAll = false;
break;
}
}
if (!appliedToAll) {
for (var i = 0; i < sc.length; i++) {
jQuery(sc[i]).addClass(cssClass);
for (var f = 0; f < config.length; f++) {
if (config[f].cssClass != cssClass) {
jQuery(sc[i]).removeClass(config[f].cssClass);
}
}
}
} else {
for (var i = 0; i < sc.length; i++) {
jQuery(sc[i]).removeClass(cssClass);
}
}
}
/** |
<<<<<<<
return this._createAfter( node );
} else if ( offset !== 0 && !offset ) {
throw new CKEditorError(
'model-position-createAt-required-second-parameter: ' +
'Position.createAt requires the second parameter offset when first parameter is a model item.' );
}
if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
/**
* Position parent have to be a model element or model document fragment.
*
* @error model-position-parent-incorrect
*/
throw new CKEditorError( 'model-position-parent-incorrect: Position parent have to be a element or document fragment.' );
=======
return this.createAfter( node );
} else if ( offset !== 0 && !offset ) {
/**
* {@link module:engine/model/position~Position.createAt `Position.createAt()`}
* requires the offset to be specified when the first parameter is a model item.
*
* @error model-position-createAt-offset-required
*/
throw new CKEditorError(
'model-position-createAt-offset-required: ' +
'Position.createAt() requires the offset when the first parameter is a model item.' );
>>>>>>>
return this._createAfter( node );
} else if ( offset !== 0 && !offset ) {
/**
* {@link module:engine/model/position~Position.createAt `Position.createAt()`}
* requires the offset to be specified when the first parameter is a model item.
*
* @error model-position-createAt-offset-required
*/
throw new CKEditorError(
'model-position-createAt-offset-required: ' +
'Position.createAt() requires the offset when the first parameter is a model item.' );
}
if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
/**
* Position parent have to be a model element or model document fragment.
*
* @error model-position-parent-incorrect
*/
throw new CKEditorError( 'model-position-parent-incorrect: Position parent have to be a element or document fragment.' ); |
<<<<<<<
cell.tableObj.selection.baseCellPosition = [cell._virtualY(), cell._virtualX()];
if ($event.shiftKey) {
// shift-click to select a coherent cell range
//
// in IE it's not possible to select multiple cells when you "select+drag" over other cells
// click into the first cell and then "shift-click" into the last cell of the coherent cell range you want to select
var right = cell.tableObj.selection.lastBaseCellPosition[1];
var bottom = cell.tableObj.selection.lastBaseCellPosition[0];
var topLeft = cell.tableObj.selection.baseCellPosition;
var left = topLeft[1];
if (left > right) {
left = right;
right = topLeft[1];
}
var top = topLeft[0];
if (top > bottom) {
top = bottom;
bottom = topLeft[0];
}
var rect = {"top": top, "right": right, "bottom": bottom, "left": left};
var table = cell.tableObj;
var $rows = table.obj.children().children('tr');
var grid = Utils.makeGrid($rows);
table.selection.selectedCells = [];
var selectClass = table.get('classCellSelected');
Utils.walkGrid(grid, function (cellInfo, j, i) {
if ( Utils.containsDomCell(cellInfo) ) {
if (i >= rect.top && i <= rect.bottom && j >= rect.left && j <= rect.right) {
jQuery( cellInfo.cell ).addClass(selectClass);
table.selection.selectedCells.push(cellInfo.cell);
} else {
jQuery( cellInfo.cell ).removeClass(selectClass);
}
}
});
table.selection.notifyCellsSelected();
} else {
cell.tableObj.selection.lastBaseCellPosition = cell.tableObj.selection.baseCellPosition;
cell._editableMouseDown($event);
cell._startCellSelection();
}
} );
$wrapper.bind('blur', function ($event) { cell._editableBlur($event); });
$wrapper.bind('keyup', function ($event) { cell._editableKeyUp($event); });
$wrapper.bind('keydown', function ($event) { cell._editableKeyDown($event); });
$wrapper.bind('mouseover', function ($event) { cell._selectCellRange(); });
=======
cell._editableMouseDown($event);
cell._startCellSelection();
});
$wrapper.bind('blur', function ($event) { cell._editableBlur($event); });
$wrapper.bind('keyup', function ($event) { cell._editableKeyUp($event); });
$wrapper.bind('keydown', function ($event) { cell._editableKeyDown($event); });
$wrapper.bind('mouseover', function ($event) { cell._selectCellRange(); });
>>>>>>>
cell.tableObj.selection.baseCellPosition = [cell._virtualY(), cell._virtualX()];
if ($event.shiftKey) {
// shift-click to select a coherent cell range
//
// in IE it's not possible to select multiple cells when you "select+drag" over other cells
// click into the first cell and then "shift-click" into the last cell of the coherent cell range you want to select
var right = cell.tableObj.selection.lastBaseCellPosition[1];
var bottom = cell.tableObj.selection.lastBaseCellPosition[0];
var topLeft = cell.tableObj.selection.baseCellPosition;
var left = topLeft[1];
if (left > right) {
left = right;
right = topLeft[1];
}
var top = topLeft[0];
if (top > bottom) {
top = bottom;
bottom = topLeft[0];
}
var rect = {"top": top, "right": right, "bottom": bottom, "left": left};
var table = cell.tableObj;
var $rows = table.obj.children().children('tr');
var grid = Utils.makeGrid($rows);
table.selection.selectedCells = [];
var selectClass = table.get('classCellSelected');
Utils.walkGrid(grid, function (cellInfo, j, i) {
if ( Utils.containsDomCell(cellInfo) ) {
if (i >= rect.top && i <= rect.bottom && j >= rect.left && j <= rect.right) {
jQuery( cellInfo.cell ).addClass(selectClass);
table.selection.selectedCells.push(cellInfo.cell);
} else {
jQuery( cellInfo.cell ).removeClass(selectClass);
}
}
});
table.selection.notifyCellsSelected();
} else {
cell.tableObj.selection.lastBaseCellPosition = cell.tableObj.selection.baseCellPosition;
cell._editableMouseDown($event);
cell._startCellSelection();
}
});
$wrapper.bind('blur', function ($event) { cell._editableBlur($event); });
$wrapper.bind('keyup', function ($event) { cell._editableKeyUp($event); });
$wrapper.bind('keydown', function ($event) { cell._editableKeyDown($event); });
$wrapper.bind('mouseover', function ($event) { cell._selectCellRange(); }); |
<<<<<<<
'use strict';
import Text from './text.js';
=======
import CharacterProxy from './characterproxy.js';
>>>>>>>
import Text from './text.js'; |
<<<<<<<
'query' : queryString,
=======
'name' : p.queryString,
>>>>>>>
'query' : p.queryString, |
<<<<<<<
// add the markup
GENTICS.Utils.Dom.addMarkup( rangeObject, markup );
}
// select the modified range
rangeObject.select();
return false;
},
/**
* Change markup
*/
changeMarkup: function( button ) {
Aloha.Selection.changeMarkupOnSelection(jQuery('<' + button + '></' + button + '>'));
},
/**
* Removes all formatting from the current selection.
*/
removeFormat: function() {
var formats = [ 'strong', 'em', 'b', 'i', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'],
rangeObject = Aloha.Selection.rangeObject,
i;
=======
/**
* Removes all formatting from the current selection.
*/
removeFormat: function() {
var formats = [ 'strong', 'em', 'b', 'i', 's', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'],
rangeObject = Aloha.Selection.rangeObject,
i;
>>>>>>>
// add the markup
GENTICS.Utils.Dom.addMarkup( rangeObject, markup );
}
// select the modified range
rangeObject.select();
return false;
},
/**
* Change markup
*/
changeMarkup: function( button ) {
Aloha.Selection.changeMarkupOnSelection(jQuery('<' + button + '></' + button + '>'));
},
/**
* Removes all formatting from the current selection.
*/
removeFormat: function() {
var formats = [ 'strong', 'em', 'b', 'i', 's', 'cite', 'q', 'code', 'abbr', 'del', 'sub', 'sup'],
rangeObject = Aloha.Selection.rangeObject,
i; |
<<<<<<<
define(
['aloha/jquery',
'aloha/plugin',
'ui/component',
'ui/toggleButton',
'i18n!numerated-headers/nls/i18n',
'i18n!aloha/nls/i18n',
'css!numerated-headers/css/numerated-headers.css'],
function(jQuery, Plugin, Component, ToggleButton, i18n, i18nCore) {
=======
define ([
'aloha/jquery',
'aloha/plugin',
'aloha/floatingmenu',
'i18n!numerated-headers/nls/i18n',
'i18n!aloha/nls/i18n',
'css!numerated-headers/css/numerated-headers.css'
],
function (jQuery, Plugin, FloatingMenu, i18n, i18nCore) {
>>>>>>>
define ([
'aloha/jquery',
'aloha/plugin',
'ui/component',
'ui/toggleButton',
'i18n!numerated-headers/nls/i18n',
'i18n!aloha/nls/i18n',
'css!numerated-headers/css/numerated-headers.css'
],
function (jQuery, Plugin, Component, ToggleButton, i18n, i18nCore) { |
<<<<<<<
this.initButtons();
Aloha.ready( function () {
// @todo add config option for sidebar panel
me.initSidebar( Aloha.Sidebar.right );
} );
// apply specific configuration if an editable has been activated
Aloha.bind('aloha-editable-activated',function (e, params) {
me.applyButtonConfig(params.editable.obj);
// handle hotKeys
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatBold, function() { me.addMarkup( 'b' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatItalic, function() { me.addMarkup( 'i' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatParagraph, function() { me.changeMarkup( 'p' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH1, function() { me.changeMarkup( 'h1' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH2, function() { me.changeMarkup( 'h2' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH3, function() { me.changeMarkup( 'h3' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH4, function() { me.changeMarkup( 'h4' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH5, function() { me.changeMarkup( 'h5' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH6, function() { me.changeMarkup( 'h6' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatPre, function() { me.changeMarkup( 'pre' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatDel, function() { me.addMarkup( 'del' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSub, function() { me.addMarkup( 'sub' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSup, function() { me.addMarkup( 'sup' ); return false; });
});
Aloha.bind('aloha-editable-deactivated',function (e, params) {
params.editable.obj.unbind('keydown.aloha.format');
});
},
/**
* applys a configuration specific for an editable
* buttons not available in this configuration are hidden
* @param {Object} id of the activated editable
* @return void
*/
applyButtonConfig: function (obj) {
=======
this.initButtons();
Aloha.bind('aloha-plugins-loaded', function () {
// @todo add config option for sidebar panel
me.initSidebar(Aloha.Sidebar.right);
});
// apply specific configuration if an editable has been activated
Aloha.bind('aloha-editable-activated',function (e, params) {
me.applyButtonConfig(params.editable.obj);
// handle hotKeys
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatBold, function() { me.addMarkup( 'b' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatItalic, function() { me.addMarkup( 'i' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatParagraph, function() { me.changeMarkup( 'p' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH1, function() { me.changeMarkup( 'h1' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH2, function() { me.changeMarkup( 'h2' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH3, function() { me.changeMarkup( 'h3' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH4, function() { me.changeMarkup( 'h4' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH5, function() { me.changeMarkup( 'h5' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH6, function() { me.changeMarkup( 'h6' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatPre, function() { me.changeMarkup( 'pre' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatDel, function() { me.addMarkup( 'del' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSub, function() { me.addMarkup( 'sub' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSup, function() { me.addMarkup( 'sup' ); return false; });
});
>>>>>>>
this.initButtons();
Aloha.bind('aloha-plugins-loaded', function () {
// @todo add config option for sidebar panel
me.initSidebar(Aloha.Sidebar.right);
});
// apply specific configuration if an editable has been activated
Aloha.bind('aloha-editable-activated',function (e, params) {
me.applyButtonConfig(params.editable.obj);
// handle hotKeys
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatBold, function() { me.addMarkup( 'b' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatItalic, function() { me.addMarkup( 'i' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatParagraph, function() { me.changeMarkup( 'p' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH1, function() { me.changeMarkup( 'h1' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH2, function() { me.changeMarkup( 'h2' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH3, function() { me.changeMarkup( 'h3' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH4, function() { me.changeMarkup( 'h4' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH5, function() { me.changeMarkup( 'h5' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatH6, function() { me.changeMarkup( 'h6' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatPre, function() { me.changeMarkup( 'pre' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatDel, function() { me.addMarkup( 'del' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSub, function() { me.addMarkup( 'sub' ); return false; });
params.editable.obj.bind( 'keydown.aloha.format', me.hotKey.formatSup, function() { me.addMarkup( 'sup' ); return false; });
});
Aloha.bind('aloha-editable-deactivated',function (e, params) {
params.editable.obj.unbind('keydown.aloha.format');
});
},
/**
* applys a configuration specific for an editable
* buttons not available in this configuration are hidden
* @param {Object} id of the activated editable
* @return void
*/
applyButtonConfig: function (obj) { |
<<<<<<<
['aloha', 'aloha/jquery', 'aloha/plugin', 'aloha/pluginmanager', 'aloha/floatingmenu', 'i18n!table/nls/i18n', 'i18n!aloha/nls/i18n', 'table/table-create-layer', 'table/table', 'table/table-plugin-utils', 'css!table/css/table.css'],
function(Aloha, jQuery, Plugin, PluginManager, FloatingMenu, i18n, i18nCore, CreateLayer, TableModuleConstructor, Utils) {
=======
['aloha', 'aloha/jquery', 'aloha/plugin', 'aloha/pluginmanager', 'aloha/floatingmenu', 'i18n!table/nls/i18n', 'i18n!aloha/nls/i18n', 'table/table-create-layer', 'table/table', 'table/table-plugin-utils', 'css!table/css/table.css'],
function(Aloha, jQuery, Plugin, PluginManager, FloatingMenu, i18n, i18nCore, CreateLayer, Table, Utils) {
>>>>>>>
['aloha', 'aloha/jquery', 'aloha/plugin', 'aloha/pluginmanager', 'aloha/floatingmenu', 'i18n!table/nls/i18n', 'i18n!aloha/nls/i18n', 'table/table-create-layer', 'table/table', 'table/table-plugin-utils', 'css!table/css/table.css'],
function(Aloha, jQuery, Plugin, PluginManager, FloatingMenu, i18n, i18nCore, CreateLayer, Table, Utils) {
<<<<<<<
var Table = TableModuleConstructor(TablePlugin);
/* -- ATTRIBUTES -- */
=======
>>>>>>>
<<<<<<<
editable.obj.find('table').each(function () {
// only convert tables which are editable
if (that.isEditableTable(this)) {
// instantiate a new table-object
var table = new Table(this);
=======
editable.obj.find('table').each(function () {
// only convert tables which are editable
if (that.isEditableTable(this)) {
// instantiate a new table-object
var table = new Table(this, TablePlugin);
>>>>>>>
editable.obj.find('table').each(function () {
// only convert tables which are editable
if (that.isEditableTable(this)) {
// instantiate a new table-object
var table = new Table(this, TablePlugin);
<<<<<<<
// add the activated table to the TableRegistry
TablePlugin.TableRegistry.push(table);
}
});
});
// subscribe for the 'editableDeactivated' event to deactivate all tables in the editable
Aloha.bind('aloha-editable-deactivated', function (event, properties) {
if (TablePlugin.activeTable) {
TablePlugin.activeTable.selection.unselectCells();
}
TablePlugin.setFocusedTable(undefined);
// shortcut for TableRegistry
var tr = TablePlugin.TableRegistry;
for (var i = 0; i < tr.length; i++) {
// activate the table
tr[i].deactivate();
}
=======
// add the activated table to the TableRegistry
TablePlugin.TableRegistry.push(table);
}
});
});
// subscribe for the 'editableDeactivated' event to deactivate all tables in the editable
Aloha.bind( 'aloha-editable-deactivated', function (event, properties) {
if (TablePlugin.activeTable) {
TablePlugin.activeTable.selection.unselectCells();
}
TablePlugin.setFocusedTable(undefined);
// shortcut for TableRegistry
var tr = TablePlugin.TableRegistry;
for (var i = 0; i < tr.length; i++) {
// activate the table
tr[i].deactivate();
}
>>>>>>>
// add the activated table to the TableRegistry
TablePlugin.TableRegistry.push(table);
}
});
});
// subscribe for the 'editableDeactivated' event to deactivate all tables in the editable
Aloha.bind( 'aloha-editable-deactivated', function (event, properties) {
if (TablePlugin.activeTable) {
TablePlugin.activeTable.selection.unselectCells();
}
TablePlugin.setFocusedTable(undefined);
// shortcut for TableRegistry
var tr = TablePlugin.TableRegistry;
for (var i = 0; i < tr.length; i++) {
// activate the table
tr[i].deactivate();
}
<<<<<<<
var that = this,
content = this.setContent(
'<label class="' + nsClass('label') + '" for="' + nsClass('textarea') + '" >' + i18n.t('table.label.target') + '</label>' +
'<textarea id="' + nsClass('textarea') + '" class="' + nsClass('textarea') + '" />').content;
jQuery(nsSel('textarea')).live('keyup', function() {
//The original developer thought that escaping the
=======
var that = this,
content = this.setContent(
'<label class="' + nsClass('label') + '" for="' + nsClass('textarea') + '" >' + i18n.t('table.label.target') + '</label>' +
'<textarea id="' + nsClass('textarea') + '" class="' + nsClass('textarea') + '" />').content;
jQuery(nsSel('textarea')).live('keyup', function() {
//The original developer thought that escaping the
>>>>>>>
var that = this,
content = this.setContent(
'<label class="' + nsClass('label') + '" for="' + nsClass('textarea') + '" >' + i18n.t('table.label.target') + '</label>' +
'<textarea id="' + nsClass('textarea') + '" class="' + nsClass('textarea') + '" />').content;
jQuery(nsSel('textarea')).live('keyup', function() {
//The original developer thought that escaping the
<<<<<<<
/* -- END METHODS -- */
=======
// activate all column formatting button
for ( var i = 0; i < TablePlugin.columnMSItems.length; i++ ) {
TablePlugin.columnMSButton.extButton.showItem(TablePlugin.columnMSItems[i].name);
}
FloatingMenu.setScope(TablePlugin.name + '.column');
TablePlugin.columnHeader.setPressed( TableSelection.isHeader() );
var rows = this.obj.find("tr").toArray();
// set the first class found as active item in the multisplit button
TablePlugin.columnMSButton.setActiveItem();
for (var k = 0; k < TablePlugin.columnConfig.length; k++) {
if ( jQuery(rows[0].cells[0]).hasClass(TablePlugin.columnConfig[k].cssClass) ) {
TablePlugin.columnMSButton.setActiveItem(TablePlugin.columnConfig[k].name);
k = TablePlugin.columnConfig.length;
}
}
// ====== END UI specific code - should be handled by UI =======
// blur all editables within the table
this.obj.find('div.aloha-ui-table-cell-editable').blur();
TableSelection.selectColumns( columnsToSelect );
};
/**
* Marks all cells of the specified row as marked (adds a special class)
*
* @return void
*/
Table.prototype.selectRows = function () {
// // get the class which selected cells should have
// var selectClass = this.get('classCellSelected');
//
// //deactivate keepCellsSelected flag
// TableSelection.keepCellsSelected = false;
//
// // unselect selected cells
// TableSelection.unselectCells();
// activate all row formatting button
for (var i = 0; i < TablePlugin.rowMSItems.length; i++ ) {
TablePlugin.rowMSButton.extButton.showItem(TablePlugin.rowMSItems[i].name);
}
// this.rowsToSelect.sort(function (a,b) {return a - b;});
// set the status of the table header button to the status of the
// frist 2 selected cells (index 1+2). First cell is for selection.
// if ( this.rowsToSelect && this.rowsToSelect.length > 0 &&
// rowCells && rowCells[0] ) {
// if ( rowCells[1] ) {
// TablePlugin.rowHeader.setPressed(
// // take 1 column to detect if the header button is pressd
// rowsCells[1].nodeName.toLowerCase() == 'th' &&
// rowsCells[2].nodeName.toLowerCase() == 'th'
// );
// } else {
// TablePlugin.rowHeader.setPressed( rowCells[1].nodeName.toLowerCase() == 'th');
// }
// }
//
for (var i = 0; i < this.rowsToSelect.length; i++) {
var rowId = this.rowsToSelect[i];
var rowCells = jQuery(this.obj.find('tr').get(rowId).cells).toArray();
if (i == 0) {
// set the status of the table header button to the status of the first 2 selected
// cells (index 1 + 2). The first cell is the selection-helper
// TablePlugin.rowHeader.setPressed(
// rowCells[1].nodeName.toLowerCase() == 'th' &&
// rowCells[2].nodeName.toLowerCase() == 'th'
//// jQuery(rowCells[1]).attr('scope') == 'col'
// );
// set the first class found as active item in the multisplit button
for (var j = 0; j < rowCells.length; j++) {
TablePlugin.rowMSButton.setActiveItem();
for ( var k = 0; k < TablePlugin.rowConfig.length; k++) {
if (jQuery(rowCells[j]).hasClass(TablePlugin.rowConfig[k].cssClass) ) {
TablePlugin.rowMSButton.setActiveItem(TablePlugin.rowConfig[k].name);
k = TablePlugin.rowConfig.length;
}
}
}
}
// // shift the first element (which is a selection-helper cell)
// rowCells.shift();
//
// TableSelection.selectedCells = TableSelection.selectedCells.concat(rowCells);
//
// jQuery(rowCells).addClass(this.get('classCellSelected'));
}
// TableSelection.selectionType = 'row';
FloatingMenu.setScope(TablePlugin.name + '.row');
TableSelection.selectRows( this.rowsToSelect );
TablePlugin.columnHeader.setPressed( TableSelection.isHeader() );
// blur all editables within the table
this.obj.find('div.aloha-ui-table-cell-editable').blur();
};
/**
* Deactivation of a Aloha-table. Clean up ... remove the wrapping div and the
* selection-helper divs
*
* @return void
*/
Table.prototype.deactivate = function() {
this.obj.removeClass(this.get('className'));
if (jQuery.trim(this.obj.attr('class')) == '') {
this.obj.removeAttr('class');
}
this.obj.removeAttr('contenteditable');
// this.obj.removeAttr('id');
// unwrap the selectionLeft-div if available
if (this.obj.parents('.' + this.get('classTableWrapper')).length){
this.obj.unwrap();
}
// remove the selection row
this.obj.find('tr.' + this.get('classSelectionRow') + ':first').remove();
// remove the selection column (first column left)
var that = this;
jQuery.each(this.obj.context.rows, function(){
jQuery(this).children('td.' + that.get('classSelectionColumn')).remove();
});
// remove the "selection class" from all td and th in the table
this.obj.find('td, th').removeClass(this.get('classCellSelected'));
this.obj.unbind();
// wrap the inner html of the contentEditable div to its outer html
for (var i = 0; i < this.cells.length; i++) {
var Cell = this.cells[i];
Cell.deactivate();
}
// remove editable span in caption (if any)
this.obj.find('caption div').each(function() {
jQuery(this).contents().unwrap();
});
// better unset ;-) otherwise activate() may think you're activated.
this.isActive = false;
};
/**
* toString-method for Table object
*
* @return void
*/
Table.prototype.toString = function() {
return 'Table';
};
Table.prototype.newCell = function(domElement) {
return new Table.Cell(domElement, this);
};
Table.prototype.newActiveCell = function(domElement) {
var cell = new Table.Cell(domElement, this);
cell.activate();
return cell;
};
/* -- END METHODS -- */
var TableSelection = new (TableSelectionModuleConstructor(TablePlugin))();
Table.Cell = CellModuleConstructor(TableSelection);
Table.CreateLayer = CreateLayerModuleConstructor(TablePlugin);
Aloha.TableSelection = TableSelection;
=======
TablePlugin.updateFloatingMenuScope = function () {
if ( null != TablePlugin.activeTable && null != TablePlugin.activeTable.selection.selectionType ) {
FloatingMenu.setScope(TablePlugin.name + '.' + TablePlugin.activeTable.selection.selectionType);
}
};
>>>>>>>
TablePlugin.updateFloatingMenuScope = function () {
if ( null != TablePlugin.activeTable && null != TablePlugin.activeTable.selection.selectionType ) {
FloatingMenu.setScope(TablePlugin.name + '.' + TablePlugin.activeTable.selection.selectionType);
}
}; |
<<<<<<<
=======
//window.console.log('6');
>>>>>>>
<<<<<<<
=======
//window.console.log('7');
>>>>>>>
<<<<<<<
=======
//window.console.log('8');
>>>>>>>
<<<<<<<
=======
// window.console.log("endNodeHasChildnodes: " + endNode.hasChildNodes());
>>>>>>>
<<<<<<<
=======
//window.console.log("! check: " + inSameEditingHost(endBlock, endBlock.parentNode));
//window.console.log("! check: " + isInlineNode(endBlock));
//window.console.log("EndBlock: " + endBlock.className + " " + endBlock.id + " type:" + endBlock.type);
//window.console.log("Parent: " + endBlock.parentNode.id + " " + endBlock.parentNode.id.className + " " + endBlock.parentNode.id.type);
>>>>>>>
<<<<<<<
=======
//window.console.log("EndBlock: " + endBlock.className + " " + endBlock.id);
>>>>>>>
<<<<<<<
=======
//window.console.log('Returning early');
>>>>>>>
<<<<<<<
=======
//window.console.log(!blockMerging);
//window.console.log(!startBlock);
//window.console.log(!endBlock);
//window.console.log(!inSameEditingHost(startBlock, endBlock));
//window.console.log(startBlock == endBlock);
//window.console.log("Final StartBlock: " + startBlock.className + " " + startBlock.id);
//window.console.log("Final EndBlock: " + endBlock.className + " " + endBlock.id);
>>>>>>>
<<<<<<<
=======
//window.console.log('Returning early2');
>>>>>>>
<<<<<<<
=======
//window.console.log("x1");
>>>>>>>
<<<<<<<
=======
//window.console.log("HasChildNodes: " + !endBlock.hasChildNodes());
>>>>>>>
<<<<<<<
=======
//window.console.log(isEditable(endBlock));
//window.console.log(!isInlineNode(endBlock));
//window.console.log(isInlineNode(endBlock.previousSibling));
//window.console.log(isInlineNode(endBlock.nextSibling));
>>>>>>>
<<<<<<<
=======
//window.console.log('9');
>>>>>>>
<<<<<<<
=======
//window.console.log('10');
>>>>>>>
<<<<<<<
=======
//window.console.log('11');
>>>>>>>
<<<<<<<
=======
//window.console.log('12');
>>>>>>>
<<<<<<<
=======
//window.console.log('1');
>>>>>>>
<<<<<<<
=======
//window.console.log('2');
>>>>>>>
<<<<<<<
=======
//window.console.log('3');
>>>>>>>
<<<<<<<
=======
//window.console.log('5');
>>>>>>> |
<<<<<<<
[ 'aloha/core', 'jquery', 'util/class', 'util/range', 'util/arrays', 'util/strings', 'aloha/console', 'PubSub', 'aloha/engine', 'aloha/rangy-core' ],
function(Aloha, jQuery, Class, Range, Arrays, Strings, console, PubSub, Engine) {
var GENTICS = window.GENTICS;
=======
[ 'aloha/core', 'aloha/jquery', 'util/class', 'util/arrays', 'util/strings', 'util/range', 'aloha/engine', 'aloha/console', 'PubSub', 'aloha/ecma5shims', 'aloha/rangy-core' ],
function(Aloha, jQuery, Class, Arrays, Strings, Range, Engine, console, PubSub, e5s) {
var
GENTICS = window.GENTICS;
>>>>>>>
[ 'aloha/core', 'jquery', 'util/class', 'util/range', 'util/arrays', 'util/strings', 'aloha/console', 'PubSub', 'aloha/engine', 'aloha/ecma5shims', 'aloha/rangy-core' ],
function(Aloha, jQuery, Class, Range, Arrays, Strings, console, PubSub, Engine, e5s) {
var GENTICS = window.GENTICS; |
<<<<<<<
if (1 === groupedComponents[j].length &&
groupedComponents[j].charCodeAt(0) === 10) {
group.append('<div>');
} else {
component = Component.render(groupedComponents[j]);
group.append(component.element);
}
=======
component = Component.render(groupedComponents[j]);
if (component) {
group.append(component.element);
}
>>>>>>>
if (1 === groupedComponents[j].length &&
groupedComponents[j].charCodeAt(0) === 10) {
group.append('<div>');
} else {
component = Component.render(groupedComponents[j]);
if (component) {
group.append(component.element);
}
} |
<<<<<<<
'i18n!aloha/nls/i18n',
'ui/port-helper-floatingmenu'
], function (Aloha,
jQuery,
Plugin,
Component,
ToggleButton,
Button,
Toolbar,
AttributeField,
i18n,
i18nCore,
FloatingmenuPortHelper) {
'use strict';
=======
'i18n!aloha/nls/i18n'
], function(
Aloha,
jQuery,
Plugin,
Component,
ToggleButton,
Button,
Scopes,
AttributeField,
i18n,
i18nCore
){
"use strict";
>>>>>>>
'i18n!aloha/nls/i18n',
'ui/port-helper-floatingmenu'
], function (
Aloha,
jQuery,
Plugin,
Component,
ToggleButton,
Button,
Scopes,
AttributeField,
i18n,
i18nCore,
FloatingmenuPortHelper
) {
'use strict';
<<<<<<<
//me.insertAbbrButton.hide();
//me.formatAbbrButton.setState( true );
FloatingmenuPortHelper.hideAll('insertAbbr');
FloatingmenuPortHelper.setStateTrueAll('formatAbbrButton');
Component.setScope( 'abbr' );
=======
me.insertAbbrButton.hide();
me.formatAbbrButton.setState( true );
Scopes.setScope( 'abbr' );
>>>>>>>
//me.insertAbbrButton.hide();
//me.formatAbbrButton.setState( true );
FloatingmenuPortHelper.hideAll('insertAbbr');
FloatingmenuPortHelper.setStateTrueAll('formatAbbrButton');
Scopes.setScope( 'abbr' ); |
<<<<<<<
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2014 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
* License http://aloha-editor.org/license.php
=======
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
*
* Aloha Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As an additional permission to the GNU GPL version 2, you may distribute
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
* source code without the copy of the GNU GPL normally required,
* provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
>>>>>>>
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2014 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
* License http://aloha-editor.org/license.php
<<<<<<<
i18n
=======
PubSub,
i18n,
i18nCore
>>>>>>>
i18n
<<<<<<<
var $ = jQuery;
=======
var GENTICS = window.GENTICS;
>>>>>>>
var $ = jQuery;
<<<<<<<
/**
* Checks if the selection spans a whole node (HTML element)
* @param Range range
* @return {boolean}
*/
function isEntireNodeInRange(range) {
var sc = range.startContainer;
var so = range.startOffset;
var ec = range.endContainer;
var eo = range.endOffset;
return (sc === ec && so === 0 && eo === ec.length);
}
/**
* Alias for isInlineFormatable function from Html lib
*/
var isInlineNode = Html.isInlineFormattable;
/**
* Expands the (invisible) range to encompass the whole node
* that was selected by the user
* @param Range range
* @return void
*/
function expandRange(range) {
var cac = range.commonAncestorContainer;
if (isInlineNode(cac)) {
var parent = cac.parentNode;
range.startContainer = parent;
range.endContainer = parent;
range.commonAncestorContainer = parent;
range.startOffset = 0;
range.endOffset = 1;
expandRange(range);
return;
}
// Because at this point there will be no further recursion, we should
// finally update the state of `range`
range.update();
}
/**
* Collision map to determine if we are
* working on a list related node.
*/
var LIST_ELEMENT = {
'OL': true,
'UL': true,
'LI': true,
'DL': true,
'DT': true,
'DD': true
};
/**
* Determine if we are working on a list element
* using the previous LIST_ELEMENT hash map.
* @param DOM node
* @return {boolean}
*/
function isListElement(node){
return LIST_ELEMENT[node.nodeName];
}
/**
* Determines if a markup is a heading
* @param string markup
* @returns {boolean}
*/
function isHeading(markup){
return jQuery.inArray(markup,['h1', 'h2', 'h3', 'h4', 'h5', 'h6']) >= 0;
}
/**
* Checks whether range spans multiple lists
* @param Range range
* @return {boolean}
*/
function spansMultipleLists(range){
return range.startContainer !== range.endContainer;
}
/**
* Take list items out of their encompassing list element.
* Wrap items in <p> and delete any remaining empty lists.
* @param Range range
* @return void
*/
function unformatList(range){
expandRange(range);
var cac = range.commonAncestorContainer;
if (!isListElement(cac)){
return;
}
if (!isEntireNodeInRange(range) && !spansMultipleLists(range)) {
return;
}
var selectedNodes = jQuery(range.startContainer.parentNode).nextUntil(jQuery(range.endContainer.parentNode).next()).andSelf();
var prevNodes = jQuery(range.startContainer.parentNode).prevAll();
var nextNodes = jQuery(range.endContainer.parentNode).nextAll();
var listName = range.startContainer.parentNode.parentNode.nodeName;
// first list item
if (selectedNodes.length === 1 && prevNodes.length === 0) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertBefore(nextNodes.parent());
}
// last list item
else if (selectedNodes.length === 1 && nextNodes.length === 0) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(prevNodes.parent());
}
// one list item in middle
else if (selectedNodes.length === 1 && nextNodes.length > 1) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(prevNodes.parent());
jQuery('<' + listName.toLowerCase() + '>').append(nextNodes).insertAfter(jQuery(range.endContainer));
}
// multiple list items up to whole list
else {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(cac);
if (nextNodes.length > 0) {
jQuery('<' + listName.toLowerCase() + '>').append(nextNodes).insertAfter(jQuery(range.endContainer));
}
}
// unwrap moved list elements
jQuery('._moved').each(function() {
jQuery(this).contents().unwrap().wrap('<p>');
});
// If we are at the first list element, get rid of original (now empty) list
if (prevNodes.length === 0) {
cac.remove();
}
}
=======
>>>>>>>
/**
* Checks if the selection spans a whole node (HTML element)
* @param Range range
* @return {boolean}
*/
function isEntireNodeInRange(range) {
var sc = range.startContainer;
var so = range.startOffset;
var ec = range.endContainer;
var eo = range.endOffset;
return (sc === ec && so === 0 && eo === ec.length);
}
/**
* Alias for isInlineFormatable function from Html lib
*/
var isInlineNode = Html.isInlineFormattable;
/**
* Expands the (invisible) range to encompass the whole node
* that was selected by the user
* @param Range range
* @return void
*/
function expandRange(range) {
var cac = range.commonAncestorContainer;
if (isInlineNode(cac)) {
var parent = cac.parentNode;
range.startContainer = parent;
range.endContainer = parent;
range.commonAncestorContainer = parent;
range.startOffset = 0;
range.endOffset = 1;
expandRange(range);
return;
}
// Because at this point there will be no further recursion, we should
// finally update the state of `range`
range.update();
}
/**
* Collision map to determine if we are
* working on a list related node.
*/
var LIST_ELEMENT = {
'OL': true,
'UL': true,
'LI': true,
'DL': true,
'DT': true,
'DD': true
};
/**
* Determine if we are working on a list element
* using the previous LIST_ELEMENT hash map.
* @param DOM node
* @return {boolean}
*/
function isListElement(node){
return LIST_ELEMENT[node.nodeName];
}
/**
* Determines if a markup is a heading
* @param string markup
* @returns {boolean}
*/
function isHeading(markup){
return jQuery.inArray(markup,['h1', 'h2', 'h3', 'h4', 'h5', 'h6']) >= 0;
}
/**
* Checks whether range spans multiple lists
* @param Range range
* @return {boolean}
*/
function spansMultipleLists(range){
return range.startContainer !== range.endContainer;
}
/**
* Take list items out of their encompassing list element.
* Wrap items in <p> and delete any remaining empty lists.
* @param Range range
* @return void
*/
function unformatList(range){
expandRange(range);
var cac = range.commonAncestorContainer;
if (!isListElement(cac)){
return;
}
if (!isEntireNodeInRange(range) && !spansMultipleLists(range)) {
return;
}
var selectedNodes = jQuery(range.startContainer.parentNode).nextUntil(jQuery(range.endContainer.parentNode).next()).andSelf();
var prevNodes = jQuery(range.startContainer.parentNode).prevAll();
var nextNodes = jQuery(range.endContainer.parentNode).nextAll();
var listName = range.startContainer.parentNode.parentNode.nodeName;
// first list item
if (selectedNodes.length === 1 && prevNodes.length === 0) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertBefore(nextNodes.parent());
}
// last list item
else if (selectedNodes.length === 1 && nextNodes.length === 0) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(prevNodes.parent());
}
// one list item in middle
else if (selectedNodes.length === 1 && nextNodes.length > 1) {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(prevNodes.parent());
jQuery('<' + listName.toLowerCase() + '>').append(nextNodes).insertAfter(jQuery(range.endContainer));
}
// multiple list items up to whole list
else {
selectedNodes.each(function(){
jQuery(this).addClass('_moved');
}).remove().insertAfter(cac);
if (nextNodes.length > 0) {
jQuery('<' + listName.toLowerCase() + '>').append(nextNodes).insertAfter(jQuery(range.endContainer));
}
}
// unwrap moved list elements
jQuery('._moved').each(function() {
jQuery(this).contents().unwrap().wrap('<p>');
});
// If we are at the first list element, get rid of original (now empty) list
if (prevNodes.length === 0) {
cac.remove();
}
}
<<<<<<<
var formatPlugin = this,
markup = jQuery('<'+button+'>'),
rangeObject = Selection.rangeObject;
=======
var formatPlugin = this;
var markup = jQuery('<'+button+'>');
var rangeObject = Aloha.Selection.rangeObject;
>>>>>>>
var formatPlugin = this,
markup = jQuery('<'+button+'>'),
rangeObject = Selection.rangeObject;
<<<<<<<
hotKey: {
formatBold: 'ctrl+b meta+b',
formatItalic: 'ctrl+i meta+i',
formatUnderline: 'ctrl+u meta+u',
formatPre: 'ctrl+p meta+p',
formatDel: 'ctrl+d meta+d',
formatParagraph: 'alt+ctrl+0 alt+meta+0',
formatH1: 'alt+ctrl+1 alt+meta+1',
formatH2: 'alt+ctrl+2 alt+meta+2',
formatH3: 'alt+ctrl+3 alt+meta+3',
formatH4: 'alt+ctrl+4 alt+meta+4',
formatH5: 'alt+ctrl+5 alt+meta+5',
formatH6: 'alt+ctrl+6 alt+meta+6',
formatSub: 'alt+shift+s',
formatSup: 'ctrl+shift+s'
=======
hotKey: {
formatBold: 'ctrl+b',
formatItalic: 'ctrl+i',
formatParagraph: 'alt+ctrl+0',
formatH1: 'alt+ctrl+1',
formatH2: 'alt+ctrl+2',
formatH3: 'alt+ctrl+3',
formatH4: 'alt+ctrl+4',
formatH5: 'alt+ctrl+5',
formatH6: 'alt+ctrl+6',
formatPre: 'ctrl+p',
formatDel: 'ctrl+d',
formatSub: 'alt+shift+s',
formatSup: 'ctrl+shift+s'
>>>>>>>
hotKey: {
formatBold: 'ctrl+b meta+b',
formatItalic: 'ctrl+i meta+i',
formatUnderline: 'ctrl+u meta+u',
formatParagraph: 'alt+ctrl+0 alt+meta+0',
formatH1: 'alt+ctrl+1 alt+meta+1',
formatH2: 'alt+ctrl+2 alt+meta+2',
formatH3: 'alt+ctrl+3 alt+meta+3',
formatH4: 'alt+ctrl+4 alt+meta+4',
formatH5: 'alt+ctrl+5 alt+meta+5',
formatH6: 'alt+ctrl+6 alt+meta+6',
formatPre: 'ctrl+p meta+p',
formatDel: 'ctrl+d meta+d',
formatSub: 'alt+shift+s',
formatSup: 'ctrl+shift+s'
<<<<<<<
PubSub.sub('aloha.editable.activated', function (message) {
var editable = message.editable;
me.applyButtonConfig(editable.obj);
if (shouldCheckHeadingHierarchy) {
checkHeadings();
}
=======
Aloha.bind('aloha-editable-activated',function (e, params) {
me.applyButtonConfig(params.editable.obj);
>>>>>>>
PubSub.sub('aloha.editable.activated', function (message) {
var editable = message.editable;
me.applyButtonConfig(editable.obj);
if (shouldCheckHeadingHierarchy) {
checkHeadings();
}
<<<<<<<
PubSub.sub('aloha.editable.deactivated', function (message) {
message.editable.obj.unbind('keydown.aloha.format');
=======
Aloha.bind('aloha-editable-deactivated',function (e, params) {
params.editable.obj.unbind('keydown.aloha.format');
>>>>>>>
PubSub.sub('aloha.editable.deactivated', function (message) {
message.editable.obj.unbind('keydown.aloha.format');
<<<<<<<
var formats = [
'u', 'strong', 'em', 'b', 'i', 'q', 'del', 's', 'code', 'sub', 'sup', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'quote', 'blockquote',
'section', 'article', 'aside', 'header', 'footer', 'address', 'main', 'hr', 'figure', 'figcaption', 'div', 'small', 'cite', 'dfn',
'abbr', 'data', 'time', 'var', 'samp', 'kbd', 'mark', 'span', 'wbr', 'ins'
],
rangeObject = Selection.rangeObject,
=======
var formats = [ 'u', 'strong', 'em', 'b', 'i', 'q', 'del', 's', 'code', 'sub', 'sup', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'quote', 'blockquote' ],
rangeObject = Aloha.Selection.rangeObject,
>>>>>>>
var formats = [
'u', 'strong', 'em', 'b', 'i', 'q', 'del', 's', 'code', 'sub', 'sup', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'quote', 'blockquote',
'section', 'article', 'aside', 'header', 'footer', 'address', 'main', 'hr', 'figure', 'figcaption', 'div', 'small', 'cite', 'dfn',
'abbr', 'data', 'time', 'var', 'samp', 'kbd', 'mark', 'span', 'wbr', 'ins'
],
rangeObject = Selection.rangeObject, |
<<<<<<<
var deleteHandle = jQuery('<span class="block-draghandle-topright"><a href="#"><span>x</span> delete</a></span>');
=======
var deleteHandle = $('<span class="block-draghandle-topleft"><a href="#"><span>x</span> delete</a></span>');
>>>>>>>
var deleteHandle = jQuery('<span class="block-draghandle-topleft"><a href="#"><span>x</span> delete</a></span>');
<<<<<<<
var template = jQuery('<div />').html(this.element.html());
=======
var template = $('<div />').html(this.$innerElement.html());
>>>>>>>
var template = jQuery('<div />').html(this.$innerElement.html());
<<<<<<<
_currentlyRendering: null,
_renderAndSetContent: function() {
if (this._currentlyRendering) return;
this._currentlyRendering = true;
var innerElement = jQuery('<' + this._getWrapperElementType() + ' class="aloha-block-inner" />');
var result = this.render(innerElement);
// Convenience for simple string content
if (typeof result === 'string') {
innerElement.html(result);
}
this.element.empty();
this.element.append(innerElement);
this.createEditables(innerElement);
this.renderToolbar();
},
=======
>>>>>>> |
<<<<<<<
* Selection into which the content should be inserted. If not provided the current model document selection will be used.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
* This param defines a position in relation to that item.
=======
* The selection into which the content should be inserted. If not provided, the current model document selection will be used.
>>>>>>>
* The selection into which the content should be inserted. If not provided the current model document selection will be used.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
* This param defines a position in relation to that item. |
<<<<<<<
//
//function getActiveRange() {
//
// var ret;
// if (globalRange) {
// ret = globalRange;
// } else if (Aloha.getSelection().rangeCount) {
// ret = Aloha.getSelection().getRangeAt(0);
// } else {
// return null;
// }
// if ([Node.TEXT_NODE, Node.ELEMENT_NODE].indexOf(ret.startContainer.nodeType) == -1
// || [Node.TEXT_NODE, Node.ELEMENT_NODE].indexOf(ret.endContainer.nodeType) == -1
// || !ret.startContainer.ownerDocument
// || !ret.endContainer.ownerDocument
// || !isDescendant(ret.startContainer, ret.startContainer.ownerDocument)
// || !isDescendant(ret.endContainer, ret.endContainer.ownerDocument)) {
// throw "Invalid active range; test bug?";
// }
// return ret;
//}
=======
function getActiveRange() {
var ret;
if (globalRange) {
ret = globalRange;
} else if (Aloha.getSelection().rangeCount) {
ret = Aloha.getSelection().getRangeAt(0);
} else {
return null;
}
if ($_( [$_.Node.TEXT_NODE, $_.Node.ELEMENT_NODE] ).indexOf(ret.startContainer.nodeType) == -1
|| $_( [$_.Node.TEXT_NODE, $_.Node.ELEMENT_NODE] ).indexOf(ret.endContainer.nodeType) == -1
|| !ret.startContainer.ownerDocument
|| !ret.endContainer.ownerDocument
|| !isDescendant(ret.startContainer, ret.startContainer.ownerDocument)
|| !isDescendant(ret.endContainer, ret.endContainer.ownerDocument)) {
throw "Invalid active range; test bug?";
}
return ret;
}
>>>>>>>
function getActiveRange() {
var ret;
if (globalRange) {
ret = globalRange;
} else if (Aloha.getSelection().rangeCount) {
ret = Aloha.getSelection().getRangeAt(0);
} else {
return null;
}
if ($_( [$_.Node.TEXT_NODE, $_.Node.ELEMENT_NODE] ).indexOf(ret.startContainer.nodeType) == -1
|| $_( [$_.Node.TEXT_NODE, $_.Node.ELEMENT_NODE] ).indexOf(ret.endContainer.nodeType) == -1
|| !ret.startContainer.ownerDocument
|| !ret.endContainer.ownerDocument
|| !isDescendant(ret.startContainer, ret.startContainer.ownerDocument)
|| !isDescendant(ret.endContainer, ret.endContainer.ownerDocument)) {
throw "Invalid active range; test bug?";
}
return ret;
}
<<<<<<<
var node = getAllEffectivelyContainedNodes(range, function(node) {
return isEditable(node) && node.nodeType == Node.TEXT_NODE;
=======
var node = getAllEffectivelyContainedNodes(getActiveRange(), function(node) {
return isEditable(node) && node.nodeType == $_.Node.TEXT_NODE;
>>>>>>>
var node = getAllEffectivelyContainedNodes(range, function(node) {
return isEditable(node) && node.nodeType == $_.Node.TEXT_NODE;
<<<<<<<
var node = getAllEffectivelyContainedNodes(range)
.filter(function(node) { return isEditable(node) && node.nodeType == Node.TEXT_NODE })[0];
=======
var node = $_( getAllEffectivelyContainedNodes(getActiveRange()) )
.filter(function(node) { return isEditable(node) && node.nodeType == $_.Node.TEXT_NODE })[0];
>>>>>>>
var node = $_( getAllEffectivelyContainedNodes(range) )
.filter(function(node) { return isEditable(node) && node.nodeType == $_.Node.TEXT_NODE })[0];
<<<<<<<
["fontname", "fontsize", "forecolor", "hilitecolor"].forEach(function(command) {
overrides.push([command, commands[command].value(range)]);
=======
$_( ["fontname", "fontsize", "forecolor", "hilitecolor"] ).forEach(function(command) {
overrides.push([command, commands[command].value()]);
>>>>>>>
$_( ["fontname", "fontsize", "forecolor", "hilitecolor"] ).forEach(function(command) {
overrides.push([command, commands[command].value(range)]); |
<<<<<<<
/* undo-plugin.js is part of Aloha Editor project http://aloha-editor.org
*
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
*
* Aloha Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As an additional permission to the GNU GPL version 2, you may distribute
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
* source code without the copy of the GNU GPL normally required,
* provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
*/
define(
['aloha', 'jquery', 'aloha/plugin', 'undo/vendor/undo', 'undo/vendor/diff_match_patch_uncompressed'],
function( Aloha, jQuery, Plugin) {
"use strict";
var
dmp = new diff_match_patch,
resetFlag = false;
function reversePatch(patch) {
var reversed = dmp.patch_deepCopy(patch);
for (var i = 0; i < reversed.length; i++) {
for (var j = 0; j < reversed[i].diffs.length; j++) {
reversed[i].diffs[j][0] = -(reversed[i].diffs[j][0]);
}
}
return reversed;
}
/**
* register the plugin with unique name
*/
return Plugin.create('undo', {
/**
* Initialize the plugin and set initialize flag on true
*/
init: function () {
var stack = new Undo.Stack(),
EditCommand = Undo.Command.extend({
constructor: function(editable, patch) {
this.editable = editable;
this.patch = patch;
},
execute: function() {
//command object is created after execution.
},
undo: function() {
this.phase(reversePatch(this.patch));
},
redo: function() {
this.phase(this.patch);
},
phase: function(patch) {
var contents = this.editable.getContents(),
applied = dmp.patch_apply(patch, contents),
newValue = applied[0],
didNotApply = applied[1];
if (didNotApply.length) {
//error
}
this.reset(newValue);
},
reset: function(val) {
//we have to trigger a smartContentChange event
//after doing an undo or redo, but we mustn't
//push new commands on the stack, because there
//are no new commands, just the old commands on
//the stack that are undone or redone.
resetFlag = true;
var reactivate = null;
if (Aloha.getActiveEditable() === this.editable) {
Aloha.deactivateEditable();
reactivate = this.editable;
}
this.editable.obj.html(val);
if (null !== reactivate) {
reactivate.activate();
}
//TODO: this is a call to an internal
//function. There should be an API to generate
//new smartContentChangeEvents.
this.editable.smartContentChange({type : 'blur'});
resetFlag = false;
}
});
stack.changed = function() {
// update UI
};
// @todo use aloha hotkeys here
jQuery(document).keydown(function(event) {
if (!event.metaKey || event.keyCode != 90) {
return;
}
event.preventDefault();
//Before doing an undo, bring the smartContentChange
//event up to date.
if ( null !== Aloha.getActiveEditable() ) {
Aloha.getActiveEditable().smartContentChange({type : 'blur'});
}
if (event.shiftKey) {
stack.canRedo() && stack.redo();
} else {
stack.canUndo() && stack.undo();
}
});
Aloha.bind('aloha-smart-content-changed', function(jevent, aevent) {
if (resetFlag) {
return;
}
var oldValue = aevent.snapshotContent,
newValue = aevent.editable.getContents(),
patch = dmp.patch_make(oldValue, newValue);
// only push an EditCommand if something actually changed.
if (0 !== patch.length) {
stack.execute( new EditCommand( aevent.editable, patch ) );
}
});
},
/**
* toString method
* @return string
*/
toString: function () {
return 'undo';
}
});
=======
/*!
* Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH
* [email protected]
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
define(
['aloha', 'aloha/jquery', 'aloha/plugin', 'undo/vendor/undo', 'undo/vendor/diff_match_patch_uncompressed'],
function( Aloha, jQuery, Plugin) {
"use strict";
var
dmp = new diff_match_patch,
resetFlag = false;
function reversePatch(patch) {
var reversed = dmp.patch_deepCopy(patch);
for (var i = 0; i < reversed.length; i++) {
for (var j = 0; j < reversed[i].diffs.length; j++) {
reversed[i].diffs[j][0] = -(reversed[i].diffs[j][0]);
}
}
return reversed;
}
/**
* register the plugin with unique name
*/
return Plugin.create('undo', {
/**
* Initialize the plugin and set initialize flag on true
*/
init: function () {
var stack = new Undo.Stack(),
EditCommand = Undo.Command.extend({
constructor: function(editable, patch) {
this.editable = editable;
this.patch = patch;
},
execute: function() {
//command object is created after execution.
},
undo: function() {
this.phase(reversePatch(this.patch));
},
redo: function() {
this.phase(this.patch);
},
phase: function(patch) {
var contents = this.editable.getContents(),
applied = dmp.patch_apply(patch, contents),
newValue = applied[0],
didNotApply = applied[1];
if (didNotApply.length) {
//error
}
this.reset(newValue);
},
reset: function(val) {
//we have to trigger a smartContentChange event
//after doing an undo or redo, but we mustn't
//push new commands on the stack, because there
//are no new commands, just the old commands on
//the stack that are undone or redone.
resetFlag = true;
var reactivate = null;
if (Aloha.getActiveEditable() === this.editable) {
Aloha.deactivateEditable();
reactivate = this.editable;
}
this.editable.obj.html(val);
if (null !== reactivate) {
reactivate.activate();
}
//TODO: this is a call to an internal
//function. There should be an API to generate
//new smartContentChangeEvents.
this.editable.smartContentChange({type : 'blur'});
resetFlag = false;
}
});
stack.changed = function() {
// update UI
};
jQuery(document).keydown(function(event) {
if (!event.metaKey || event.keyCode != 90) {
return;
}
event.preventDefault();
//Before doing an undo, bring the smartContentChange
//event up to date.
if ( null !== Aloha.getActiveEditable() ) {
Aloha.getActiveEditable().smartContentChange({type : 'blur'});
}
if (event.shiftKey) {
stack.canRedo() && stack.redo();
} else {
stack.canUndo() && stack.undo();
}
});
Aloha.bind('aloha-smart-content-changed', function(jevent, aevent) {
if (resetFlag) {
return;
}
var oldValue = aevent.getSnapshotContent(),
newValue = aevent.editable.getContents(),
patch = dmp.patch_make(oldValue, newValue);
// only push an EditCommand if something actually changed.
if (0 !== patch.length) {
stack.execute( new EditCommand( aevent.editable, patch ) );
}
});
},
/**
* toString method
* @return string
*/
toString: function () {
return 'undo';
}
});
>>>>>>>
/* undo-plugin.js is part of Aloha Editor project http://aloha-editor.org
*
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
* Contributors http://aloha-editor.org/contribution.php
*
* Aloha Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* As an additional permission to the GNU GPL version 2, you may distribute
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
* source code without the copy of the GNU GPL normally required,
* provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
*/
define(
['aloha', 'jquery', 'aloha/plugin', 'undo/vendor/undo', 'undo/vendor/diff_match_patch_uncompressed'],
function( Aloha, jQuery, Plugin) {
"use strict";
var
dmp = new diff_match_patch,
resetFlag = false;
function reversePatch(patch) {
var reversed = dmp.patch_deepCopy(patch);
for (var i = 0; i < reversed.length; i++) {
for (var j = 0; j < reversed[i].diffs.length; j++) {
reversed[i].diffs[j][0] = -(reversed[i].diffs[j][0]);
}
}
return reversed;
}
/**
* register the plugin with unique name
*/
return Plugin.create('undo', {
/**
* Initialize the plugin and set initialize flag on true
*/
init: function () {
var stack = new Undo.Stack(),
EditCommand = Undo.Command.extend({
constructor: function(editable, patch) {
this.editable = editable;
this.patch = patch;
},
execute: function() {
//command object is created after execution.
},
undo: function() {
this.phase(reversePatch(this.patch));
},
redo: function() {
this.phase(this.patch);
},
phase: function(patch) {
var contents = this.editable.getContents(),
applied = dmp.patch_apply(patch, contents),
newValue = applied[0],
didNotApply = applied[1];
if (didNotApply.length) {
//error
}
this.reset(newValue);
},
reset: function(val) {
//we have to trigger a smartContentChange event
//after doing an undo or redo, but we mustn't
//push new commands on the stack, because there
//are no new commands, just the old commands on
//the stack that are undone or redone.
resetFlag = true;
var reactivate = null;
if (Aloha.getActiveEditable() === this.editable) {
Aloha.deactivateEditable();
reactivate = this.editable;
}
this.editable.obj.html(val);
if (null !== reactivate) {
reactivate.activate();
}
//TODO: this is a call to an internal
//function. There should be an API to generate
//new smartContentChangeEvents.
this.editable.smartContentChange({type : 'blur'});
resetFlag = false;
}
});
stack.changed = function() {
// update UI
};
// @todo use aloha hotkeys here
jQuery(document).keydown(function(event) {
if (!event.metaKey || event.keyCode != 90) {
return;
}
event.preventDefault();
//Before doing an undo, bring the smartContentChange
//event up to date.
if ( null !== Aloha.getActiveEditable() ) {
Aloha.getActiveEditable().smartContentChange({type : 'blur'});
}
if (event.shiftKey) {
stack.canRedo() && stack.redo();
} else {
stack.canUndo() && stack.undo();
}
});
Aloha.bind('aloha-smart-content-changed', function(jevent, aevent) {
if (resetFlag) {
return;
}
var oldValue = aevent.getSnapshotContent(),
newValue = aevent.editable.getContents(),
patch = dmp.patch_make(oldValue, newValue);
// only push an EditCommand if something actually changed.
if (0 !== patch.length) {
stack.execute( new EditCommand( aevent.editable, patch ) );
}
});
},
/**
* toString method
* @return string
*/
toString: function () {
return 'undo';
}
}); |
<<<<<<<
define([
=======
define([
// js
>>>>>>>
define([
<<<<<<<
'RepositoryBrowser',
=======
'browser/browser-plugin',
// i18n
>>>>>>>
'RepositoryBrowser',
<<<<<<<
], function(
Aloha,
jQuery,
Plugin,
PluginManager,
Ui,
Button,
Links,
RepositoryBrowser,
i18n,
i18nCore
) {
=======
], function( Aloha, jQuery, Plugin, PluginManager, FloatingMenu, Links,
RepositoryBrowser, i18n, i18nCore ) {
>>>>>>>
], function(
Aloha,
jQuery,
Plugin,
PluginManager,
Ui,
Button,
Links,
RepositoryBrowser,
i18n,
i18nCore
) {
<<<<<<<
var LinkBrowser = RepositoryBrowser.extend({
init: function (config) {
this._super(config);
=======
var LinkBrowser = RepositoryBrowser.extend({
init: function ( config ) {
this._super( config );
>>>>>>>
var LinkBrowser = RepositoryBrowser.extend({
init: function (config) {
this._super(config);
<<<<<<<
this._linkBrowserButton = Ui.adopt('linkBrowser', Button, {
tooltip: i18n.t('button.addlink.tooltip'),
icon: 'aloha-icon-tree',
scope: 'Aloha.continuoustext',
click: function () {
that.open();
}
});
this._linkBrowserButton.hide();
=======
var repositoryButton = new Aloha.ui.Button({
iconClass : 'aloha-button-big aloha-button-tree',
size : 'large',
onclick : function () { that.show(); },
tooltip : i18n.t( 'button.addlink.tooltip' ),
toggle : false
});
FloatingMenu.addButton(
'Aloha.continuoustext',
repositoryButton,
i18n.t( 'floatingmenu.tab.link' ),
1
);
repositoryButton.hide();
>>>>>>>
this._linkBrowserButton = Ui.adopt('linkBrowser', Button, {
tooltip: i18n.t('button.addlink.tooltip'),
icon: 'aloha-icon-tree',
scope: 'Aloha.continuoustext',
click: function () {
that.show();
}
});
this._linkBrowserButton.hide();
<<<<<<<
Aloha.bind('aloha-link-selected', function (event, rangeObject) {
that._linkBrowserButton.show();
=======
Aloha.bind( 'aloha-link-selected', function ( event, rangeObject ) {
repositoryButton.show();
FloatingMenu.doLayout();
>>>>>>>
Aloha.bind('aloha-link-selected', function (event, rangeObject) {
that._linkBrowserButton.show();
<<<<<<<
onSelect: function (item) {
Links.hrefField.setItem(item)
// Now create a selection within the editable since the user should
// be able to type once the link has been created.
// 1. We need to save the current cursor position since the a
// activate editable event will be fired and this will set the
// cursor in the upper left cornor of the editable.
var range = Aloha.Selection.getRangeObject();
var currentStartContainer = range.startContainer = range.endContainer;
=======
onSelect: function ( item ) {
Links.hrefField.setItem( item );
// Now create a selection within the editable since the user should be able to type once the link has been created.
// 1. We need to save the current cursor position since the a activate editable event will be fired and this will
// set the cursor in the upper left cornor of the editable.
var range = Aloha.Selection.getRangeObject();
var currentStartContainer = range.startContainer = range.endContainer;
>>>>>>>
onSelect: function (item) {
Links.hrefField.setItem(item)
// Now create a selection within the editable since the user should
// be able to type once the link has been created.
// 1. We need to save the current cursor position since the a
// activate editable event will be fired and this will set the
// cursor in the upper left cornor of the editable.
var range = Aloha.Selection.getRangeObject();
var currentStartContainer = range.startContainer = range.endContainer;
<<<<<<<
Aloha.trigger('aloha-link-selected-in-linkbrowser', item);
// Close the browser lightbox.
=======
Aloha.trigger( 'aloha-link-selected-in-linkbrowser' , item );
// Close the browser lightbox
>>>>>>>
Aloha.trigger('aloha-link-selected-in-linkbrowser', item);
// Close the browser lightbox.
<<<<<<<
renderRowCols: function (item) {
=======
renderRowCols: function ( item ) {
>>>>>>>
renderRowCols: function (item) {
<<<<<<<
idMatch = item.id.match(/(\d+)\./);
jQuery.each(this.columns, function (colName, v) {
switch (colName) {
=======
idMatch = item.id.match( /(\d+)\./ );
jQuery.each( this.columns, function ( colName, v ) {
switch ( colName ) {
>>>>>>>
idMatch = item.id.match(/(\d+)\./);
jQuery.each(this.columns, function (colName, v) {
switch (colName) {
<<<<<<<
for (; i > 0; --i) {
r = rends[i];
if (r.kind == 'translation') {
=======
for ( ; i > 0; --i ) {
r = rends[ i ];
if ( r.kind == 'translation' ) {
>>>>>>>
for (; i > 0; --i) {
r = rends[i];
if (r.kind == 'translation') {
<<<<<<<
row.translations = strBldr.join('');
=======
row.translations = strBldr.join( '' );
>>>>>>>
row.translations = strBldr.join('');
<<<<<<<
});
=======
} );
>>>>>>>
});
<<<<<<<
=======
>>>>>>>
<<<<<<<
objectTypeFilter : ['website', 'file', 'image', 'language' /*, '*' */],
renditionFilter : ['*'],
filter : ['language'],
=======
objectTypeFilter : [ 'website', 'file', 'image', 'language' /*, '*' */ ],
renditionFilter : [ '*' ],
filter : [ 'language' ],
>>>>>>>
objectTypeFilter : ['website', 'file', 'image', 'language' /*, '*' */],
renditionFilter : ['*'],
filter : ['language'],
<<<<<<<
rootPath : Aloha.settings.baseUrl + '/vendor/repository-browser/'
=======
rootPath : Aloha.getPluginUrl( 'browser' ) + '/'
>>>>>>>
rootPath : Aloha.settings.baseUrl + '/vendor/repository-browser/'
<<<<<<<
this.browser = new LinkBrowser(config);
=======
this.browser = new LinkBrowser( config );
>>>>>>>
this.browser = new LinkBrowser(config); |
<<<<<<<
// We need to bind to selection-changed event to recognize
// backspace and delete interactions.
Aloha.bind('aloha-smart-content-changed', function (event) {
if (that.showNumbers()) {
=======
// We need to bind to smart-content-changed event to recognize
// backspace and delete interactions.
Aloha.bind('aloha-smart-content-changed', function (event) {
that.cleanNumerations();
if (that.showNumbers()) {
that.createNumeratedHeaders();
}
});
// We need to listen to that event, when a block is formatted to
// header format. smart-content-changed would be not fired in
// that case
Aloha.bind('aloha-format-block', function () {
that.cleanNumerations();
if (that.showNumbers()) {
>>>>>>>
// We need to bind to smart-content-changed event to recognize
// backspace and delete interactions.
Aloha.bind('aloha-smart-content-changed', function (event) {
that.cleanNumerations();
if (that.showNumbers()) {
that.createNumeratedHeaders();
}
});
// We need to listen to that event, when a block is formatted to
// header format. smart-content-changed would be not fired in
// that case
Aloha.bind('aloha-format-block', function () {
that.cleanNumerations();
if (that.showNumbers()) {
<<<<<<<
if (that.isNumeratingOn()) {
that._formatNumeratedHeadersButton.show(true);
that.initForEditable(Aloha.activeEditable.obj);
} else {
that._formatNumeratedHeadersButton.show(false);
=======
// hide the button, when numerating is off
if (that.numeratedHeadersButton) {
if (that.isNumeratingOn()) {
that.numeratedHeadersButton.show();
that.initForEditable(Aloha.activeEditable.obj);
} else {
that.numeratedHeadersButton.hide();
}
>>>>>>>
if (that.isNumeratingOn()) {
that._formatNumeratedHeadersButton.show();
that.initForEditable(Aloha.activeEditable.obj);
} else {
that._formatNumeratedHeadersButton.hide();
<<<<<<<
=======
>>>>>>>
<<<<<<<
flag = (true === getCurrentConfig(this).numeratedactive)
? 'true'
: 'false';
=======
flag = (true === this.getCurrentConfig().numeratedactive) ? 'true' : 'false';
>>>>>>>
flag = (true === this.getCurrentConfig().numeratedactive) ? 'true' : 'false';
<<<<<<<
* Check whether numerating shall be possible in the current editable.
=======
* Get the config for the current editable
*/
getCurrentConfig: function () {
var config = this.getEditableConfig(Aloha.activeEditable.obj);
// normalize config (set default values)
if (config.numeratedactive === true || config.numeratedactive === 'true' || config.numeratedactive === '1') {
config.numeratedactive = true;
} else {
config.numeratedactive = false;
}
if (typeof config.headingselector !== 'string') {
config.headingselector = 'h1, h2, h3, h4, h5, h6';
}
config.headingselector = $.trim(config.headingselector);
if (config.trailingdot === true || config.trailingdot === 'true' || config.trailingdot === '1') {
config.trailingdot = true;
} else {
config.trailingdot = false;
}
return config;
},
/**
* Check whether numerating shall be possible in the current editable
>>>>>>>
* Get the config for the current editable
*/
getCurrentConfig: function () {
var config = this.getEditableConfig(Aloha.activeEditable.obj);
// normalize config (set default values)
if (config.numeratedactive === true || config.numeratedactive === 'true' || config.numeratedactive === '1') {
config.numeratedactive = true;
} else {
config.numeratedactive = false;
}
if (typeof config.headingselector !== 'string') {
config.headingselector = 'h1, h2, h3, h4, h5, h6';
}
config.headingselector = $.trim(config.headingselector);
if (config.trailingdot === true || config.trailingdot === 'true' || config.trailingdot === '1') {
config.trailingdot = true;
} else {
config.trailingdot = false;
}
return config;
},
/**
* Check whether numerating shall be possible in the current editable
<<<<<<<
return getCurrentConfig(this).headingselector !== '';
=======
return this.getCurrentConfig().headingselector !== '';
>>>>>>>
return this.getCurrentConfig().headingselector !== '';
<<<<<<<
Aloha.activeEditable.obj.attr('aloha-numerated-headers', 'false');
var headingselector = getCurrentConfig(this).headingselector;
var headers = active_editable_obj.find(headingselector);
headers.each(function () {
$(this).find('span[role=annotation]').each(function () {
$(this).remove();
});
=======
$(active_editable_obj).find('span[role=annotation]').each(function () {
$(this).remove();
>>>>>>>
$(active_editable_obj).find('span[role=annotation]').each(function () {
$(this).remove();
<<<<<<<
if (!obj || 0 === $(obj).length) {
=======
if (!obj || $(obj).length <= 0) {
>>>>>>>
if (!obj || $(obj).length <= 0) {
<<<<<<<
=======
>>>>>>>
<<<<<<<
var config = getCurrentConfig(this);
var headingselector = config.headingselector;
var headers = active_editable_obj.find(headingselector);
Aloha.activeEditable.obj.attr('aloha-numerated-headers', 'true');
=======
var config = this.getCurrentConfig();
var headingselector = config.headingselector;
var headers = active_editable_obj.find(headingselector);
Aloha.activeEditable.obj.attr('aloha-numerated-headers', 'true');
>>>>>>>
var config = this.getCurrentConfig();
var headingselector = config.headingselector;
var headers = active_editable_obj.find(headingselector);
Aloha.activeEditable.obj.attr('aloha-numerated-headers', 'true');
<<<<<<<
$(this).prepend('<span role="annotation">' +
annotation_result + '</span> ');
=======
$(this).prepend('<span role="annotation">' +
annotation_result + '</span>');
>>>>>>>
$(this).prepend('<span role="annotation">' +
annotation_result + '</span>'); |
<<<<<<<
const $label = qs('.preference__label', this.$container);
$label.innerHTML = this.label;
this._addDescription($label);
=======
qs('.pref-container__label', this.$container).innerHTML = this.label;
qs('.pref-container__description', this.$container).innerHTML = this.description;
this._fillDocLink();
>>>>>>>
const $label = qs('.preference__label', this.$container);
$label.innerHTML = this.label;
this._addDescription($label);
this._fillDocLink(); |
<<<<<<<
import punycode from 'punycode';
=======
export const PREFIX_REGEX = '@';
export const PREFIX_GLOB = '!';
>>>>>>>
import punycode from 'punycode';
export const PREFIX_REGEX = '@';
export const PREFIX_GLOB = '!';
<<<<<<<
return punycode.toUnicode(parsedUrl.hostname.replace('www.', '')) + parsedUrl.pathname;
=======
return parsedUrl.hostname.replace('www.', '') + parsedUrl.pathname;
};
/**
* Checks if the URL matches a given hostmap
*
* Depending on the prefix in the hostmap it'll choose a match method:
* - regex
* - TODO: glob
* - standard
*
* @param url {URL}
* @param map
* @return {*}
*/
export const matchesSavedMap = (url, map) => {
const savedHost = map.host;
if (savedHost[0] === PREFIX_REGEX) {
return new RegExp(savedHost.substr(1)).test(url);
} else {
const key = urlKeyFromUrl(url);
const _url = ((key.indexOf('/') === -1) ? key.concat('/') : key).toLowerCase();
const mapHost = ((map.host.indexOf('/') === -1) ? map.host.concat('/') : map.host).toLowerCase();
return domainMatch(_url, mapHost) && pathMatch(_url, mapHost);
}
>>>>>>>
return punycode.toUnicode(parsedUrl.hostname.replace('www.', '')) + parsedUrl.pathname;
};
/**
* Checks if the URL matches a given hostmap
*
* Depending on the prefix in the hostmap it'll choose a match method:
* - regex
* - TODO: glob
* - standard
*
* @param url {URL}
* @param map
* @return {*}
*/
export const matchesSavedMap = (url, map) => {
const savedHost = map.host;
if (savedHost[0] === PREFIX_REGEX) {
return new RegExp(savedHost.substr(1)).test(url);
} else {
const key = urlKeyFromUrl(url);
const _url = ((key.indexOf('/') === -1) ? key.concat('/') : key).toLowerCase();
const mapHost = ((map.host.indexOf('/') === -1) ? map.host.concat('/') : map.host).toLowerCase();
return domainMatch(_url, mapHost) && pathMatch(_url, mapHost);
} |
<<<<<<<
/* Copyright (C) 2017 Nicola Zambello
*
* https://github.com/nzambello/ellipsed
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*/
function tokensReducer(acc, token) {
const { el, elStyle, rowsLimit, rowsWrapped } = acc;
if (rowsWrapped === rowsLimit + 1) {
return { ...acc };
}
const textBeforeWrap = el.textContent;
const elHeight = elStyle.height;
let newRowsWrapped = rowsWrapped;
el.textContent = el.textContent.length
? `${el.textContent} ${token}...`
: `${token}...`;
if (parseFloat(elStyle.height) > parseFloat(elHeight)) {
newRowsWrapped++;
if (newRowsWrapped === rowsLimit + 1) {
el.textContent = textBeforeWrap[textBeforeWrap.length - 1] === '.'
? `${textBeforeWrap}..`
: `${textBeforeWrap}...`;
return { ...acc, rowsWrapped: newRowsWrapped };
}
}
el.textContent = textBeforeWrap.length
? `${textBeforeWrap} ${token}`
: `${token}`;
return { ...acc, rowsWrapped: newRowsWrapped };
}
function ellipsed(selector = '', rows = 1) {
=======
/*
* Copyright (C) 2017 Nicola Zambello
*
* The JavaScript code in this page is open source software licensed under MIT license
* References about this code and its license, see:
*
* https://github.com/nzambello/ellipsed
*
*/
function ellipsis(selector = '', rows = 1) {
>>>>>>>
/*
* Copyright (C) 2017 Nicola Zambello
*
* The JavaScript code in this page is open source software licensed under MIT license
* References about this code and its license, see:
*
* https://github.com/nzambello/ellipsed
*
*/
function tokensReducer(acc, token) {
const { el, elStyle, rowsLimit, rowsWrapped } = acc;
if (rowsWrapped === rowsLimit + 1) {
return { ...acc };
}
const textBeforeWrap = el.textContent;
const elHeight = elStyle.height;
let newRowsWrapped = rowsWrapped;
el.textContent = el.textContent.length
? `${el.textContent} ${token}...`
: `${token}...`;
if (parseFloat(elStyle.height) > parseFloat(elHeight)) {
newRowsWrapped++;
if (newRowsWrapped === rowsLimit + 1) {
el.textContent = textBeforeWrap[textBeforeWrap.length - 1] === '.'
? `${textBeforeWrap}..`
: `${textBeforeWrap}...`;
return { ...acc, rowsWrapped: newRowsWrapped };
}
}
el.textContent = textBeforeWrap.length
? `${textBeforeWrap} ${token}`
: `${token}`;
return { ...acc, rowsWrapped: newRowsWrapped };
}
function ellipsis(selector = '', rows = 1) { |
<<<<<<<
//setup model that will fetch all the data for us
this.dataModel = new App.Models.ChartDataModel();
=======
this.mapTab = new App.Views.Chart.MapTab( { dispatcher: this.dispatcher } );
>>>>>>>
//setup model that will fetch all the data for us
this.dataModel = new App.Models.ChartDataModel();
this.mapTab = new App.Views.Chart.MapTab( { dispatcher: this.dispatcher } ); |
<<<<<<<
var minimatch = require('minimatch');
var CMD_PREFIX = '##vso[';
=======
var tcm = require('./taskcommand');
var trm = require('./toolrunner');
>>>>>>>
var minimatch = require('minimatch');
var tcm = require('./taskcommand');
var trm = require('./toolrunner');
<<<<<<<
return ToolRunner;
})();
exports.ToolRunner = _toolRunner;
//-----------------------------------------------------
// Matching helpers
//-----------------------------------------------------
var _match = function (list, pattern, options) {
return minimatch.match(list, pattern, options);
}
exports.match = _match;
var _matchFile = function (list, pattern, options) {
return minimatch(list, pattern, options);
}
exports.matchFile = _matchFile;
var _filter = function (pattern, options) {
return minimatch.filter(pattern, options);
}
exports.filter = _filter;
=======
>>>>>>>
//-----------------------------------------------------
// Matching helpers
//-----------------------------------------------------
var _match = function (list, pattern, options) {
return minimatch.match(list, pattern, options);
}
exports.match = _match;
var _matchFile = function (list, pattern, options) {
return minimatch(list, pattern, options);
}
exports.matchFile = _matchFile;
var _filter = function (pattern, options) {
return minimatch.filter(pattern, options);
}
exports.filter = _filter; |
<<<<<<<
this.heartbeat();
this.emit.apply(this, ['start']);
};
Worker.prototype.stop = function() {
clearInterval(this.hbTimer);
if (this.socket) {
this.sendDisconnect();
if (this.socket._zmq.state != zmq.STATE_CLOSED) {
this.socket.close();
}
delete this.socket;
}
this.onDisconnect();
this.emit.apply(this, ['stop']);
=======
>>>>>>>
this.heartbeat();
this.emit.apply(this, ['start']);
};
Worker.prototype.stop = function() {
clearInterval(this.hbTimer);
if (this.socket) {
this.sendDisconnect();
if (this.socket._zmq.state != zmq.STATE_CLOSED) {
this.socket.close();
}
delete this.socket;
this.onDisconnect();
}
this.emit.apply(this, ['stop']);
<<<<<<<
this.start();
=======
if (this.stopCb) {
//we asked for deconnection
this.stopCb();
} else {
this.connectToBroker();
}
} else if (type == MDP.W_READY) {
if (this.startCb) {
this.startCb();
delete this.startCb;
}
>>>>>>>
this.start();
} else if (type == MDP.W_READY) {
debug('W: W_READY');
<<<<<<<
var req = {
clientId: clientId,
rid: rid,
=======
var req = {
clientId: clientId,
rid: rid,
>>>>>>>
var req = {
clientId: clientId,
rid: rid,
<<<<<<<
var reply = new Writable({
objectMode: true
});
=======
var reply = new Writable({
objectMode: true
});
>>>>>>>
var reply = new Writable({
objectMode: true
}); |
<<<<<<<
this.logBookEvent({'event': 'shortanswer', 'act': JSON.stringify(value), 'div_id': directive_id});
}
=======
logBookEvent({"event": "shortanswer", "act": JSON.stringify(value), "div_id": this.divid});
};
ShortAnswer.prototype.loadJournal = function () {
var len = localStorage.length;
if (len > 0) {
var ex = localStorage.getItem(this.divid);
if (ex !== null) {
var solution = $("#" + this.divid + "_solution");
solution.text(localStorage.getItem(this.divid));
}
}
};
/*
<div id='%(divid)s' class='journal alert alert-%(optional)s'>
<form id='%(divid)s_journal' name='%(divid)s_journal' action="">
<fieldset>
<legend>Short Answer</legend>
<div class='journal-question'>%(qnum)s: %(content)s</div>
<div id='%(divid)s_journal_input'>
<div class='journal-options'>
<label class='radio-inline'>
<textarea id='%(divid)s_solution' class="form-control" style="display:inline; width: 530px;"
rows='4' cols='50'></textarea>
</label>
</div><br />
<div><button class="btn btn-default" onclick="submitJournal('%(divid)s');">Save</button></div>
Instructor's Feedback:
<div class='journal-options' style='padding-left:20px'>
<div class='bg-info form-control' style='width:530px; background-color: #eee; font-style:italic'
id='%(divid)s_feedback'>
There is no feedback yet.
</div>
</div><br />
</div>
</fieldset>
</form>
<div id='%(divid)s_results'></div>
<script type='text/javascript'>
// check if the user has already answered this journal
$(function() {
loadJournal('%(divid)s');
});
</script>
</div>
*/
/*=================================
== Find the custom HTML tags and ==
== execute our code on them ==
=================================*/
$(document).ready(function () {
$("[data-component=shortanswer]").each(function (index) {
saList[this.id] = new ShortAnswer({"orig": this});
});
>>>>>>>
this.logBookEvent({'event': 'shortanswer', 'act': JSON.stringify(value), 'div_id': directive_id});
};
ShortAnswer.prototype.loadJournal = function () {
var len = localStorage.length;
if (len > 0) {
var ex = localStorage.getItem(this.divid);
if (ex !== null) {
var solution = $("#" + this.divid + "_solution");
solution.text(localStorage.getItem(this.divid));
}
}
};
/*
<div id='%(divid)s' class='journal alert alert-%(optional)s'>
<form id='%(divid)s_journal' name='%(divid)s_journal' action="">
<fieldset>
<legend>Short Answer</legend>
<div class='journal-question'>%(qnum)s: %(content)s</div>
<div id='%(divid)s_journal_input'>
<div class='journal-options'>
<label class='radio-inline'>
<textarea id='%(divid)s_solution' class="form-control" style="display:inline; width: 530px;"
rows='4' cols='50'></textarea>
</label>
</div><br />
<div><button class="btn btn-default" onclick="submitJournal('%(divid)s');">Save</button></div>
Instructor's Feedback:
<div class='journal-options' style='padding-left:20px'>
<div class='bg-info form-control' style='width:530px; background-color: #eee; font-style:italic'
id='%(divid)s_feedback'>
There is no feedback yet.
</div>
</div><br />
</div>
</fieldset>
</form>
<div id='%(divid)s_results'></div>
<script type='text/javascript'>
// check if the user has already answered this journal
$(function() {
loadJournal('%(divid)s');
});
</script>
</div>
*/
/*=================================
== Find the custom HTML tags and ==
== execute our code on them ==
=================================*/
$(document).ready(function () {
$("[data-component=shortanswer]").each(function (index) {
saList[this.id] = new ShortAnswer({"orig": this});
}); |
<<<<<<<
this.useRunestoneServices = opts.useRunestoneServices;
=======
>>>>>>>
this.useRunestoneServices = opts.useRunestoneServices;
<<<<<<<
this.qNumList.appendChild(tmpLi);
=======
this.qNumWrapperList.appendChild(tmpLi);
>>>>>>>
this.qNumWrapperList.appendChild(tmpLi);
<<<<<<<
this.navBtnListeners();
$(function(){
var tenSet = $("ul#pageNums li");
for (var i = 0; i < tenSet.length; i += 10) {
tenSet.slice(i, i + 10).wrapAll("<ul class=\"pagination\"></ul>");
}
});
=======
this.navBtnListeners();
>>>>>>>
this.navBtnListeners();
<<<<<<<
$(this.timedDiv).show();
this.submitTimedProblems(false); // do not log these results
};
=======
if (this.showResults) {
$(this.timedDiv).show();
this.submitTimedProblems(false); // do not log these results
} else {
$(this.pauseBtn).hide();
}
};
>>>>>>>
if (this.showResults) {
$(this.timedDiv).show();
this.submitTimedProblems(false); // do not log these results
} else {
$(this.pauseBtn).hide();
}
};
<<<<<<<
=======
Timed.prototype.checkIfFinished = function () {
if (this.tookTimedExam()) {
$(this.startBtn).attr("disabled", true);
$(this.pauseBtn).attr("disabled", true);
$(this.finishButton).attr("disabled", true);
if (this.showResults) {
this.resetTimedMCMFStorage();
}
}
};
>>>>>>>
Timed.prototype.checkIfFinished = function () {
if (this.tookTimedExam()) {
$(this.startBtn).attr("disabled", true);
$(this.pauseBtn).attr("disabled", true);
$(this.finishButton).attr("disabled", true);
if (this.showResults) {
this.resetTimedMCMFStorage();
}
}
};
<<<<<<<
=======
var len = localStorage.length;
if (len > 0) {
if (localStorage.getItem(eBookConfig.email + ":" + this.divid) !== null) {
this.taken = 1;
this.restoreFromStorage();
>>>>>>>
<<<<<<<
if (correct) {
this.score++;
this.correctStr = this.correctStr + (i + 1) + ", ";
=======
if (correct == "T") {
this.score++;
this.correctStr = this.correctStr + (i + 1) + ", ";
} else if (correct == "F") {
this.incorrect++;
this.incorrectStr = this.incorrectStr + (i + 1) + ", ";
>>>>>>>
if (correct == "T") {
this.score++;
this.correctStr = this.correctStr + (i + 1) + ", ";
} else if (correct == "F") {
this.incorrect++;
this.incorrectStr = this.incorrectStr + (i + 1) + ", ";
<<<<<<<
this.skippedStr = this.skippedStr + (i + 1) + ", ";
=======
this.skippedStr = this.skippedStr + (i + 1) + ", ";
>>>>>>>
this.skippedStr = this.skippedStr + (i + 1) + ", "; |
<<<<<<<
<<<<<<< HEAD
=======
>>>>>>> |
<<<<<<<
// TODO: check all docs
// TODO: writer should be protected
// TODO: check errors/event descriptions if everything is up to date
export default class Writer {
/**
* Breaks attribute nodes at provided position or at boundaries of provided range. It breaks attribute elements inside
* up to a container element.
*
* In following examples `<p>` is a container, `<b>` and `<u>` are attribute nodes:
*
* <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
* <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
* <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
* <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
*
* **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
*
* **Note:** Difference between {@link module:engine/view/writer~writer.breakAttributes breakAttributes} and
* {@link module:engine/view/writer~writer.breakContainer breakContainer} is that `breakAttributes` breaks all
* {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of given `position`,
* up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
* `breakContainer` assumes that given `position` is directly in container element and breaks that container element.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container`
* when {@link module:engine/view/range~Range#start start}
* and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element`
* when trying to break attributes
* inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element`
* when trying to break attributes
* inside {@link module:engine/view/uielement~UIElement UIElement}.
*
* @see module:engine/view/attributeelement~AttributeElement
* @see module:engine/view/containerelement~ContainerElement
* @see module:engine/view/writer~writer.breakContainer
* @function module:engine/view/writer~writer.breakAttributes
* @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange Position where to break
* attribute elements.
* @returns {module:engine/view/position~Position|module:engine/view/range~Range} New position or range, after breaking the attribute
* elements.
*/
breakAttributes( positionOrRange ) {
if ( positionOrRange instanceof Position ) {
return _breakAttributes( positionOrRange );
} else {
return _breakAttributesRange( positionOrRange );
}
=======
/**
* Contains functions used for composing view tree.
*
* @namespace writer
*/
const writer = {
breakAttributes,
breakContainer,
mergeAttributes,
mergeContainers,
insert,
remove,
clear,
move,
wrap,
unwrap,
rename
};
export default writer;
/**
* Breaks attribute nodes at provided position or at boundaries of provided range. It breaks attribute elements inside
* up to a container element.
*
* In following examples `<p>` is a container, `<b>` and `<u>` are attribute nodes:
*
* <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
* <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
* <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
* <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
*
* **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
*
* **Note:** Difference between {@link module:engine/view/writer~writer.breakAttributes breakAttributes} and
* {@link module:engine/view/writer~writer.breakContainer breakContainer} is that `breakAttributes` breaks all
* {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of given `position`, up to the first
* encountered {@link module:engine/view/containerelement~ContainerElement container element}. `breakContainer` assumes that given
* `position`
* is directly in container element and breaks that container element.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container`
* when {@link module:engine/view/range~Range#start start}
* and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element`
* when trying to break attributes
* inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element`
* when trying to break attributes
* inside {@link module:engine/view/uielement~UIElement UIElement}.
*
* @see module:engine/view/attributeelement~AttributeElement
* @see module:engine/view/containerelement~ContainerElement
* @see module:engine/view/writer~writer.breakContainer
* @function module:engine/view/writer~writer.breakAttributes
* @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange Position where to break attribute elements.
* @returns {module:engine/view/position~Position|module:engine/view/range~Range} New position or range, after breaking the attribute
* elements.
*/
export function breakAttributes( positionOrRange ) {
if ( positionOrRange instanceof Position ) {
return _breakAttributes( positionOrRange );
} else {
return _breakAttributesRange( positionOrRange );
>>>>>>>
export default class Writer {
/**
* Breaks attribute nodes at provided position or at boundaries of provided range. It breaks attribute elements inside
* up to a container element.
*
* In following examples `<p>` is a container, `<b>` and `<u>` are attribute nodes:
*
* <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
* <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
* <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
* <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
*
* **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
*
* **Note:** Difference between {@link module:engine/view/writer~writer.breakAttributes breakAttributes} and
* {@link module:engine/view/writer~writer.breakContainer breakContainer} is that `breakAttributes` breaks all
* {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of given `position`,
* up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
* `breakContainer` assumes that given `position` is directly in container element and breaks that container element.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container`
* when {@link module:engine/view/range~Range#start start}
* and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element`
* when trying to break attributes
* inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element`
* when trying to break attributes
* inside {@link module:engine/view/uielement~UIElement UIElement}.
*
* @see module:engine/view/attributeelement~AttributeElement
* @see module:engine/view/containerelement~ContainerElement
* @see module:engine/view/writer~writer.breakContainer
* @function module:engine/view/writer~writer.breakAttributes
* @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange Position where
* to break attribute elements.
* @returns {module:engine/view/position~Position|module:engine/view/range~Range} New position or range, after breaking the attribute
* elements.
*/
breakAttributes( positionOrRange ) {
if ( positionOrRange instanceof Position ) {
return _breakAttributes( positionOrRange );
} else {
return _breakAttributesRange( positionOrRange );
}
<<<<<<<
validateRangeContainer( range );
// If range is collapsed - nothing to unwrap.
if ( range.isCollapsed ) {
return range;
}
=======
// Helper function for `view.writer.wrap`. Wraps position with provided attribute element.
// This method will also merge newly added attribute element with its siblings whenever possible.
//
// Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
// an instance of {module:engine/view/attributeelement~AttributeElement AttributeElement}.
//
// @param {module:engine/view/position~Position} position
// @param {module:engine/view/attributeelement~AttributeElement} attribute
// @returns {module:engine/view/position~Position} New position after wrapping.
function _wrapPosition( position, attribute ) {
// Return same position when trying to wrap with attribute similar to position parent.
if ( attribute.isSimilar( position.parent ) ) {
return movePositionToTextNode( Position.createFromPosition( position ) );
}
>>>>>>>
validateRangeContainer( range );
// If range is collapsed - nothing to unwrap.
if ( range.isCollapsed ) {
return range;
}
<<<<<<<
// If start position was merged - move end position back.
if ( !start.isEqual( newRange.start ) ) {
newRange.end.offset--;
}
=======
// Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.
function _hasNonUiChildren( parent ) {
return Array.from( parent.getChildren() ).some( child => !child.is( 'uiElement' ) );
}
/**
* Unwraps nodes within provided range from attribute element.
*
* Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
* {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
* same parent container.
*
* @param {module:engine/view/range~Range} range
* @param {module:engine/view/attributeelement~AttributeElement} attribute
*/
export function unwrap( range, attribute ) {
if ( !( attribute instanceof AttributeElement ) ) {
/**
* Attribute element need to be instance of attribute element.
*
* @error view-writer-unwrap-invalid-attribute
*/
throw new CKEditorError( 'view-writer-unwrap-invalid-attribute' );
}
>>>>>>>
// If start position was merged - move end position back.
if ( !start.isEqual( newRange.start ) ) {
newRange.end.offset--;
} |
<<<<<<<
if (report['version'] == 2){
// new version; would be better to embed this in HTML for the activecode
body = "<h4>Grade Report</h4>" +
"<p>This question: " + report['grade'] + " out of " + report['max'] + "</p>" +
"<p>" + report['comment'] + "</p>"
}
else{
body = "<h4>Grade Report</h4>" +
"<p>This assignment: " + report['grade'] + "</p>" +
"<p>" + report['comment'] + "</p>" +
"<p>Number of graded assignments: " + report['count'] + "</p>" +
"<p>Average score: " + report['avg'] + "</p>"
}
=======
var body = "<h4>Grade Report</h4>" +
"<p>This assignment: " + report['grade'] + "</p>" +
"<p>" + report['comment'] + "</p>" +
"<p>Number of graded assignments: " + report['count'] + "</p>" +
"<p>Average score: " + report['avg'] + "</p>"
>>>>>>>
if (report['version'] == 2){
// new version; would be better to embed this in HTML for the activecode
var body = "<h4>Grade Report</h4>" +
"<p>This question: " + report['grade'] + " out of " + report['max'] + "</p>" +
"<p>" + report['comment'] + "</p>"
}
else{
var body = "<h4>Grade Report</h4>" +
"<p>This assignment: " + report['grade'] + "</p>" +
"<p>" + report['comment'] + "</p>" +
"<p>Number of graded assignments: " + report['count'] + "</p>" +
"<p>Average score: " + report['avg'] + "</p>"
} |
<<<<<<<
mkdirp.sync(path.dirname(outfile));
bundle.pipe(fs.createWriteStream(outfile));
=======
// we'll output to a temp file within same filesystem, then atomically overwrite outfile once successful
tmpfile = outfile + ".tmp-browserify-" + Math.random().toFixed(20).slice(2)
bundle.pipe(fs.createWriteStream(tmpfile));
>>>>>>>
mkdirp.sync(path.dirname(outfile));
// we'll output to a temp file within same filesystem, then atomically overwrite outfile once successful
tmpfile = outfile + ".tmp-browserify-" + Math.random().toFixed(20).slice(2)
bundle.pipe(fs.createWriteStream(tmpfile)); |
<<<<<<<
* @protected
* @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
* @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
=======
* @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
* @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
>>>>>>>
* @protected
* @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
* @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
<<<<<<<
return this._createAfter( node );
} else if ( offset !== 0 && !offset ) {
throw new CKEditorError(
'view-position-createAt-required-second-parameter: ' +
'Position.createAt requires the second parameter offset when first parameter is a view item.' );
=======
return this.createAfter( node );
} else if ( offset !== 0 && !offset ) {
/**
* {@link module:engine/view/position~Position.createAt `Position.createAt()`}
* requires the offset to be specified when the first parameter is a view item.
*
* @error view-position-createAt-offset-required
*/
throw new CKEditorError(
'view-position-createAt-offset-required: ' +
'Position.createAt() requires the offset when the first parameter is a view item.' );
>>>>>>>
return this._createAfter( node );
} else if ( offset !== 0 && !offset ) {
/**
* {@link module:engine/view/position~Position.createAt `Position.createAt()`}
* requires the offset to be specified when the first parameter is a view item.
*
* @error view-position-createAt-offset-required
*/
throw new CKEditorError(
'view-position-createAt-offset-required: ' +
'Position.createAt() requires the offset when the first parameter is a view item.' ); |
<<<<<<<
convertChanges( differ, writer ) {
this.conversionApi.writer = writer;
// First, before changing view structure, remove all markers that has changed.
for ( const change of differ.getMarkersToRemove() ) {
this.convertMarkerRemove( change.name, change.range, writer );
}
=======
convertChanges( differ ) {
>>>>>>>
convertChanges( differ, writer ) {
this.conversionApi.writer = writer; |
<<<<<<<
* @param {String} config.model Name of the model marker (or model marker group) to convert.
* @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view View element definition or a function
* that takes model marker data as a parameter and returns view ui element.
* @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
=======
* @param {String} config.model The name of the model marker (or model marker group) to convert.
* @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
* that takes the model marker data as a parameter and returns a view UI element.
* @param {module:utils/priorities~PriorityString} [config.priority='normal'] Converter priority.
>>>>>>>
* @param {String} config.model The name of the model marker (or model marker group) to convert.
* @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
* that takes the model marker data as a parameter and returns a view UI element.
* @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
<<<<<<<
* @param {String} config.model Name of the model marker (or model marker group) to convert.
* @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} config.view Highlight descriptor
* which will be used for highlighting or a function that takes model marker data as a parameter and returns a highlight descriptor.
* @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
=======
* @param {String} config.model The name of the model marker (or model marker group) to convert.
* @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} config.view A highlight descriptor
* that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
* @param {module:utils/priorities~PriorityString} [config.priority='normal'] Converter priority.
>>>>>>>
* @param {String} config.model The name of the model marker (or model marker group) to convert.
* @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} config.view A highlight descriptor
* that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
* @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority. |
<<<<<<<
var assigneeListBtn = $('.ticket-assignee > a');
=======
var ticketTypeSelect = $('select#tType');
var ticketPriority = $('select#tPriority');
var ticketGroup = $('select#tGroup');
>>>>>>>
var assigneeListBtn = $('.ticket-assignee > a');
var ticketTypeSelect = $('select#tType');
var ticketPriority = $('select#tPriority');
var ticketGroup = $('select#tGroup');
<<<<<<<
//Setup assignee list on Closed
if (assigneeListBtn.length > 0) {
assigneeListBtn.removeAttr('data-notifications');
assigneeListBtn.removeAttr('data-updateUi');
nav.notifications();
}
=======
//Disabled Ticket Details
if (ticketTypeSelect.length > 0) {
ticketTypeSelect.prop('disabled', true);
}
if (ticketPriority.length > 0) {
ticketPriority.prop('disabled', true);
}
if (ticketGroup.length > 0) {
ticketGroup.prop('disabled', true);
}
>>>>>>>
//Setup assignee list on Closed
if (assigneeListBtn.length > 0) {
assigneeListBtn.removeAttr('data-notifications');
assigneeListBtn.removeAttr('data-updateUi');
nav.notifications();
}
//Disabled Ticket Details
if (ticketTypeSelect.length > 0) {
ticketTypeSelect.prop('disabled', true);
}
if (ticketPriority.length > 0) {
ticketPriority.prop('disabled', true);
}
if (ticketGroup.length > 0) {
ticketGroup.prop('disabled', true);
}
<<<<<<<
//Setup assignee list
if (assigneeListBtn.length > 0) {
assigneeListBtn.attr('data-notifications', 'assigneeDropdown');
assigneeListBtn.attr('data-updateui', 'assigneeList');
nav.notifications();
socketUi.updateUi();
}
=======
//Enable Ticket Details
if (ticketTypeSelect.length > 0) {
ticketTypeSelect.prop('disabled', false);
}
if (ticketPriority.length > 0) {
ticketPriority.prop('disabled', false);
}
if (ticketGroup.length > 0) {
ticketGroup.prop('disabled', false);
}
>>>>>>>
//Enable Ticket Details
if (ticketTypeSelect.length > 0) {
ticketTypeSelect.prop('disabled', false);
}
if (ticketPriority.length > 0) {
ticketPriority.prop('disabled', false);
}
if (ticketGroup.length > 0) {
ticketGroup.prop('disabled', false);
}
//Setup assignee list
if (assigneeListBtn.length > 0) {
assigneeListBtn.attr('data-notifications', 'assigneeDropdown');
assigneeListBtn.attr('data-updateui', 'assigneeList');
nav.notifications();
socketUi.updateUi();
} |
<<<<<<<
require('../src/socketserver')(ws)
cb()
=======
cb()
})
>>>>>>>
require('../src/socketserver')(ws)
cb()
}) |
<<<<<<<
className: 'class',
beginKeywords: 'trait enum', end: '({|<)',
contains: [hljs.UNDERSCORE_TITLE_MODE],
=======
beginKeywords: 'trait enum', end: '{',
contains: [
hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {endsParent: true})
],
>>>>>>>
className: 'class',
beginKeywords: 'trait enum', end: '{',
contains: [
hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {endsParent: true})
], |
<<<<<<<
'<div class="fixed-table-toolbar"></div>',
'<div class="fixed-table-container">',
'<div class="fixed-table-header"><table></table></div>',
'<div class="fixed-table-body">',
'<div class="fixed-table-loading">',
this.options.formatLoadingMessage(),
'</div>',
'</div>',
'<div class="fixed-table-pagination"></div>',
'</div>',
=======
'<div class="fixed-table-toolbar"></div>',
'<div class="fixed-table-container">',
'<div class="fixed-table-header"><table></table></div>',
'<div class="fixed-table-body">',
'<div class="fixed-table-loading">',
this.options.formatLoadingMessage(),
'</div>',
'</div>',
'<div class="fixed-table-footer"><table><tr></tr></table></div>',
'<div class="fixed-table-pagination"></div>',
'</div>',
>>>>>>>
'<div class="fixed-table-toolbar"></div>',
'<div class="fixed-table-container">',
'<div class="fixed-table-header"><table></table></div>',
'<div class="fixed-table-body">',
'<div class="fixed-table-loading">',
this.options.formatLoadingMessage(),
'</div>',
'</div>',
'<div class="fixed-table-footer"><table><tr></tr></table></div>',
'<div class="fixed-table-pagination"></div>',
'</div>',
<<<<<<<
// IF both values are numeric, do a numeric comparison
=======
>>>>>>>
// IF both values are numeric, do a numeric comparison
<<<<<<<
that.$body.find('tr:first-child:not(.no-records-found) > *').each(function (i) {
that.$header_.find('div.fht-cell').eq(i).width($(this).innerWidth());
});
=======
BootstrapTable.prototype.fitHeader = function () {
var bt = this,
$fixedHeader,
$fixedBody,
scrollWidth;
>>>>>>>
BootstrapTable.prototype.fitHeader = function () {
var bt = this,
$fixedHeader,
$fixedBody,
scrollWidth;
<<<<<<<
} else {
this.trigger('post-header');
=======
padding += cellHeight;
>>>>>>>
padding += cellHeight;
} else {
this.trigger('post-header'); |
<<<<<<<
cookieName, '=', cookieValue,
`; expires=${UtilsCookie.calculateExpiration(that.options.cookieExpire)}`,
that.options.cookiePath ? `; path=${that.options.cookiePath}` : '',
that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : '',
=======
cookieName, '=', encodeURIComponent(cookieValue),
'; expires=' + UtilsCookie.calculateExpiration(that.options.cookieExpire),
that.options.cookiePath ? '; path=' + that.options.cookiePath : '',
that.options.cookieDomain ? '; domain=' + that.options.cookieDomain : '',
>>>>>>>
cookieName, '=', encodeURIComponent(cookieValue),
`; expires=${UtilsCookie.calculateExpiration(that.options.cookieExpire)}`,
that.options.cookiePath ? `; path=${that.options.cookiePath}` : '',
that.options.cookieDomain ? `; domain=${that.options.cookieDomain}` : '',
<<<<<<<
const value = `; ${document.cookie}`
const parts = value.split(`; ${cookieName}=`)
return parts.length === 2 ? parts.pop().split(';').shift() : null
=======
const value = '; ' + document.cookie
const parts = value.split('; ' + cookieName + '=')
return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null
>>>>>>>
const value = `; ${document.cookie}`
const parts = value.split(`; ${cookieName}=`)
return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null
<<<<<<<
if ($(event.currentTarget).parent().hasClass('search')) {
=======
if ($(target[0].currentTarget).parent().parent().hasClass('search')) {
>>>>>>>
if ($(event.currentTarget).parent().hasClass('search')) { |
<<<<<<<
let dispatcher, mapper, model, view, modelDoc, modelRoot, modelSelection, viewDoc, viewRoot, viewSelection, highlightDescriptor;
=======
let dispatcher, mapper, model, modelDoc, modelRoot, docSelection, viewDoc, viewRoot, viewSelection, highlightDescriptor;
>>>>>>>
let dispatcher, mapper, model, view, modelDoc, modelRoot, docSelection, viewDoc, viewRoot, viewSelection, highlightDescriptor;
<<<<<<<
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertInsert( ModelRange.createIn( modelRoot ) );
dispatcher.convertMarkerAdd( marker.name, marker.getRange() );
const markers = Array.from( model.markers.getMarkersAtPosition( docSelection.getFirstPosition() ) );
dispatcher.convertSelection( docSelection, markers );
>>>>>>>
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertInsert( ModelRange.createIn( modelRoot ) );
dispatcher.convertMarkerAdd( marker.name, marker.getRange() );
const markers = Array.from( model.markers.getMarkersAtPosition( docSelection.getFirstPosition() ) );
dispatcher.convertSelection( docSelection, markers );
>>>>>>>
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertInsert( ModelRange.createIn( modelRoot ) );
dispatcher.convertMarkerAdd( marker.name, marker.getRange() );
const markers = Array.from( model.markers.getMarkersAtPosition( docSelection.getFirstPosition() ) );
dispatcher.convertSelection( docSelection, markers );
>>>>>>>
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertInsert( ModelRange.createIn( modelRoot ) );
dispatcher.convertMarkerAdd( marker.name, marker.getRange() );
const markers = Array.from( model.markers.getMarkersAtPosition( docSelection.getFirstPosition() ) );
dispatcher.convertSelection( docSelection, markers );
>>>>>>>
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
view.change( writer => {
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertSelection( docSelection, [] );
>>>>>>>
view.change( writer => {
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertSelection( docSelection, [] );
>>>>>>>
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
// Add ui element to view.
const uiElement = new ViewUIElement( 'span' );
viewRoot.insertChildren( 1, uiElement, writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
// Add ui element to view.
const uiElement = new ViewUIElement( 'span' );
viewRoot.insertChildren( 1, uiElement );
dispatcher.convertSelection( docSelection, [] );
>>>>>>>
// Add ui element to view.
const uiElement = new ViewUIElement( 'span' );
viewRoot.insertChildren( 1, uiElement, writer );
dispatcher.convertSelection( docSelection, writer );
} );
<<<<<<<
view.change( writer => {
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
modelDoc.selection.setRanges( [ modelRange ] );
=======
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
model.change( writer => {
writer.setSelection( modelRange );
} );
>>>>>>>
view.change( writer => {
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
model.change( writer => {
writer.setSelection( modelRange );
} );
<<<<<<<
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
modelDoc.selection.setRanges( [ modelRange ] );
=======
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
model.change( writer => {
writer.setSelection( modelRange );
} );
>>>>>>>
const modelRange = ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 1 );
model.change( writer => {
writer.setSelection( modelRange );
} );
<<<<<<<
=======
viewSelection.setFake( true );
dispatcher.convertSelection( docSelection, [] );
>>>>>>>
<<<<<<<
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
=======
dispatcher.convertInsert( ModelRange.createIn( modelRoot ) );
dispatcher.convertSelection( docSelection, [] );
>>>>>>>
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertSelection( docSelection, writer );
} ); |
<<<<<<<
var z = that.options.pagination ?
(that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows) :
that.pageTo;
=======
for (var i = bootstrapTable.pageFrom - 1; i < bootstrapTable.pageTo; i++) {
$.each(bootstrapTable.header.fields, function (j, field) {
var column = bootstrapTable.columns[$.fn.bootstrapTable.utils.getFieldIndex(bootstrapTable.columns, field)],
selectControl = $('.bootstrap-table-filter-control-' + column.field);
>>>>>>>
var z = that.options.pagination ?
(that.options.sidePagination === 'server' ? that.pageTo : that.options.totalRows) :
that.pageTo;
<<<<<<<
var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
var filterDataSource, selectControl;
if (filterDataType !== null) {
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
selectControl = $('.' + escapeID(column.field));
=======
var filterDataType = column.filterData.substring(0, 3);
var filterDataSource = column.filterData.substring(4, column.filterData.length);
var selectControl = $('.bootstrap-table-filter-control-' + column.field);
addOptionToSelectControl(selectControl, '', '');
>>>>>>>
var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
var filterDataSource, selectControl;
if (filterDataType !== null) {
filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
selectControl = $('.bootstrap-table-filter-control-' + escapeID(column.field));
<<<<<<<
return sprintf('<select class="%s form-control" style="width: 100%; visibility: %s" dir="%s"></select>',
field, isVisible, getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions));
=======
return sprintf('<select class="bootstrap-table-filter-control-%s form-control" style="width: 100%; visibility: %s" dir="%s"></select>',
field, isVisible, getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions))
>>>>>>>
return sprintf('<select class="form-control bootstrap-table-filter-control-%s" style="width: 100%; visibility: %s" dir="%s"></select>',
field, isVisible, getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions)); |
<<<<<<<
=======
// Display related links in grid ?
searchSettings.gridRelated = ['parent', 'children',
'services', 'datasets'];
// Object to store the current Map context
viewerSettings.storage = 'sessionStorage';
>>>>>>>
// Object to store the current Map context
viewerSettings.storage = 'sessionStorage'; |
<<<<<<<
=======
>>>>>>>
<<<<<<<
goog.require('gn_suggestion');
=======
goog.require('gn_validation');
>>>>>>>
goog.require('gn_suggestion');
goog.require('gn_validation');
<<<<<<<
'gn_suggestion',
=======
'gn_validation',
>>>>>>>
'gn_suggestion',
'gn_validation', |
<<<<<<<
const fixedStart = expandStart ? expandSelectionOnIsLimitNode( Position.createAt( startLimitElement ), schema, 'start' ) : start;
const fixedEnd = expandEnd ? expandSelectionOnIsLimitNode( Position.createAt( endLimitElement ), schema, 'end' ) : end;
=======
const startPosition = Position._createAt( startLimitElement, 0 );
const endPosition = Position._createAt( endLimitElement, 0 );
const fixedStart = isStartInLimit ? expandSelectionOnIsLimitNode( startPosition, schema, 'start' ) : start;
const fixedEnd = isEndInLimit ? expandSelectionOnIsLimitNode( endPosition, schema, 'end' ) : end;
>>>>>>>
const startPosition = Position._createAt( startLimitElement, 0 );
const endPosition = Position._createAt( endLimitElement, 0 );
const fixedStart = expandStart ? expandSelectionOnIsLimitNode( startPosition, schema, 'start' ) : start;
const fixedEnd = expandEnd ? expandSelectionOnIsLimitNode( endPosition, schema, 'end' ) : end; |
<<<<<<<
if ( a.sourcePosition.isEqual( b.splitPosition ) && context.abRelation == 'mergeSameElement' ) {
a.sourcePosition = Position._createAt( b.moveTargetPosition );
=======
if ( a.sourcePosition.isEqual( b.splitPosition ) && ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) ) {
a.sourcePosition = Position.createFromPosition( b.moveTargetPosition );
>>>>>>>
if ( a.sourcePosition.isEqual( b.splitPosition ) && ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) ) {
a.sourcePosition = Position._createAt( b.moveTargetPosition );
<<<<<<<
const rangeToMove = Range._createFromPositionAndShift( b.sourcePosition, b.howMany );
=======
>>>>>>> |
<<<<<<<
}]);
module.directive('gnPopoverDropdown', ['$timeout', function($timeout) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
// Container is one ul with class list-group
// Avoid to set style on embedded drop down menu
var content = element.find('ul.list-group').css('display', 'none');
var button = element.find('> .btn');
$timeout(function() {
var className = (attrs['fixedHeight'] != 'false') ?
'popover-dropdown popover-dropdown-' + content.find('li').length :
'';
button.popover({
animation: false,
container: '[gn-main-viewer]',
placement: attrs['placement'] || 'bottom',
content: ' ',
template:
'<div class="popover ' + className + '">' +
' <div class="arrow"></div>' +
' <h3 class="popover-title"></h3>' +
' <div class="popover-content"></div>' +
'</div>'
});
}, 1);
button.on('shown.bs.popover', function() {
var $tip = button.data('bs.popover').$tip;
content.css('display', 'inline').appendTo(
$tip.find('.popover-content')
);
});
button.on('hidden.bs.popover', function() {
content.css('display', 'none').appendTo(element);
});
// can’t use dismiss boostrap option: incompatible with opacity slider
$('body').on('mousedown click', function(e) {
if ((button.data('bs.popover') && button.data('bs.popover').$tip) &&
(button[0] != e.target) &&
(!$.contains(button[0], e.target)) &&
(
$(e.target).parents('.popover')[0] !=
button.data('bs.popover').$tip[0])
) {
$timeout(function() {
button.popover('hide');
}, 30);
}
});
if (attrs['gnPopoverDismiss']) {
$(attrs['gnPopoverDismiss']).on('scroll', function() {
button.popover('hide');
});
}
}
};
}]);
=======
});
/**
* @ngdoc directive
* @name gn_utility.directive:gnLynky
*
* @description
* If the text provided contains the following format:
* link|URL|Text, it's converted to an hyperlink, otherwise
* the text is displayed without any formatting.
*
*/
module.directive('gnLynky', ['$compile',
function($compile) {
return {
restrict: 'A',
scope: {
text: '@gnLynky'
},
link: function(scope, element, attrs) {
if ((scope.text.indexOf('link') == 0) &&
(scope.text.split('|').length == 3)) {
scope.link = scope.text.split('|')[1];
scope.value = scope.text.split('|')[2];
element.replaceWith($compile('<a data-ng-href="{{link}}" ' +
'data-ng-bind-html="value"></a>')(scope));
} else {
element.replaceWith($compile('<span ' +
'data-ng-bind-html="text"></span>')(scope));
}
}
};
}
]);
>>>>>>>
}]);
module.directive('gnPopoverDropdown', ['$timeout', function($timeout) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
// Container is one ul with class list-group
// Avoid to set style on embedded drop down menu
var content = element.find('ul.list-group').css('display', 'none');
var button = element.find('> .btn');
$timeout(function() {
var className = (attrs['fixedHeight'] != 'false') ?
'popover-dropdown popover-dropdown-' + content.find('li').length :
'';
button.popover({
animation: false,
container: '[gn-main-viewer]',
placement: attrs['placement'] || 'bottom',
content: ' ',
template:
'<div class="popover ' + className + '">' +
' <div class="arrow"></div>' +
' <h3 class="popover-title"></h3>' +
' <div class="popover-content"></div>' +
'</div>'
});
}, 1);
button.on('shown.bs.popover', function() {
var $tip = button.data('bs.popover').$tip;
content.css('display', 'inline').appendTo(
$tip.find('.popover-content')
);
});
button.on('hidden.bs.popover', function() {
content.css('display', 'none').appendTo(element);
});
// can’t use dismiss boostrap option: incompatible with opacity slider
$('body').on('mousedown click', function(e) {
if ((button.data('bs.popover') && button.data('bs.popover').$tip) &&
(button[0] != e.target) &&
(!$.contains(button[0], e.target)) &&
(
$(e.target).parents('.popover')[0] !=
button.data('bs.popover').$tip[0])
) {
$timeout(function() {
button.popover('hide');
}, 30);
}
});
if (attrs['gnPopoverDismiss']) {
$(attrs['gnPopoverDismiss']).on('scroll', function() {
button.popover('hide');
});
}
}
};
}]);
/**
* @ngdoc directive
* @name gn_utility.directive:gnLynky
*
* @description
* If the text provided contains the following format:
* link|URL|Text, it's converted to an hyperlink, otherwise
* the text is displayed without any formatting.
*
*/
module.directive('gnLynky', ['$compile',
function($compile) {
return {
restrict: 'A',
scope: {
text: '@gnLynky'
},
link: function(scope, element, attrs) {
if ((scope.text.indexOf('link') == 0) &&
(scope.text.split('|').length == 3)) {
scope.link = scope.text.split('|')[1];
scope.value = scope.text.split('|')[2];
element.replaceWith($compile('<a data-ng-href="{{link}}" ' +
'data-ng-bind-html="value"></a>')(scope));
} else {
element.replaceWith($compile('<span ' +
'data-ng-bind-html="text"></span>')(scope));
}
}
};
}
]); |
<<<<<<<
// Link is localized when using associated resource service
// and is not when using search
var url = $filter('gnLocalized')(link.url) || link.url;
var layerName = $filter('gnLocalized')(link.title) || link.title;
if (layerName) {
gnMap.addWmsFromScratch(gnSearchSettings.viewerMap,
url, layerName, false, md);
} else {
gnMap.addOwsServiceToMap(url, 'WMS');
=======
var isServiceLink =
gnSearchSettings.mapProtocols.services.indexOf(link.protocol) > -1;
if (isServiceLink) {
gnMap.addOwsServiceToMap(link.url, 'WMS');
} else {
//if this operation is called from search-from-map, the link does not contain title, but contains name directly
var layerName = link.name ? link.name : $filter('gnLocalized')(link.title);
if (layerName) {
gnMap.addWmsFromScratch(gnSearchSettings.viewerMap,
link.url, layerName, false, md);
} else {
gnMap.addOwsServiceToMap(link.url, 'WMS');
}
>>>>>>>
// Link is localized when using associated resource service
// and is not when using search
var url = $filter('gnLocalized')(link.url) || link.url;
var isServiceLink =
gnSearchSettings.mapProtocols.services.indexOf(link.protocol) > -1;
if (isServiceLink) {
gnMap.addOwsServiceToMap(link.url, 'WMS');
} else {
//if this operation is called from search-from-map, the link does not contain title, but contains name directly
var layerName = link.name ? link.name : $filter('gnLocalized')(link.title) || link.title;
if (layerName) {
gnMap.addWmsFromScratch(gnSearchSettings.viewerMap,
url, layerName, false, md);
} else {
gnMap.addOwsServiceToMap(url, 'WMS');
}
<<<<<<<
var url = $filter('gnLocalized')(link.url) || link.url;
var ftName = $filter('gnLocalized')(link.title);
if (ftName) {
gnMap.addWfsFromScratch(gnSearchSettings.viewerMap,
url, ftName, false, md);
} else {
gnMap.addOwsServiceToMap(url, 'WFS');
=======
var isServiceLink =
gnSearchSettings.mapProtocols.services.indexOf(link.protocol) > -1;
var isGetFeatureLink = (link.url.toLowerCase().indexOf('request=getfeature') > -1);
if (isServiceLink && !isGetFeatureLink) {
gnMap.addOwsServiceToMap(link.url, 'WFS');
} else {
var ftName = '';
if (isGetFeatureLink) {
var name = 'typename';
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(link.url);
if (results) {
ftName = decodeURIComponent(results[1].replace(/\+/g, ' '));
}
} else {
ftName = $filter('gnLocalized')(link.title);
}
if (ftName) {
gnMap.addWfsFromScratch(gnSearchSettings.viewerMap,
link.url, ftName, false, md);
} else {
gnMap.addOwsServiceToMap(link.url, 'WFS');
}
>>>>>>>
var url = $filter('gnLocalized')(link.url) || link.url;
var isServiceLink =
gnSearchSettings.mapProtocols.services.indexOf(link.protocol) > -1;
var isGetFeatureLink = (url.toLowerCase().indexOf('request=getfeature') > -1);
if (isServiceLink && !isGetFeatureLink) {
gnMap.addOwsServiceToMap(url, 'WFS');
} else {
var ftName = '';
if (isGetFeatureLink) {
var name = 'typename';
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(url);
if (results) {
ftName = decodeURIComponent(results[1].replace(/\+/g, ' '));
}
} else {
ftName = $filter('gnLocalized')(link.title);
}
if (ftName) {
gnMap.addWfsFromScratch(gnSearchSettings.viewerMap,
url, ftName, false, md);
} else {
gnMap.addOwsServiceToMap(url, 'WFS');
}
<<<<<<<
function addWMTSToMap(link, md) {
var url = $filter('gnLocalized')(link.url) || link.url;
=======
var addWMTSToMap = function(link, md) {
uuid = md ? md['geonet:info'].uuid : '';
>>>>>>>
var addWMTSToMap = function(link, md) {
var url = $filter('gnLocalized')(link.url) || link.url;
var uuid = md ? md['geonet:info'].uuid : '';
<<<<<<<
} else if (link.name && !angular.isArray(link.name)) {
gnOwsCapabilities.getWMTSCapabilities(url).then(
function(capObj) {
var layerInfo = gnOwsCapabilities.getLayerInfoFromCap(
=======
} else if (link.name && !angular.isArray(link.name) && link.name != '') {
gnOwsCapabilities.getWMTSCapabilities(link.url).then(
function(capObj) {
//console.log(link.name);
var layerInfo = gnOwsCapabilities.getLayerInfoFromCap(
>>>>>>>
} else if (link.name && !angular.isArray(link.name) && link.name != '') {
gnOwsCapabilities.getWMTSCapabilities(url).then(
function(capObj) {
var layerInfo = gnOwsCapabilities.getLayerInfoFromCap(
<<<<<<<
var url = $filter('gnLocalized')(record.url) || record.url;
if (url.indexOf('http') == 0 ||
url.indexOf('ftp') == 0) {
return window.open(url, '_blank');
} else {
=======
if (record.url && (record.url.indexOf('\\') == 0 ||
record.url.indexOf('http') == 0 ||
record.url.indexOf('ftp') == 0)) {
return window.open(record.url, '_blank');
} else if (record.url && record.url.indexOf('www.') == 0) {
return window.open('http://' + record.url, '_blank');
} else if (record.title && record.title != '') {
>>>>>>>
var url = $filter('gnLocalized')(record.url) || record.url;
if (url && (record.url.indexOf('\\') == 0 ||
url.indexOf('http') == 0 ||
url.indexOf('ftp') == 0)) {
return window.open(url, '_blank');
} else if (url && url.indexOf('www.') == 0) {
return window.open('http://' + url, '_blank');
} else if (record.title && record.title != '') {
<<<<<<<
var url = $filter('gnLocalized')(resource.url) || resource.url;
if (url.match(/zip/i)) {
return 'LINKDOWNLOAD-ZIP';
} else if (url.match(/pdf/i)) {
return 'LINKDOWNLOAD-PDF';
} else if (url.match(/xml/i)) {
return 'LINKDOWNLOAD-XML';
} else if (url.match(/rdf/i)) {
return 'LINKDOWNLOAD-RDF';
} else {
return 'LINKDOWNLOAD';
}
// Anything that is not matched before, gets the link icon
} else {
=======
return 'LINKDOWNLOAD';
} else if (protocolOrType.match(/dataset/i)) {
return 'LINKDOWNLOAD';
} else if (protocolOrType.match(/link/i)) {
>>>>>>>
var url = $filter('gnLocalized')(resource.url) || resource.url;
if (url.match(/zip/i)) {
return 'LINKDOWNLOAD-ZIP';
} else if (url.match(/pdf/i)) {
return 'LINKDOWNLOAD-PDF';
} else if (url.match(/xml/i)) {
return 'LINKDOWNLOAD-XML';
} else if (url.match(/rdf/i)) {
return 'LINKDOWNLOAD-RDF';
} else {
return 'LINKDOWNLOAD';
}
} else if (protocolOrType.match(/dataset/i)) {
return 'LINKDOWNLOAD';
} else if (protocolOrType.match(/link/i)) { |
<<<<<<<
=======
goog.require('gn_admin_menu');
>>>>>>>
goog.require('gn_admin_menu'); |
<<<<<<<
'gnUtilityService', 'gnConfigService',
=======
'gnUtilityService',
'gnCurrentEdit',
>>>>>>>
'gnConfigService',
'gnUtilityService',
'gnCurrentEdit',
<<<<<<<
gnUtilityService, gnConfigService) {
=======
gnUtilityService, gnCurrentEdit) {
>>>>>>>
gnConfigService
gnUtilityService, gnCurrentEdit) {
<<<<<<<
gnConfigService.load().then(function(c) {
// Config loaded
});
=======
angular.extend(gnCurrentEdit, {
id: $routeParams.id,
formId: '#gn-editor-' + $scope.metadataId,
tab: $routeParams.tab,
displayAttribute: $routeParams.displayAttributes === 'true'
});
>>>>>>>
gnConfigService.load().then(function(c) {
// Config loaded
});
angular.extend(gnCurrentEdit, {
id: $routeParams.id,
formId: '#gn-editor-' + $scope.metadataId,
tab: $routeParams.tab,
displayAttribute: $routeParams.displayAttributes === 'true'
}); |
<<<<<<<
gulp
.src('src/lib/codemirror/theme/*')
.pipe(gulp.dest('app/lib/codemirror/theme')),
gulp
.src('src/lib/codemirror/mode/**/*')
.pipe(gulp.dest('app/lib/codemirror/mode')),
gulp.src('src/lib/transpilers/*').pipe(gulp.dest('app/lib/transpilers')),
gulp.src('src/lib/screenlog.js').pipe(gulp.dest('app/lib')),
gulp.src('icons/*').pipe(gulp.dest('app/icons')),
gulp.src(['src/preview.html',
=======
gulp
.src('src/lib/codemirror/theme/*')
.pipe(gulp.dest('app/lib/codemirror/theme')),
gulp
.src('src/lib/codemirror/mode/**/*')
.pipe(gulp.dest('app/lib/codemirror/mode')),
gulp.src('src/lib/transpilers/*').pipe(gulp.dest('app/lib/transpilers')),
gulp.src('src/lib/prettier-worker.js').pipe(gulp.dest('app/lib/')),
gulp.src('src/lib/prettier/*').pipe(gulp.dest('app/lib/prettier')),
gulp.src('src/lib/screenlog.js').pipe(gulp.dest('app/lib')),
gulp.src('icons/*').pipe(gulp.dest('app/icons')),
gulp.src('src/assets/*').pipe(gulp.dest('app/assets')),
gulp.src('src/templates/*').pipe(gulp.dest('app/templates')),
gulp
.src([
'src/preview.html',
>>>>>>>
gulp
.src('src/lib/codemirror/theme/*')
.pipe(gulp.dest('app/lib/codemirror/theme')),
gulp
.src('src/lib/codemirror/mode/**/*')
.pipe(gulp.dest('app/lib/codemirror/mode')),
gulp.src('src/lib/transpilers/*').pipe(gulp.dest('app/lib/transpilers')),
gulp.src('src/lib/prettier-worker.js').pipe(gulp.dest('app/lib/')),
gulp.src('src/lib/prettier/*').pipe(gulp.dest('app/lib/prettier')),gulp.src('src/lib/screenlog.js').pipe(gulp.dest('app/lib')),
gulp.src('icons/*').pipe(gulp.dest('app/icons')),gulp.src('src/assets/*').pipe(gulp.dest('app/assets')),
gulp.src('src/templates/*').pipe(gulp.dest('app/templates')),
gulp
.src([
'src/preview.html',
<<<<<<<
childProcess.execSync('cp -R app/ extension/');
childProcess.execSync('cp src/manifest.json extension');
childProcess.execSync('cp src/options.js extension');
childProcess.execSync('cp src/options.html extension');
childProcess.execSync('cp src/eventPage.js extension');
childProcess.execSync('cp src/icon-16.png extension');
childProcess.execSync(
=======
child_process.execSync('cp -R app extension');
child_process.execSync('cp src/manifest.json extension');
child_process.execSync('cp src/options.js extension');
child_process.execSync('cp src/options.html extension');
child_process.execSync('cp src/eventPage.js extension');
child_process.execSync('cp src/icon-16.png extension');
child_process.execSync(
>>>>>>>
childProcess.execSync('cp -R app/ extension');
childProcess.execSync('cp src/manifest.json extension');
childProcess.execSync('cp src/options.js extension');
childProcess.execSync('cp src/options.html extension');
childProcess.execSync('cp src/eventPage.js extension');
childProcess.execSync('cp src/icon-16.png extension');
childProcess.execSync( |
<<<<<<<
=======
chrome.storage.sync.set({
htmlMode: value
}, function () {});
trackEvent('ui', 'updateCodeMode', 'html', value);
>>>>>>>
trackEvent('ui', 'updateCodeMode', 'html', value);
<<<<<<<
=======
chrome.storage.sync.set({
cssMode: value
}, function () {});
trackEvent('ui', 'updateCodeMode', 'css', value);
>>>>>>>
trackEvent('ui', 'updateCodeMode', 'css', value);
<<<<<<<
*/
=======
trackEvent('ui', 'updateCodeMode', 'js', value);
>>>>>>>
*/
<<<<<<<
=======
trackEvent('ui', 'helpButtonClick');
return false;
>>>>>>>
trackEvent('ui', 'helpButtonClick');
<<<<<<<
utils.onButtonClick(saveHtmlBtn, saveFile);
utils.onButtonClick(openBtn, openSavedItemsPane);
utils.onButtonClick(saveBtn, saveItem);
utils.onButtonClick(newBtn, createNewItem);
utils.onButtonClick(savedItemsPaneCloseBtn, toggleSavedItemsPane);
utils.onButtonClick(savedItemsPane, function (e) {
if (e.target.classList.contains('js-saved-item-tile')) {
openItem(e.target.dataset.itemId);
toggleSavedItemsPane();
}
=======
saveHtmlBtn.addEventListener('click', function () {
trackEvent('ui', 'saveHtmlClick');
saveFile();
>>>>>>>
utils.onButtonClick(saveHtmlBtn, function () {
saveFile();
trackEvent('ui', 'saveHtmlClick');
});
utils.onButtonClick(openBtn, openSavedItemsPane);
utils.onButtonClick(saveBtn, saveItem);
utils.onButtonClick(newBtn, createNewItem);
utils.onButtonClick(savedItemsPaneCloseBtn, toggleSavedItemsPane);
utils.onButtonClick(savedItemsPane, function (e) {
if (e.target.classList.contains('js-saved-item-tile')) {
openItem(e.target.dataset.itemId);
toggleSavedItemsPane();
}
<<<<<<<
=======
trackEvent('ui', 'settingsBtnClick');
return false;
>>>>>>>
trackEvent('ui', 'settingsBtnClick'); |
<<<<<<<
modes[JsModes.ES6] = { label: 'ES6 (Babel)', cmMode: 'javascript', codepenVal: 'babel' };
modes[JsModes.TS] = { label: 'TypeScript', cmMode: 'javascript', codepenVal: 'typescript' };
=======
modes[JsModes.ES6] = { label: 'ES6 (Babel)', cmMode: 'jsx', codepenVal: 'babel' };
>>>>>>>
modes[JsModes.ES6] = { label: 'ES6 (Babel)', cmMode: 'jsx', codepenVal: 'babel' };
modes[JsModes.TS] = { label: 'TypeScript', cmMode: 'javascript', codepenVal: 'typescript' }; |
<<<<<<<
viewDocument.selection.addRange( ViewRange.createFromParentsAndOffsets( viewBar, 1, viewBar, 2 ) );
view.render();
=======
viewDocument.selection.setTo( ViewRange.createFromParentsAndOffsets( viewBar, 1, viewBar, 2 ) );
viewDocument.render();
>>>>>>>
viewDocument.selection.setTo( ViewRange.createFromParentsAndOffsets( viewBar, 1, viewBar, 2 ) );
view.render(); |
<<<<<<<
const isProUser = userService.isPro();
const exportPngButtonHtml =
=======
const enableExportButton = !featureToggle.isPaymentEnabled || userService.isPro();
const exportButtonHtml =
>>>>>>>
const enableExportButton = !featureToggle.isPaymentEnabled || userService.isPro();
const exportPngButtonHtml =
<<<<<<<
${isProUser ? '' : 'disabled'}>
=======
${enableExportButton ? '' : 'disabled'}>
>>>>>>>
${enableExportButton ? '' : 'disabled'}>
<<<<<<<
`${isProUser ? '' : '<div title="Upgrade to Pro to enable this feature">'}
${exportPngButtonHtml} ${exportJpegButtonHtml}
${isProUser ? '' : '</div>'}`;
=======
`${enableExportButton ? '' : '<div title="Upgrade to Pro to enable this feature">'}
${exportButtonHtml}
${enableExportButton ? '' : '</div>'}`;
>>>>>>>
`${enableExportButton ? '' : '<div title="Upgrade to Pro to enable this feature">'}
${exportPngButtonHtml} ${exportJpegButtonHtml}
${enableExportButton ? '' : '</div>'}`; |
<<<<<<<
indent(concat([parenLine, concat(printedArguments)])),
ifBreak(shouldPrintComma(options, "all") ? "," : ""),
parenLine,
=======
indent(concat([softline, concat(printedArguments)])),
ifBreak(maybeTrailingComma),
softline,
>>>>>>>
indent(concat([parenLine, concat(printedArguments)])),
ifBreak(maybeTrailingComma),
parenLine,
<<<<<<<
parenSpace,
join(", ", printed.map(removeLines)),
parenSpace,
=======
concat(printed.map(removeLines)),
>>>>>>>
parenSpace,
concat(printed.map(removeLines)),
parenSpace,
<<<<<<<
if (shouldHugArguments(fun)) {
return concat([
typeParams,
"(",
parenSpace,
join(", ", printed),
parenSpace,
")"
]);
=======
if (shouldHugParameters) {
return concat([typeParams, "(", concat(printed), ")"]);
>>>>>>>
if (shouldHugParameters) {
return concat([
typeParams,
"(",
parenSpace,
// TBD quick merge fix in src:
join("", printed),
// FUTURE TBD cleaner merge fix:
// concat(printed),
parenSpace,
")"
]);
<<<<<<<
if (isTestCall(parent)) {
return concat([
typeParams,
"(",
parenSpace,
join(", ", printed),
parenSpace,
")"
]);
=======
if (isParametersInTestCall) {
return concat([typeParams, "(", concat(printed), ")"]);
>>>>>>>
if (isParametersInTestCall) {
return concat([
typeParams,
"(",
parenSpace,
// TBD quick merge fix in src:
join("", printed),
// FUTURE TBD cleaner merge fix:
// concat(printed),
parenSpace,
")"
]);
<<<<<<<
indent(concat([parenLine, join(concat([",", line]), printed)])),
=======
indent(concat([softline, concat(printed)])),
>>>>>>>
// TBD quick merge fix in src:
indent(concat([parenLine, join("", printed)])),
// FUTURE TBD cleaner merge fix:
// indent(concat([parenLine, concat(printed)])), |
<<<<<<<
function addFood(toAdd) {
while(toAdd--){
food.push({
// make ids unique
id: ((new Date()).getTime() + '' + (new Date()).getMilliseconds() + '' + food.length) >>> 0,
x: genPos(0, c.gameWidth),
y: genPos(0, c.gameHeight),
color: randomColor(),
});
}
=======
function addFoods(target) {
foods.push({
id: (new Date()).getTime(),
x: genPos(0, target.gameWidth - 10),
y: genPos(0, target.gameHeight - 10),
color: randomColor(),
rotation: Math.random() * (Math.PI * 2)
});
>>>>>>>
function addFood(toAdd) {
while(toAdd--){
food.push({
// make ids unique
id: ((new Date()).getTime() + '' + (new Date()).getMilliseconds() + '' + food.length) >>> 0,
x: genPos(0, c.gameWidth),
y: genPos(0, c.gameHeight),
color: randomColor(),
});
}
<<<<<<<
users.splice(findIndex(users, currentPlayer.id), 1);
console.log('User #' + currentPlayer.id + ' disconnected');
socket.broadcast.emit(
'playerDisconnect',
{
playersList: users,
disconnectName: currentPlayer.name
}
);
=======
var playerDisconnected = findPlayer(userID);
if (playerDisconnected !== null && playerDisconnected.hasOwnProperty('name')) {
removePlayer(userID);
console.log('User #' + userID + ' disconnected');
socket.broadcast.emit(
'playerDisconnect',
{
playersList: users,
disconnectName: playerDisconnected.name
}
);
} else {
console.log('Unknown user disconnected');
}
>>>>>>>
users.splice(findIndex(users, currentPlayer.id), 1);
console.log('User #' + currentPlayer.id + ' disconnected');
socket.broadcast.emit(
'playerDisconnect',
{
playersList: users,
disconnectName: currentPlayer.name
}
);
<<<<<<<
if (data[0] === c.adminPass) {
console.log('Someone just logged in as an admin');
=======
if (data[0] === config.adminPass) {
console.log(currentPlayer.name + " just logged in as an admin");
>>>>>>>
if (data[0] === c.adminPass) {
console.log(currentPlayer.name + " just logged in as an admin"); |
<<<<<<<
graph.fillStyle = backgroundColor;
graph.fillRect(0, 0, gameWidth, gameHeight);
=======
graph.fillStyle = "#EEEEEE";
graph.fillRect(0, 0, screenWidth, screenHeight);
>>>>>>>
graph.fillStyle = backgroundColor;
graph.fillRect(0, 0, screenWidth, screenHeight); |
<<<<<<<
.to.equal( '<div>foo<span class="marker2">[]</span>bar</div>' );
} );
it( 'in marker - should merge with the rest of attribute elements', () => {
dispatcher.on( 'addMarker:marker2', highlightText( data => ( { 'class': data.markerName } ) ) );
dispatcher.on( 'addMarker:marker2', highlightElement( data => ( { 'class': data.markerName } ) ) );
dispatcher.on( 'selectionMarker:marker2', convertSelectionMarker( data => ( { 'class': data.markerName } ) ) );
setModelData( model, 'foobar' );
const marker = model.markers.set( 'marker2', ModelRange.createFromParentsAndOffsets( modelRoot, 1, modelRoot, 5 ) );
modelSelection.setRanges( [ new ModelRange( ModelPosition.createAt( modelRoot, 3 ) ) ] );
// Remove view children manually (without firing additional conversion).
viewRoot.removeChildren( 0, viewRoot.childCount );
// Convert model to view.
view.change( writer => {
dispatcher.convertInsert( ModelRange.createIn( modelRoot ), writer );
dispatcher.convertMarkerAdd( marker.name, marker.getRange(), writer );
dispatcher.convertSelection( modelSelection, writer );
} );
// Stringify view and check if it is same as expected.
expect( stringifyView( viewRoot, viewSelection, { showType: false } ) )
=======
>>>>>>>
<<<<<<<
view.change( writer => {
// Remove <b></b> manually.
writer.mergeAttributes( viewSelection.getFirstPosition() );
=======
// Remove <strong></strong> manually.
mergeAttributes( viewSelection.getFirstPosition() );
>>>>>>>
view.change( writer => {
// Remove <strong></strong> manually.
writer.mergeAttributes( viewSelection.getFirstPosition() ); |
<<<<<<<
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams'
, 'growl', 'ProjectService', 'ModalService', 'ActivityService','$cookies',
function ($scope, $modalStack, $location, $routeParams, growl, ProjectService, ModalService, ActivityService, $cookies) {
=======
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams', 'UtilsService',
'growl', 'ProjectService', 'ModalService', 'ActivityService',
function ($scope, $modalStack, $location, $routeParams, UtilsService, growl, ProjectService, ModalService, ActivityService) {
UtilsService.setIndex("child");
>>>>>>>
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams', 'UtilsService',
'growl', 'ProjectService', 'ModalService', 'ActivityService','$cookies',
function ($scope, $modalStack, $location, $routeParams, UtilsService, growl, ProjectService, ModalService, ActivityService, $cookies) {
UtilsService.setIndex("child");
<<<<<<<
$cookies.projectID = self.pId;
=======
//set the project name under which the search is performed
UtilsService.setProjectName(self.currentProject.projectName);
>>>>>>>
$cookies.projectID = self.pId;
//set the project name under which the search is performed
UtilsService.setProjectName(self.currentProject.projectName); |
<<<<<<<
/**
* @param {!Object} labelInfo
* @param {Object} changeLabelsRecord not used, but added as a parameter in
* order to trigger computation when a label is removed from the change.
*/
_computeShowPlaceholder(labelInfo, changeLabelsRecord) {
if (labelInfo && labelInfo.all) {
for (const label of labelInfo.all) {
if (label.value && label.value != labelInfo.default_value) {
return 'hidden';
=======
/**
* @param {!Object} labelInfo
* @param {Object} changeLabelsRecord not used, but added as a parameter in
* order to trigger computation when a label is removed from the change.
*/
_computeShowPlaceholder(labelInfo, changeLabelsRecord) {
if (labelInfo &&
!labelInfo.values && (labelInfo.rejected || labelInfo.approved)) {
return 'hidden';
}
if (labelInfo && labelInfo.all) {
for (const label of labelInfo.all) {
if (label.value && label.value != labelInfo.default_value) {
return 'hidden';
}
>>>>>>>
/**
* @param {!Object} labelInfo
* @param {Object} changeLabelsRecord not used, but added as a parameter in
* order to trigger computation when a label is removed from the change.
*/
_computeShowPlaceholder(labelInfo, changeLabelsRecord) {
if (labelInfo &&
!labelInfo.values && (labelInfo.rejected || labelInfo.approved)) {
return 'hidden';
}
if (labelInfo && labelInfo.all) {
for (const label of labelInfo.all) {
if (label.value && label.value != labelInfo.default_value) {
return 'hidden'; |
<<<<<<<
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams'
, 'growl', 'ProjectService', 'ModalService', 'ActivityService',
function ($scope, $modalStack, $location, $routeParams, growl, ProjectService, ModalService, ActivityService) {
var self = this;
self.currentProject = [];
self.activities = [];
self.currentPage = 1;
self.card = {};
self.cards = [];
self.projectMembers = [];
// We could instead implement a service to get all the available types but this will do it for now
self.projectTypes = ['CUNEIFORM', 'SAMPLES', 'PROJECT_INFO', 'SPARK', 'ADAM', 'MAPREDUCE', 'YARN', 'ZEPPELIN'];
=======
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams'
, 'growl', 'ProjectService', 'ModalService', 'ActivityService',
function ($scope, $modalStack, $location, $routeParams, growl, ProjectService, ModalService, ActivityService) {
var self = this;
self.currentProject = [];
self.activities = [];
self.currentPage = 1;
self.card = {};
self.cards = [];
self.projectMembers = [];
// We could instead implement a service to get all the available types but this will do it for now
self.projectTypes = ['CUNEIFORM', 'SPARK', 'ADAM', 'MAPREDUCE', 'YARN', 'ZEPPELIN'];
>>>>>>>
.controller('ProjectCtrl', ['$scope', '$modalStack', '$location', '$routeParams'
, 'growl', 'ProjectService', 'ModalService', 'ActivityService',
function ($scope, $modalStack, $location, $routeParams, growl, ProjectService, ModalService, ActivityService) {
var self = this;
self.currentProject = [];
self.activities = [];
self.currentPage = 1;
self.card = {};
self.cards = [];
self.projectMembers = [];
// We could instead implement a service to get all the available types but this will do it for now
self.projectTypes = ['CUNEIFORM', 'SPARK', 'ADAM', 'MAPREDUCE', 'YARN', 'ZEPPELIN'];
<<<<<<<
// Check if the service exists and otherwise add it or remove it depending on the previous choice
self.exists = function (projectType) {
var idx = self.selectionProjectTypes.indexOf(projectType);
if (idx > -1) {
self.selectionProjectTypes.splice(idx, 1);
} else {
self.selectionProjectTypes.push(projectType);
}
};
self.projectSettingModal = function () {
ModalService.projectSettings('md').then(
function (success) {
getAllActivities();
getCurrentProject();
}, function (error) {
growl.info("You closed without saving.", {title: 'Info', ttl: 5000});
});
};
self.membersModal = function () {
ModalService.projectMembers('lg', self.pId).then(
function (success) {
}, function (error) {
});
};
self.saveProject = function () {
$scope.newProject = {
'projectName': self.currentProject.projectName,
'description': self.currentProject.description,
'services': self.selectionProjectTypes
};
ProjectService.update({id: self.currentProject.projectId}, $scope.newProject)
.$promise.then(
function (success) {
growl.success("Success: " + success.successMessage, {title: 'Success', ttl: 5000});
if (success.errorMsg) {
growl.warning(success.errorMsg, {title: 'Error', ttl: 15000});
}
$modalStack.getTop().key.close();
}, function (error) {
growl.warning("Error: " + error.data.errorMsg, {title: 'Error', ttl: 5000});
}
);
};
self.close = function () {
$modalStack.getTop().key.dismiss();
};
$scope.showHamburger = $location.path().indexOf("project") > -1;
self.goToDatasets = function () {
$location.path('project/' + self.pId + '/datasets');
};
self.goToService = function (service) {
$location.path('project/' + self.pId + '/' + service.toLowerCase());
};
self.goToSpecificDataset = function (name) {
$location.path($location.path() + '/' + name);
};
self.saveAllowed = function () {
if (self.currentProject.projectName.length == 0) {
return true;
}
};
// Dummy data
$scope.labels = ["Adam", "Spark", "Yarn", "MapReduce", "Samples", "Zeppelin", "Cuneiform"];
$scope.data = [
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
];
$scope.labels2 = ["January", "February", "March", "April", "May", "June", "July"];
$scope.series = ['Fileoperations', 'Querys'];
$scope.data2 = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
$scope.onClick = function (points, evt) {
console.log(points, evt);
};
}]);
=======
// Check if the service exists and otherwise add it or remove it depending on the previous choice
self.exists = function (projectType) {
var idx = self.selectionProjectTypes.indexOf(projectType);
if (idx > -1) {
self.selectionProjectTypes.splice(idx, 1);
} else {
self.selectionProjectTypes.push(projectType);
}
};
self.projectSettingModal = function () {
ModalService.projectSettings('md').then(
function (success) {
getAllActivities();
getCurrentProject();
}, function (error) {
growl.info("You closed without saving.", {title: 'Info', ttl: 5000});
});
};
self.membersModal = function () {
ModalService.projectMembers('lg', self.pId).then(
function (success) {
}, function (error) {
});
};
self.saveProject = function () {
$scope.newProject = {
'projectName': self.currentProject.projectName,
'description': self.currentProject.description,
'services': self.selectionProjectTypes
};
ProjectService.update({id: self.currentProject.projectId}, $scope.newProject)
.$promise.then(
function (success) {
growl.success("Success: " + success.successMessage, {title: 'Success', ttl: 5000});
if (success.errorMsg) {
growl.warning(success.errorMsg, {title: 'Error', ttl: 15000});
}
$modalStack.getTop().key.close();
}, function (error) {
growl.warning("Error: " + error.data.errorMsg, {title: 'Error', ttl: 5000});
}
);
};
self.close = function () {
$modalStack.getTop().key.dismiss();
};
$scope.showHamburger = $location.path().indexOf("project") > -1;
self.goToDatasets = function () {
$location.path('project/' + self.pId + '/datasets');
};
self.goToSpecificDataset = function (name) {
$location.path($location.path() + '/' + name);
};
self.saveAllowed = function () {
if (self.currentProject.projectName.length == 0) {
return true;
}
};
// Dummy data
$scope.labels = ["Adam", "Spark", "Yarn", "MapReduce", "Zeppelin", "Cuneiform"];
$scope.data = [
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
];
$scope.labels2 = ["January", "February", "March", "April", "May", "June", "July"];
$scope.series = ['Fileoperations', 'Querys'];
$scope.data2 = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
$scope.onClick = function (points, evt) {
console.log(points, evt);
};
}]);
>>>>>>>
// Check if the service exists and otherwise add it or remove it depending on the previous choice
self.exists = function (projectType) {
var idx = self.selectionProjectTypes.indexOf(projectType);
if (idx > -1) {
self.selectionProjectTypes.splice(idx, 1);
} else {
self.selectionProjectTypes.push(projectType);
}
};
self.projectSettingModal = function () {
ModalService.projectSettings('md').then(
function (success) {
getAllActivities();
getCurrentProject();
}, function (error) {
growl.info("You closed without saving.", {title: 'Info', ttl: 5000});
});
};
self.membersModal = function () {
ModalService.projectMembers('lg', self.pId).then(
function (success) {
}, function (error) {
});
};
self.saveProject = function () {
$scope.newProject = {
'projectName': self.currentProject.projectName,
'description': self.currentProject.description,
'services': self.selectionProjectTypes
};
ProjectService.update({id: self.currentProject.projectId}, $scope.newProject)
.$promise.then(
function (success) {
growl.success("Success: " + success.successMessage, {title: 'Success', ttl: 5000});
if (success.errorMsg) {
growl.warning(success.errorMsg, {title: 'Error', ttl: 15000});
}
$modalStack.getTop().key.close();
}, function (error) {
growl.warning("Error: " + error.data.errorMsg, {title: 'Error', ttl: 5000});
}
);
};
self.close = function () {
$modalStack.getTop().key.dismiss();
};
$scope.showHamburger = $location.path().indexOf("project") > -1;
self.goToDatasets = function () {
$location.path('project/' + self.pId + '/datasets');
};
self.goToService = function (service) {
$location.path('project/' + self.pId + '/' + service.toLowerCase());
};
self.goToSpecificDataset = function (name) {
$location.path($location.path() + '/' + name);
};
self.saveAllowed = function () {
if (self.currentProject.projectName.length == 0) {
return true;
}
};
// Dummy data
$scope.labels = ["Adam", "Spark", "Yarn", "MapReduce", "Zeppelin", "Cuneiform"];
$scope.data = [
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
];
$scope.labels2 = ["January", "February", "March", "April", "May", "June", "July"];
$scope.series = ['Fileoperations', 'Querys'];
$scope.data2 = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
$scope.onClick = function (points, evt) {
console.log(points, evt);
};
}]); |
<<<<<<<
self.init();
self.showTopic = function(){
=======
self.init();
self.showTopic = function(){
>>>>>>>
self.init();
self.init();
self.showTopic = function(){ |
<<<<<<<
}]);
=======
>>>>>>> |
<<<<<<<
import { getValidity, getForm, isValidityValid, isValidityInvalid } from '../utils';
=======
import { getValidity, getForm, isValid, isInvalid } from '../utils';
import { trackable } from '../utils/track';
>>>>>>>
import { getValidity, getForm, isValidityValid, isValidityInvalid } from '../utils';
import { trackable } from '../utils/track';
<<<<<<<
const setSubmitFailed = (model, submitFailed = true) => ({
=======
const setSubmitFailed = trackable((model) => ({
>>>>>>>
const setSubmitFailed = trackable((model, submitFailed = true) => ({
<<<<<<<
submitFailed,
});
=======
}));
>>>>>>>
submitFailed,
})); |
<<<<<<<
class Errors extends Component {
shouldComponentUpdate(nextProps) {
const { fieldValue, formValue } = nextProps;
const { dynamic } = this.props;
if (dynamic) {
return !shallowEqual(this.props, nextProps);
}
return fieldValue !== this.props.fieldValue
|| formValue !== this.props.formValue;
}
mapErrorMessages(errors) {
const { messages } = this.props;
if (typeof errors === 'string') {
return this.renderError(errors, 'error');
=======
function createErrorsClass(s = defaultStrategy) {
class Errors extends Component {
shouldComponentUpdate({ fieldValue, formValue }) {
return fieldValue !== this.props.fieldValue
|| formValue !== this.props.formValue;
>>>>>>>
function createErrorsClass(s = defaultStrategy) {
class Errors extends Component {
shouldComponentUpdate(nextProps) {
const { fieldValue, formValue } = nextProps;
const { dynamic } = this.props;
if (dynamic) {
return !shallowEqual(this.props, nextProps);
}
return fieldValue !== this.props.fieldValue
|| formValue !== this.props.formValue; |
<<<<<<<
=======
import {
Form,
modelReducer,
formReducer,
Field,
Control,
actions,
actionTypes,
} from '../src';
>>>>>>>
<<<<<<<
=======
});
describe('submitting after invalid', () => {
const store = createStore(combineReducers({
login: modelReducer('login', { username: '' }),
loginForm: formReducer('login', { username: '' }),
}), applyMiddleware(thunk));
let timesCalled = 0;
const handleSubmit = () => {
timesCalled++;
};
const form = TestUtils.renderIntoDocument(
<Provider store={store}>
<Form
model="login"
onSubmit={handleSubmit}
validators={{ username: (val) => !!val }}
validateOn="submit"
>
<Field model="login.username">
<input />
</Field>
</Form>
</Provider>
);
>>>>>>> |
<<<<<<<
if (!validators && !errors && (modelValue !== nextProps.modelValue)) {
if (!isValid(formValue)) {
dispatch(actions.setValidity(model, true));
}
return;
=======
if (!validators && !errors && (modelValue !== nextProps.modelValue)) {
// If the form is invalid (due to async validity)
// but its fields are valid and the value has changed,
// the form should be "valid" again.
if (!formValue.$form.valid && fieldsValid(formValue)) {
dispatch(actions.setValidity(model, true));
>>>>>>>
if (!validators && !errors && (modelValue !== nextProps.modelValue)) {
// If the form is invalid (due to async validity)
// but its fields are valid and the value has changed,
// the form should be "valid" again.
if (!formValue.$form.valid && fieldsValid(formValue)) {
dispatch(actions.setValidity(model, true));
}
return; |
<<<<<<<
import { checkoutNganLuong } from './nganluong.handlers';
=======
import { checkoutSohaPay, callbackSohaPay } from './sohapay-handlers';
>>>>>>>
import { checkoutNganLuong } from './nganluong.handlers';
import { checkoutSohaPay, callbackSohaPay } from './sohapay-handlers';
<<<<<<<
case 'nganluong':
asyncCheckout = checkoutNganLuong(req, res);
break;
=======
case 'sohaPay':
asyncCheckout = checkoutSohaPay(req, res);
break;
>>>>>>>
case 'nganluong':
asyncCheckout = checkoutNganLuong(req, res);
break;
case 'sohaPay':
asyncCheckout = checkoutSohaPay(req, res);
break; |
<<<<<<<
const controlAction = (controlActionMap[controlType] || controlActionMap.default)(props);
=======
let controlAction = (controlActionMap[control.props.type] || controlActionMap.default)(props);
>>>>>>>
const controlAction = (controlActionMap[control.props.type] || controlActionMap.default)(props); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.