rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
} else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { index--; state = 'broken_rhythm'; } else return el;
else { if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el;
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; }
} else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { index--; state = 'broken_rhythm';
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
return null; break; default: if (isComplete(state)) {
return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else {
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
} index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; }
break; default: if (isComplete(state)) { el.endChar = index; return el; } return null;
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
return null; };
index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
el.endChar = index;
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state == 'duration' || state == 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.pitch = null; el.rest_type = rests[line[index]]; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el = addEndBeam(el); el.endChar = index; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
el.endChar = index;
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state == 'duration' || state == 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.pitch = null; el.rest_type = rests[line[index]]; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el = addEndBeam(el); el.endChar = index; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
if (state === 'octave' || state === 'duration' || state === 'end_slur') {
if (state === 'startSlur') { if (tune.addTieToLastNote()) el.endTie = true; else warn("Illegal tie before any other note", line, index); } else if (state === 'octave' || state === 'duration' || state === 'end_slur') {
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state == 'duration' || state == 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.pitch = null; el.rest_type = rests[line[index]]; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else return null; break; case '-': if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el = addEndBeam(el); el.endChar = index; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o;do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()== a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",
if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o; do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",
document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o;do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",
a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var k=document.styleSheets[e],i=0,n=false;do{if((n=k.cssRules?k.cssRules[i]:k.rules[i])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){k.cssRules?k.deleteRule(i):k.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return h.getCssRule(a,"delete")};this.addStyleSheet=
a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var j=document.styleSheets[e],i=0,n;do{n=null;if(j.cssRules)n=j.cssRules[i];else if(j.rules)n=j.rules[i];if(n&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){j.cssRules?j.deleteRule(i):j.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};
a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var k=document.styleSheets[e],i=0,n=false;do{if((n=k.cssRules?k.cssRules[i]:k.rules[i])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){k.cssRules?k.deleteRule(i):k.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return h.getCssRule(a,"delete")};this.addStyleSheet=
var styleSheet=document.styleSheets[i]; var ii=0; var cssRule=false;
var styleSheet = document.styleSheets[i]; var ii = 0; var cssRule;
this.getCssRule = function(selector, deleteFlag) { selector=selector.toLowerCase(); if (document.styleSheets) { for (var i=0; i<document.styleSheets.length; i++) { var styleSheet=document.styleSheets[i]; var ii=0; var cssRule=false; do { if (styleSheet.cssRules) cssRule = styleSheet.cssRules[ii]; else cssRule = styleSheet.rules[ii]; if (cssRule && cssRule.selectorText) { if (cssRule.selectorText.toLowerCase()==selector) { if (deleteFlag=='delete') { if (styleSheet.cssRules) styleSheet.deleteRule(ii); else styleSheet.removeRule(ii); return true; } else return cssRule; } } ++ii; } while (cssRule); } } return false;};
else
else if (styleSheet.rules)
this.getCssRule = function(selector, deleteFlag) { selector=selector.toLowerCase(); if (document.styleSheets) { for (var i=0; i<document.styleSheets.length; i++) { var styleSheet=document.styleSheets[i]; var ii=0; var cssRule=false; do { if (styleSheet.cssRules) cssRule = styleSheet.cssRules[ii]; else cssRule = styleSheet.rules[ii]; if (cssRule && cssRule.selectorText) { if (cssRule.selectorText.toLowerCase()==selector) { if (deleteFlag=='delete') { if (styleSheet.cssRules) styleSheet.deleteRule(ii); else styleSheet.removeRule(ii); return true; } else return cssRule; } } ++ii; } while (cssRule); } } return false;};
if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var k=document.styleSheets[e],i=0,n=false;do{if((n=k.cssRules?k.cssRules[i]:k.rules[i])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){k.cssRules?k.deleteRule(i):k.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);
if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var k=document.styleSheets[e],i=0,n=false;do{if((n=k.cssRules?k.cssRules[i]:k.rules[i])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){k.cssRules?k.deleteRule(i):k.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return h.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);
" { "+b+" }",e.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var e=document.createElement("style");if(b)b.parentNode.insertBefore(e,b);else{e.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(e)}e.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var e=0;e<document.styleSheets.length;e++){var k=document.styleSheets[e],i=0,n=false;do{if((n=k.cssRules?k.cssRules[i]:k.rules[i])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){k.cssRules?k.deleteRule(i):k.removeRule(i);return true}else return n;++i}while(n)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);
"Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var h=document.styleSheets[f],k=0,o;do{o=null;if(h.cssRules)o=h.cssRules[k];else if(h.rules)o=h.rules[k];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){h.cssRules?h.deleteRule(k):h.removeRule(k);return true}else return o; ++k}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,
if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var h=document.styleSheets[f],k=0,o; do{o=null;if(h.cssRules)o=h.cssRules[k];else if(h.rules)o=h.rules[k];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){h.cssRules?h.deleteRule(k):h.removeRule(k);return true}else return o;++k}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",
"Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var h=document.styleSheets[f],k=0,o;do{o=null;if(h.cssRules)o=h.cssRules[k];else if(h.rules)o=h.rules[k];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){h.cssRules?h.deleteRule(k):h.removeRule(k);return true}else return o;++k}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,
if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var m=document.styleSheets[f],l=0,o= false;do{if((o=m.cssRules?m.cssRules[l]:m.rules[l])&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){m.cssRules?m.deleteRule(l):m.removeRule(l);return true}else return o;++l}while(o)}return false};this.removeCssRule=function(a){return k.getCssRule(a,"delete")};this.addStyleSheet=function(a){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var b=document.createElement("link");b.setAttribute("type","text/css");b.setAttribute("href",a);b.setAttribute("type",
document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var m=document.styleSheets[f],l=0,n=false;do{if((n=m.cssRules?m.cssRules[l]:m.rules[l])&&n.selectorText)if(n.selectorText.toLowerCase()==a)if(b=="delete"){m.cssRules? m.deleteRule(l):m.removeRule(l);return true}else return n;++l}while(n)}return false};this.removeCssRule=function(a){return k.getCssRule(a,"delete")};this.addStyleSheet=function(a){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var b=document.createElement("link");b.setAttribute("type","text/css");b.setAttribute("href",a);b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");document.getElementsByTagName("head")[0].appendChild(b)}};this.windowSize=
if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var m=document.styleSheets[f],l=0,o=false;do{if((o=m.cssRules?m.cssRules[l]:m.rules[l])&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){m.cssRules?m.deleteRule(l):m.removeRule(l);return true}else return o;++l}while(o)}return false};this.removeCssRule=function(a){return k.getCssRule(a,"delete")};this.addStyleSheet=function(a){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var b=document.createElement("link");b.setAttribute("type","text/css");b.setAttribute("href",a);b.setAttribute("type",
fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;if(u){N[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
fqstate;if(u){N[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()});
l.tagName.toUpperCase()!=="TEXTAREA"&&(l.tagName.toUpperCase()!=="INPUT"||l.type!=="hidden"&&l.type!=="text"))){v=l;if(r){if(typeof p==="string")p=document.getElementById(p);!p||p.tagName.toUpperCase()!=="IFRAME"||(F=p)}}}},navigate:function(l){if(I){fqstate=l;if(r)h(fqstate);else{location.hash=fqstate;if(u){M[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!I)return"";return C}}}()}),_$_APP_CLASS_$_=new (function(){function w(d){d=n.pageCoordinates(d);N=d.x;J=d.y}function t(){var d=
fqstate;b()}}}},getCurrentState:function(){if(!I)return"";return C}}}()}),_$_APP_CLASS_$_=new (function(){function w(d){d=n.pageCoordinates(d);N=d.x;J=d.y}function t(){var d=n.history.getCurrentState();if(O!=d){O=d;setTimeout(function(){y(null,"hash",null,true)},1)}}function D(d){if(O!=d){O=d;n.history.navigate(escape(d))}}function T(){window.onresize=function(){E()};document.body.ondragstart=function(){return false}}function ca(d,c){var e=aa;e.object=n.getElement(d.getAttribute("dwid"));if(e.object==
l.tagName.toUpperCase()!=="TEXTAREA"&&(l.tagName.toUpperCase()!=="INPUT"||l.type!=="hidden"&&l.type!=="text"))){v=l;if(r){if(typeof p==="string")p=document.getElementById(p);!p||p.tagName.toUpperCase()!=="IFRAME"||(F=p)}}}},navigate:function(l){if(I){fqstate=l;if(r)h(fqstate);else{location.hash=fqstate;if(u){M[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!I)return"";return C}}}()}),_$_APP_CLASS_$_=new (function(){function w(d){d=n.pageCoordinates(d);N=d.x;J=d.y}function t(){var d=
if(t)m(fqstate);else{location.hash=fqstate;if(r){A[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!E)return"";return z}}}()}),_$_APP_CLASS_$_=new (function(){function v(d){d=n.pageCoordinates(d);y=d.x;M=d.y}function s(){var d=n.history.getCurrentState();if(w!=d){w=d;setTimeout(function(){H(null,"hash",null,true)},1)}}function F(d){if(w!=d){w=d;n.history.navigate(escape(d))}}function k(){window.onresize=function(){C()};document.body.ondragstart=function(){return false}}function G(d,
true;else if(p.indexOf("Apple Computer, Inc.")>-1)q=true;if(typeof g==="string")g=document.getElementById(g);if(!(!g||g.tagName.toUpperCase()!=="TEXTAREA"&&(g.tagName.toUpperCase()!=="INPUT"||g.type!=="hidden"&&g.type!=="text"))){L=g;if(u){if(typeof o==="string")o=document.getElementById(o);!o||o.tagName.toUpperCase()!=="IFRAME"||(F=o)}}}},navigate:function(g){if(w){fqstate=g;if(u)m(fqstate);else{location.hash=fqstate;if(q){N[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!w)return""; return y}}}()}),_$_APP_CLASS_$_=new (function(){function x(d){d=g.pageCoordinates(d);o=d.x;p=d.y}function t(){var d=g.history.getCurrentState();if(s!=d){s=d;setTimeout(function(){A(null,"hash",null,true)},1)}}function C(d){if(s!=d){s=d;g.history.navigate(escape(d))}}function Y(){window.onresize=function(){q()};document.body.ondragstart=function(){return false}}function k(d,c){var e=J;e.object=g.getElement(d.getAttribute("dwid"));if(e.object==null)return true;e.sourceId=d.getAttribute("dsid");e.objectPrevStyle=
if(t)m(fqstate);else{location.hash=fqstate;if(r){A[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!E)return"";return z}}}()}),_$_APP_CLASS_$_=new (function(){function v(d){d=n.pageCoordinates(d);y=d.x;M=d.y}function s(){var d=n.history.getCurrentState();if(w!=d){w=d;setTimeout(function(){H(null,"hash",null,true)},1)}}function F(d){if(w!=d){w=d;n.history.navigate(escape(d))}}function k(){window.onresize=function(){C()};document.body.ondragstart=function(){return false}}function G(d,
getCurrentVoice: function() {
this.getCurrentVoice = function() {
getCurrentVoice: function() { if (this.lines[this.lineNum] !== undefined && this.lines[this.lineNum].staff[this.staffNum] !== undefined && this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum] !== undefined) return this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum]; else return null; },
},
};
getCurrentVoice: function() { if (this.lines[this.lineNum] !== undefined && this.lines[this.lineNum].staff[this.staffNum] !== undefined && this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum] !== undefined) return this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum]; else return null; },
let selection = window.content.getSelection(); let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false);
function _getCurrentWord (win) { let selection = win.getSelection(); if (selection.rangeCount <= 0) return; let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false);
getCurrentWord: function () { let selection = window.content.getSelection(); let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); // Only move backwards if the previous character is not a space. if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false); selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection); },
selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0];
selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection);
getCurrentWord: function () { let selection = window.content.getSelection(); let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); // Only move backwards if the previous character is not a space. if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false); selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection); },
if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection);
return util.Array.compact(buffer.allFrames.map(_getCurrentWord)).join("\n");
getCurrentWord: function () { let selection = window.content.getSelection(); let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = this.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); // Only move backwards if the previous character is not a space. if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false); selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection); },
return util.Array.compact(buffer.allFrames.map(_getCurrentWord)).join("\n");
return util.Array.compact(buffer.getAllFrames().map(_getCurrentWord)).join("\n");
getCurrentWord: function () { function _getCurrentWord (win) { let elem = win.frameElement; if (elem && elem.getClientRects().length === 0) return; let selection = win.getSelection(); if (selection.rangeCount <= 0) return; let range = selection.getRangeAt(0); if (selection.isCollapsed) { let selController = buffer.selectionController; let caretmode = selController.getCaretEnabled(); selController.setCaretEnabled(true); // Only move backwards if the previous character is not a space. if (range.startOffset > 0 && !/\s/.test(range.startContainer.textContent[range.startOffset - 1])) selController.wordMove(false, false); selController.wordMove(true, true); selController.setCaretEnabled(caretmode); return String.match(selection, /\w*/)[0]; } if (util.computedStyle(range.startContainer).whiteSpace == "pre" && util.computedStyle(range.endContainer).whiteSpace == "pre") return String(range); return String(selection); } return util.Array.compact(buffer.allFrames.map(_getCurrentWord)).join("\n"); },
}}});}});a.on('dialogDefinition',function(p){var q=p.data.name;if(q=='table'||q=='tableProperties'){var r=p.data.definition,s=r.getContents('info'),t=s.get('txtBorder'),u=t.commit;t.commit=e.override(u,function(v){return function(w,x){v.apply(this,arguments);var y=parseInt(this.getValue(),10);x[!y||y<=0?'addClass':'removeClass'](l);};});}});})();j.add('sourcearea',{requires:['editingblock'],init:function(l){var m=j.sourcearea,n=a.document.getWindow();l.on('editingBlockReady',function(){var o,p;l.addMode('source',{load:function(q,r){if(c&&b.version<8)q.setStyle('position','relative');l.textarea=o=new h('textarea');o.setAttributes({dir:'ltr',tabIndex:l.tabIndex,role:'textbox','aria-label':l.lang.editorTitle.replace('%1',l.name)});o.addClass('cke_source');o.addClass('cke_enable_context_menu');var s={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(c){p=function(){o.hide();o.setStyle('height',q.$.clientHeight+'px');o.setStyle('width',q.$.clientWidth+'px');o.show();};l.on('resize',p);n.on('resize',p);setTimeout(p,0);}else o.on('mousedown',function(u){u.data.stopPropagation();});q.setHtml('');q.append(o);o.setStyles(s);l.fire('ariaWidget',o);o.on('blur',function(){l.focusManager.blur();});o.on('focus',function(){l.focusManager.focus();});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t)t.attach(o);setTimeout(function(){l.mode='source';l.fire('mode');},b.gecko||b.webkit?100:0);},loadData:function(q){o.setValue(q);l.fire('dataReady');},getData:function(){return o.getValue();},getSnapshotData:function(){return o.getValue();},unload:function(q){o.clearCustomData();l.textarea=o=null;if(p){l.removeListener('resize',p);n.removeListener('resize',p);}if(c&&b.version<8)q.removeStyle('position');},focus:function(){o.focus();}});});l.addCommand('source',m.commands.source);if(l.ui.addButton)l.ui.addButton('Source',{label:l.lang.source,command:'source'});l.on('mode',function(){l.getCommand('source').setState(l.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},exec:function(l){if(l.mode=='wysiwyg')l.fire('saveSnapshot');l.getCommand('source').setState(0);l.setMode(l.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w<t.length;w++){var x=t[w];v=x.name;u=p[v]=new a.style(x);u._name=v;
l.fire('ariaWidget',o);o.on('blur',function(){l.focusManager.blur();});o.on('focus',function(){l.focusManager.focus();});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t)t.attach(o);setTimeout(function(){l.mode='source';l.fire('mode');},b.gecko||b.webkit?100:0);},loadData:function(q){o.setValue(q);l.fire('dataReady');},getData:function(){return o.getValue();},getSnapshotData:function(){return o.getValue();},unload:function(q){o.clearCustomData();l.textarea=o=null;if(p){l.removeListener('resize',p);n.removeListener('resize',p);}if(c&&b.version<8)q.removeStyle('position');},focus:function(){o.focus();}});});l.addCommand('source',m.commands.source);if(l.ui.addButton)l.ui.addButton('Source',{label:l.lang.source,command:'source'});l.on('mode',function(){l.getCommand('source').setState(l.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(l){if(l.mode=='wysiwyg')l.fire('saveSnapshot');l.getCommand('source').setState(0);l.setMode(l.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w<t.length;w++){var x=t[w];v=x.name;u=p[v]=new a.style(x);u._name=v;u._.enterMode=n.enterMode;q.push(u);}q.sort(l);}s&&s();});};m.ui.addRichCombo('Styles',{label:o.label,title:o.panelTitle,className:'cke_styles',panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:true,attributes:{'aria-label':o.panelTitle}},init:function(){var s=this;r(function(){var t,u,v;for(var w=0;w<q.length;w++){t=q[w];u=t._name;var x=t.type;if(x!=v){s.startGroup(o['panelTitle'+String(x)]);v=x;}s.add(u,t.type==3?u:t.buildPreview(),u);}s.commit();s.onOpen();});},onClick:function(s){m.focus();m.fire('saveSnapshot');var t=p[s],u=m.getSelection(),v=new d.elementPath(u.getStartElement());if(t.type==2&&t.checkActive(v))t.remove(m.document);else if(t.type==3&&t.checkActive(v))t.remove(m.document);else t.apply(m.document);m.fire('saveSnapshot');},onRender:function(){m.on('selectionChange',function(s){var t=this.getValue(),u=s.data.path,v=u.elements;for(var w=0,x;w<v.length;w++){x=v[w];for(var y in p){if(p[y].checkElementRemovable(x,true)){if(y!=t)this.setValue(y);return;}}}this.setValue('');},this);},onOpen:function(){var z=this;if(c||b.webkit)m.focus();var s=m.getSelection(),t=s.getSelectedElement(),u=new d.elementPath(t||s.getStartElement()),v=[0,0,0,0];
}}});}});a.on('dialogDefinition',function(p){var q=p.data.name;if(q=='table'||q=='tableProperties'){var r=p.data.definition,s=r.getContents('info'),t=s.get('txtBorder'),u=t.commit;t.commit=e.override(u,function(v){return function(w,x){v.apply(this,arguments);var y=parseInt(this.getValue(),10);x[!y||y<=0?'addClass':'removeClass'](l);};});}});})();j.add('sourcearea',{requires:['editingblock'],init:function(l){var m=j.sourcearea,n=a.document.getWindow();l.on('editingBlockReady',function(){var o,p;l.addMode('source',{load:function(q,r){if(c&&b.version<8)q.setStyle('position','relative');l.textarea=o=new h('textarea');o.setAttributes({dir:'ltr',tabIndex:l.tabIndex,role:'textbox','aria-label':l.lang.editorTitle.replace('%1',l.name)});o.addClass('cke_source');o.addClass('cke_enable_context_menu');var s={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(c){p=function(){o.hide();o.setStyle('height',q.$.clientHeight+'px');o.setStyle('width',q.$.clientWidth+'px');o.show();};l.on('resize',p);n.on('resize',p);setTimeout(p,0);}else o.on('mousedown',function(u){u.data.stopPropagation();});q.setHtml('');q.append(o);o.setStyles(s);l.fire('ariaWidget',o);o.on('blur',function(){l.focusManager.blur();});o.on('focus',function(){l.focusManager.focus();});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t)t.attach(o);setTimeout(function(){l.mode='source';l.fire('mode');},b.gecko||b.webkit?100:0);},loadData:function(q){o.setValue(q);l.fire('dataReady');},getData:function(){return o.getValue();},getSnapshotData:function(){return o.getValue();},unload:function(q){o.clearCustomData();l.textarea=o=null;if(p){l.removeListener('resize',p);n.removeListener('resize',p);}if(c&&b.version<8)q.removeStyle('position');},focus:function(){o.focus();}});});l.addCommand('source',m.commands.source);if(l.ui.addButton)l.ui.addButton('Source',{label:l.lang.source,command:'source'});l.on('mode',function(){l.getCommand('source').setState(l.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},exec:function(l){if(l.mode=='wysiwyg')l.fire('saveSnapshot');l.getCommand('source').setState(0);l.setMode(l.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w<t.length;w++){var x=t[w];v=x.name;u=p[v]=new a.style(x);u._name=v;
return this.getDatabaseFileNameNew();
if (this.KeePassDatabases != null && this.KeePassDatabases.length > 0 && this.KeePassDatabases[this.ActiveKeePassDatabaseIndex] != null && this.KeePassDatabases[this.ActiveKeePassDatabaseIndex].root != null) return this.KeePassDatabases[this.ActiveKeePassDatabaseIndex].fileName; else return null;
getDatabaseFileName: function() { return this.getDatabaseFileNameNew(); },
return this.getDatabaseNameNew();
if (this.KeePassDatabases != null && this.KeePassDatabases.length > 0 && this.KeePassDatabases[this.ActiveKeePassDatabaseIndex] != null && this.KeePassDatabases[this.ActiveKeePassDatabaseIndex].root != null) return this.KeePassDatabases[this.ActiveKeePassDatabaseIndex].name; else return null;
getDatabaseName: function() { return this.getDatabaseNameNew(); },
return this.KeePassRPC.getDBName();
var result = this.KeePassRPC.getDBName(); return result;
getDatabaseName: function() { try { return this.KeePassRPC.getDBName(); } catch (e) { this._KFLog.error("Unexpected exception while connecting to KeePassRPC. Please inform the KeeFox team that they should be handling this exception: " + e); throw e; } },
var basePath = '/' + rec.data.hits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version;
var basePath = '/' + rec.data.artifactHits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version;
getDefaultPath : function(rec) { var basePath = '/' + rec.data.hits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version; for (var i = 0; i < rec.data.hits[0].artifactLinks.length; i++) { var link = rec.data.hits[0].artifactLinks[i]; if (Ext.isEmpty(link.classifier)) { if (link.extension != 'pom') { return basePath + '.' + link.extension; } } } var link = rec.data.hits[0].artifactLinks[0]; return basePath + (link.classifier ? ('-' + link.classifier) : '') + '.' + link.extension; },
for (var i = 0; i < rec.data.hits[0].artifactLinks.length; i++)
for (var i = 0; i < rec.data.artifactHits[0].artifactLinks.length; i++)
getDefaultPath : function(rec) { var basePath = '/' + rec.data.hits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version; for (var i = 0; i < rec.data.hits[0].artifactLinks.length; i++) { var link = rec.data.hits[0].artifactLinks[i]; if (Ext.isEmpty(link.classifier)) { if (link.extension != 'pom') { return basePath + '.' + link.extension; } } } var link = rec.data.hits[0].artifactLinks[0]; return basePath + (link.classifier ? ('-' + link.classifier) : '') + '.' + link.extension; },
var link = rec.data.hits[0].artifactLinks[i];
var link = rec.data.artifactHits[0].artifactLinks[i];
getDefaultPath : function(rec) { var basePath = '/' + rec.data.hits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version; for (var i = 0; i < rec.data.hits[0].artifactLinks.length; i++) { var link = rec.data.hits[0].artifactLinks[i]; if (Ext.isEmpty(link.classifier)) { if (link.extension != 'pom') { return basePath + '.' + link.extension; } } } var link = rec.data.hits[0].artifactLinks[0]; return basePath + (link.classifier ? ('-' + link.classifier) : '') + '.' + link.extension; },
var link = rec.data.hits[0].artifactLinks[0];
var link = rec.data.artifactHits[0].artifactLinks[0];
getDefaultPath : function(rec) { var basePath = '/' + rec.data.hits[0].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version; for (var i = 0; i < rec.data.hits[0].artifactLinks.length; i++) { var link = rec.data.hits[0].artifactLinks[i]; if (Ext.isEmpty(link.classifier)) { if (link.extension != 'pom') { return basePath + '.' + link.extension; } } } var link = rec.data.hits[0].artifactLinks[0]; return basePath + (link.classifier ? ('-' + link.classifier) : '') + '.' + link.extension; },
var basePath = '/' + rec.data.artifactHits[hitIndex].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version;
var basePath = '/' + this.payload.data.name + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version;
getDefaultPathFromPayload : function() { var rec = this.payload.data.rec; var hitIndex = this.payload.data.hitIndex; var basePath = '/' + rec.data.artifactHits[hitIndex].repositoryName + '/' + rec.data.groupId.replace(/\./g, '/') + '/' + rec.data.artifactId + '/' + rec.data.version + '/' + rec.data.artifactId + '-' + rec.data.version; for (var i = 0; i < rec.data.artifactHits[hitIndex].artifactLinks.length; i++) { var link = rec.data.artifactHits[hitIndex].artifactLinks[i]; if (Ext.isEmpty(link.classifier)) { if (link.extension != 'pom') { return basePath + '.' + link.extension; } } } var link = rec.data.artifactHits[hitIndex].artifactLinks[0]; return basePath + (link.classifier ? ('-' + link.classifier) : '') + '.' + link.extension; },
if (data.pdfurl !== null) { data.pdfurl = data.pdfurl.href; } else {
if (data.pdfurl == null) {
var getDocumentData = function (newDoc, data) { var xpath = '//div[@id="metahead"]/div'; var stuff = newDoc.evaluate(xpath, newDoc, null, XPathResult.ANY_TYPE, null); var thing = stuff.iterateNext(); while (thing) { if (thing.textContent.match(/DOI/)) { data.doi = Zotero.Utilities.trimInternal(thing.textContent).match(/:\s+(.*)/)[1]; break; } thing = stuff.iterateNext(); } // There seem to be multiple page structures data.pdfurl = newDoc.evaluate('//div[@id="content"]/div/a[1]', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext(); if (data.pdfurl !== null) { data.pdfurl = data.pdfurl.href; } else { // If we didn't find the URL there, try elsewhere: data.pdfurl = newDoc.evaluate('//a[@title="Download PDF"]', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().href; } var id = newDoc.location.href.match(/content=([\w\d]+)/); // If URL has DOI rather than id, use navbar link to get id if (id[1] == 10) { id = newDoc.evaluate('//div[@id="contenttabs"]//a[@title = "Article"]', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().href; id = id.match(/content=([\w\d]+)/); } var post = 'tab=citation&selecteditems=' + id[1].substr(1) + '&content=' + id[1] + '&citstyle=refworks&showabs=false&format=file'; data.postdata = post; }
return this;},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle('filter',i>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;
},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(j,k){var l=this;if(j=='class')l.$.className=k;else if(j=='style')l.$.style.cssText=k;else if(j=='tabindex')l.$.tabIndex=k;else if(j=='checked')l.$.checked=k;else i.apply(l,arguments);return l;};else return i;})(),setAttributes:function(i){for(var j in i)this.setAttribute(j,i[j]);return this;},setValue:function(i){this.$.value=i;return this;},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){if(j=='class')j='className';else if(j=='tabindex')j='tabIndex';i.call(this,j);};else return i;})(),removeAttributes:function(i){if(e.isArray(i))for(var j=0;j<i.length;j++)this.removeAttribute(i[j]);else for(var k in i)i.hasOwnProperty(k)&&this.removeAttribute(k);},removeStyle:function(i){var j=this;j.setStyle(i,'');if(j.$.style.removeAttribute)j.$.style.removeAttribute(e.cssStyleToDomStyle(i));if(!j.$.style.cssText)j.removeAttribute('style');},setStyle:function(i,j){this.$.style[e.cssStyleToDomStyle(i)]=j;return this;},setStyles:function(i){for(var j in i)this.setStyle(j,i[j]);return this;},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle('filter',i>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop); k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l<k.length;l++){var m=k[l],n=m.nodeName.toLowerCase(),o;if(n in j)continue;if(n=='checked'&&(o=p.getAttribute(n)))i.setAttribute(n,o);else if(m.specified||c&&m.nodeValue&&n=='value'){o=p.getAttribute(n);if(o===null)o=m.nodeValue;i.setAttribute(n,o);}}if(p.$.style.cssText!=='')i.$.style.cssText=p.$.style.cssText;},renameNode:function(i){var l=this;if(l.getName()==i)return;var j=l.getDocument(),k=new h(i,j);l.copyAttributes(k);l.moveChildren(k);l.getParent()&&l.$.parentNode.replaceChild(k.$,l.$);k.$._cke_expando=l.$._cke_expando;l.$=k.$;},getChild:function(i){var j=this.$;if(!i.slice)j=j.childNodes[i];else while(i.length>0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});},setSize:(function(){var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']};
return this;},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle('filter',i>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;
getDuration: function(el) {
this.getDuration = function(el) {
getDuration: function(el) { if (el.duration) return el.duration; //if (el.pitches && el.pitches.length > 0) return el.pitches[0].duration; return 0; },
},
};
getDuration: function(el) { if (el.duration) return el.duration; //if (el.pitches && el.pitches.length > 0) return el.pitches[0].duration; return 0; },
false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=
3;this.cancelEvent=function(a,b){if(!N){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b= window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}l=a.offsetParent;if(l==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&
false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=
if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,k;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,
if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,k;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(x(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,
a)}}};this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,k;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,
g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;
false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=
g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,k;if(h.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;e+=document.body.scrollTop+document.documentElement.scrollTop;break}k=a.offsetParent;
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(j){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,j;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;if(v(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;e+=document.body.scrollTop+document.documentElement.scrollTop;break}j=a.offsetParent;
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,k;if(h.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;e+=document.body.scrollTop+document.documentElement.scrollTop;break}k=a.offsetParent;
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,k;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;e-=a.scrollTop}}while(a!=null&&a!=k)}}return{x:b,y:e}};this.widgetCoordinates=
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,k;if(h.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(h.hasTag(a,"DIV")){b-=a.scrollLeft;e-=a.scrollTop}}while(a!=null&&a!=k)}}return{x:b,y:e}};this.widgetCoordinates=
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var e=0;e<window.frames.length;++e)try{if(b=window.frames[e].document.getElementById(a))return b}catch(k){}return b};this.widgetPageCoordinates=function(a){var b=0,e=0,k;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;e+=a.offsetTop;k=a.offsetParent;if(k==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;e-=a.scrollTop}}while(a!=null&&a!=k)}}return{x:b,y:e}};this.widgetCoordinates=
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(m){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,m;if(k.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;m=a.offsetParent;if(m==null)a=null;else{do{a=a.parentNode;if(k.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&a!=m)}}return{x:b,y:f}};this.widgetCoordinates=
else a.cancelBubble=true;document.activeElement&&document.activeElement.blur&&k.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(m){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,m;if(k.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;m=a.offsetParent;
this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(m){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,m;if(k.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;m=a.offsetParent;if(m==null)a=null;else{do{a=a.parentNode;if(k.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&a!=m)}}return{x:b,y:f}};this.widgetCoordinates=
while (eParElement != null ) {
while (eParElement !== null ) {
acl.getElementPosition=function(eElement) { var nLeftPos = eElement.offsetLeft; // initialize var to store calculations var nTopPos = eElement.offsetTop; // initialize var to store calculations var eParElement = eElement.offsetParent; // identify first offset parent element while (eParElement != null ) { // move up through element hierarchy nLeftPos += eParElement.offsetLeft; // appending left offset of each parent nTopPos += eParElement.offsetTop; eParElement = eParElement.offsetParent; // until no more offset parents exist } return {left:nLeftPos, top:nTopPos};};
return document.getElementsByClassName(className, parentElement);
return parentElement.getElementsByClassName(className);
this.getElementsByClassName = function(className, parentElement) { if (document.getElementsByClassName) { return document.getElementsByClassName(className, parentElement); } else { var cc = parentElement.getElementsByTagName('*'); var els = [], c; for (var i = 0, length = cc.length; i < length; i++) { c = cc[i]; if (c.className.indexOf(className) != -1) els.push(c); } return els; }};
function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName= function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=
""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");
function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=
a.target||a.srcElement};var P=false,da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a, b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=
function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName= function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=
a.target||a.srcElement};var P=false,da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=
a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){C&&a==C&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*"); for(var e=[],k,i=0,n=b.length;i<n;i++){k=b[i];k.className.indexOf(a)!=-1&&e.push(k)}return e}};this.addCss=function(a,b){var e=document.styleSheets[0];e.insertRule(a+" { "+b+" }",e.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var e=document.createElement("style");if(b)b.parentNode.insertBefore(e,b);else{e.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(e)}e.styleSheet.cssText=
a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){B&&a==B&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*"); for(var e=[],j,i=0,n=b.length;i<n;i++){j=b[i];j.className.indexOf(a)!=-1&&e.push(j)}return e}};this.addCss=function(a,b){var e=document.styleSheets[0];e.insertRule(a+" { "+b+" }",e.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var e=document.createElement("style");if(b)b.parentNode.insertBefore(e,b);else{e.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(e)}e.styleSheet.cssText=
a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){C&&a==C&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var e=[],k,i=0,n=b.length;i<n;i++){k=b[i];k.className.indexOf(a)!=-1&&e.push(k)}return e}};this.addCss=function(a,b){var e=document.styleSheets[0];e.insertRule(a+" { "+b+" }",e.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var e=document.createElement("style");if(b)b.parentNode.insertBefore(e,b);else{e.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(e)}e.styleSheet.cssText=
""};var B=null,S=false,Y=false;this.capture=function(a){ca();if(!(B&&a)){B=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){B&&a==B&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a); else{b=b.getElementsByTagName("*");for(var f=[],h,k=0,o=b.length;k<o;k++){h=b[k];h.className.indexOf(a)!=-1&&f.push(h)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id=
"off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){B&&a==B&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],h,k=0,o=b.length;k<o;k++){h=b[k];h.className.indexOf(a)!=-1&&f.push(h)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");
""};var B=null,S=false,Y=false;this.capture=function(a){ca();if(!(B&&a)){B=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){B&&a==B&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],h,k=0,o=b.length;k<o;k++){h=b[k];h.className.indexOf(a)!=-1&&f.push(h)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id=
for (var i=0, count = this.fieldCount(); i<count; i++){
for (var i=0, count = this.fieldCount(); i<count; i += 1){
getFieldNames: function(){ var fieldNames = []; for (var i=0, count = this.fieldCount(); i<count; i++){ fieldNames[i] = this.fieldOrder[i]; } return fieldNames; },
return g.length?b(e._elementText(g.item(0))):null}}else if(d==="1")f=function(){var g=m(this.row,r,null,a);return e._arrayConverter(g,b)};else if(d==="0")f=function(){var g=m(this.row,r,null,a);return g.length?e._arrayConverter(g,b):null};return f},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c++)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b++)a[b]=this.fieldOrder[b];return a},
return f.length?b(e._elementText(f.item(0))):null}}else if(d==="1")h=function(){var f=o(this.row,s,null,a);return e._arrayConverter(f,b)};else if(d==="0")h=function(){var f=o(this.row,s,null,a);return f.length?e._arrayConverter(f,b):null};return h},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c+=1)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b+=1)a[b]=this.fieldOrder[b]; return a},hasMoreRows:function(){return this.numRows>this.rowIndex},next:function(){this.rowIndex+=1;this.row=this.rows.item(this.rowIndex)},curr:function(){return this.rowIndex},rowCount:function(){return this.numRows},reset:function(){this.rowIndex=0;this.row=this.hasMoreRows()?this.rows.item(this.rowIndex):null},fieldDef:function(a){var b=this.fields[a];j(b)&&Xmla.Exception._newError("INVALID_FIELD","Xmla.Rowset.fieldDef",a)._throw();return b},fieldIndex:function(a){a=this.fieldDef(a);return a.index},
return g.length?b(e._elementText(g.item(0))):null}}else if(d==="1")f=function(){var g=m(this.row,r,null,a);return e._arrayConverter(g,b)};else if(d==="0")f=function(){var g=m(this.row,r,null,a);return g.length?e._arrayConverter(g,b):null};return f},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c++)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b++)a[b]=this.fieldOrder[b];return a},
for (var i=0; i<fieldCount; i++){
for (var i=0; i<fieldCount; i += 1){
getFields: function(){ var f = [], fieldCount = this._fieldCount, fieldOrder = this.fieldOrder ; for (var i=0; i<fieldCount; i++){ f[i] = this.fieldDef(fieldOrder[i]); } return f; },
return g.length?b(e._elementText(g.item(0))):null}}else if(d==="1")f=function(){var g=m(this.row,r,null,a);return e._arrayConverter(g,b)};else if(d==="0")f=function(){var g=m(this.row,r,null,a);return g.length?e._arrayConverter(g,b):null};return f},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c++)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b++)a[b]=this.fieldOrder[b];return a},
return f.length?b(e._elementText(f.item(0))):null}}else if(d==="1")h=function(){var f=o(this.row,s,null,a);return e._arrayConverter(f,b)};else if(d==="0")h=function(){var f=o(this.row,s,null,a);return f.length?e._arrayConverter(f,b):null};return h},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c+=1)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b+=1)a[b]=this.fieldOrder[b];
return g.length?b(e._elementText(g.item(0))):null}}else if(d==="1")f=function(){var g=m(this.row,r,null,a);return e._arrayConverter(g,b)};else if(d==="0")f=function(){var g=m(this.row,r,null,a);return g.length?e._arrayConverter(g,b):null};return f},getType:function(){return this._type},getFields:function(){for(var a=[],b=this._fieldCount,d=this.fieldOrder,c=0;c<b;c++)a[c]=this.fieldDef(d[c]);return a},getFieldNames:function(){for(var a=[],b=0,d=this.fieldCount();b<d;b++)a[b]=this.fieldOrder[b];return a},
value = value.replace(/{(\\[`"'^~=a-z])([A-Za-z])}/g, "$1{$2}");
value = value.replace(/{?(\\[`"'^~=a-z]){?\\?([A-Za-z])}/g, "$1{$2}");
function getFieldValue(read) { var value = ""; // now, we have the first character of the field if(read == "{") { // character is a brace var openBraces = 1; while(read = Zotero.read(1)) { if(read == "{" && value[value.length-1] != "\\") { openBraces++; value += "{"; } else if(read == "}" && value[value.length-1] != "\\") { openBraces--; if(openBraces == 0) { break; } else { value += "}"; } } else { value += read; } } } else if(read == '"') { var openBraces = 0; while(read = Zotero.read(1)) { if(read == "{" && value[value.length-1] != "\\") { openBraces++; value += "{"; } else if(read == "}" && value[value.length-1] != "\\") { openBraces--; value += "}"; } else if(read == '"' && openBraces == 0) { break; } else { value += read; } } } if(value.length > 1) { // replace accented characters (yucky slow) value = value.replace(/{(\\[`"'^~=a-z])([A-Za-z])}/g, "$1{$2}"); for (var mapped in reversemappingTable) { // really really slow! var unicode = reversemappingTable[mapped]; if (value.indexOf(mapped) != -1) { Zotero.debug("Replace " + mapped + " in " + value + " with " + unicode); value = value.replace(mapped, unicode, "g"); } mapped = mapped.replace(/[{}]/, ""); if (value.indexOf(mapped) != -1) { Zotero.debug("Replace(2) " + mapped + " in " + value + " with " + unicode); value = value.replace(mapped, unicode, "g"); } } // kill braces value = value.replace(/([^\\])[{}]+/g, "$1"); if(value[0] == "{") { value = value.substr(1); } // chop off backslashes value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2"); value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2"); if(value[0] == "\\" && "#$%&~_^\\{}".indexOf(value[1]) != -1) { value = value.substr(1); } if(value[value.length-1] == "\\" && "#$%&~_^\\{}".indexOf(value[value.length-2]) != -1) { value = value.substr(0, value.length-1); } value = value.replace(/\\\\/g, "\\"); value = value.replace(/\s+/g, " "); } return value;}
mapped = mapped.replace(/[{}]/, "");
mapped = mapped.replace(/[{}]/g, "");
function getFieldValue(read) { var value = ""; // now, we have the first character of the field if(read == "{") { // character is a brace var openBraces = 1; while(read = Zotero.read(1)) { if(read == "{" && value[value.length-1] != "\\") { openBraces++; value += "{"; } else if(read == "}" && value[value.length-1] != "\\") { openBraces--; if(openBraces == 0) { break; } else { value += "}"; } } else { value += read; } } } else if(read == '"') { var openBraces = 0; while(read = Zotero.read(1)) { if(read == "{" && value[value.length-1] != "\\") { openBraces++; value += "{"; } else if(read == "}" && value[value.length-1] != "\\") { openBraces--; value += "}"; } else if(read == '"' && openBraces == 0) { break; } else { value += read; } } } if(value.length > 1) { // replace accented characters (yucky slow) value = value.replace(/{(\\[`"'^~=a-z])([A-Za-z])}/g, "$1{$2}"); for (var mapped in reversemappingTable) { // really really slow! var unicode = reversemappingTable[mapped]; if (value.indexOf(mapped) != -1) { Zotero.debug("Replace " + mapped + " in " + value + " with " + unicode); value = value.replace(mapped, unicode, "g"); } mapped = mapped.replace(/[{}]/, ""); if (value.indexOf(mapped) != -1) { Zotero.debug("Replace(2) " + mapped + " in " + value + " with " + unicode); value = value.replace(mapped, unicode, "g"); } } // kill braces value = value.replace(/([^\\])[{}]+/g, "$1"); if(value[0] == "{") { value = value.substr(1); } // chop off backslashes value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2"); value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2"); if(value[0] == "\\" && "#$%&~_^\\{}".indexOf(value[1]) != -1) { value = value.substr(1); } if(value[value.length-1] == "\\" && "#$%&~_^\\{}".indexOf(value[value.length-2]) != -1) { value = value.substr(0, value.length-1); } value = value.replace(/\\\\/g, "\\"); value = value.replace(/\s+/g, " "); } return value;}
var num = 1; var den = 1; if (line[index] !== '/') { var ret = getNumber(line, index); num = ret.num; index = ret.index;
var num = 1; var den = 1; if (line[index] !== '/') { var ret = getNumber(line, index); num = ret.num; index = ret.index; } if (line[index] === '/') { index++; if (line[index] === '/') { var div = 0.5; while (line[index++] === '/') div = div /2; return {value: num * div, index: index-1}; } else { var iSave = index; var ret2 = getNumber(line, index); if (ret2.num === 0 && iSave === index) ret2.num = 2; if (ret2.num !== 0) den = ret2.num; index = ret2.index;
this.getFraction = function(line, index) { var num = 1; var den = 1; if (line[index] !== '/') { var ret = getNumber(line, index); num = ret.num; index = ret.index; } if (line[index] === '/') { index++; if (line[index] === '/') { var div = 0.5; while (line[index++] === '/') div = div /2; return {value: num * div, index: index-1}; } else { var iSave = index; var ret2 = getNumber(line, index); if (ret2.num === 0 && iSave === index) // If we didn't use any characters, it is an implied 2 ret2.num = 2; if (ret2.num !== 0) den = ret2.num; index = ret2.index; } } return {value: num/den, index: index}; };
if (line[index] === '/') { index++; if (line[index] === '/') { var div = 0.5; while (line[index++] === '/') div = div /2; return {value: num * div, index: index-1}; } else { var iSave = index; var ret2 = getNumber(line, index); if (ret2.num === 0 && iSave === index) ret2.num = 2; if (ret2.num !== 0) den = ret2.num; index = ret2.index; } }
}
this.getFraction = function(line, index) { var num = 1; var den = 1; if (line[index] !== '/') { var ret = getNumber(line, index); num = ret.num; index = ret.index; } if (line[index] === '/') { index++; if (line[index] === '/') { var div = 0.5; while (line[index++] === '/') div = div /2; return {value: num * div, index: index-1}; } else { var iSave = index; var ret2 = getNumber(line, index); if (ret2.num === 0 && iSave === index) // If we didn't use any characters, it is an implied 2 ret2.num = 2; if (ret2.num !== 0) den = ret2.num; index = ret2.index; } } return {value: num/den, index: index}; };
return this;},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle('filter',i>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src; if(c&&b.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l<k.length;l++){var m=k[l],n=m.nodeName.toLowerCase(),o;if(n in j)continue;if(n=='checked'&&(o=p.getAttribute(n)))i.setAttribute(n,o);else if(m.specified||c&&m.nodeValue&&n=='value'){o=p.getAttribute(n);if(o===null)o=m.nodeValue;i.setAttribute(n,o);}}if(p.$.style.cssText!=='')i.$.style.cssText=p.$.style.cssText;},renameNode:function(i){var l=this;if(l.getName()==i)return;var j=l.getDocument(),k=new h(i,j);l.copyAttributes(k);l.moveChildren(k);l.$.parentNode.replaceChild(k.$,l.$);k.$._cke_expando=l.$._cke_expando;l.$=k.$;},getChild:function(i){var j=this.$;if(!i.slice)j=j.childNodes[i];else while(i.length>0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});}});a.command=function(i,j){this.uiItems=[];this.exec=function(k){if(this.state==0)return false;if(this.editorFocus)i.focus();return j.exec.call(this,i,k)!==false;};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:true,state:2});a.event.call(this);};a.command.prototype={enable:function(){var i=this;if(i.state==0)i.setState(!i.preserveState||typeof i.previousState=='undefined'?2:i.previousState);},disable:function(){this.setState(0);},setState:function(i){var j=this;if(j.state==i)return false;j.previousState=j.state;j.state=i;j.fire('state');return true;},toggleState:function(){var i=this;if(i.state==2)i.setState(1);else if(i.state==1)i.setState(2);}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:a.basePath+'contents.css',contentsLangDirection:'ltr',language:'',defaultLanguage:'en',enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:'',docType:'<!DOCTYPE html PUBLIC "-
k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l<k.length;l++){var m=k[l],n=m.nodeName.toLowerCase(),o;if(n in j)continue;if(n=='checked'&&(o=p.getAttribute(n)))i.setAttribute(n,o);else if(m.specified||c&&m.nodeValue&&n=='value'){o=p.getAttribute(n);if(o===null)o=m.nodeValue;i.setAttribute(n,o);}}if(p.$.style.cssText!=='')i.$.style.cssText=p.$.style.cssText;},renameNode:function(i){var l=this;if(l.getName()==i)return;var j=l.getDocument(),k=new h(i,j);l.copyAttributes(k);l.moveChildren(k);l.getParent()&&l.$.parentNode.replaceChild(k.$,l.$);k.$._cke_expando=l.$._cke_expando;l.$=k.$;},getChild:function(i){var j=this.$;if(!i.slice)j=j.childNodes[i];else while(i.length>0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});},setSize:(function(){var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']};
return this;},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle('filter',i>=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k)j.$.scrollTo(0,l);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);</script>")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l<k.length;l++){var m=k[l],n=m.nodeName.toLowerCase(),o;if(n in j)continue;if(n=='checked'&&(o=p.getAttribute(n)))i.setAttribute(n,o);else if(m.specified||c&&m.nodeValue&&n=='value'){o=p.getAttribute(n);if(o===null)o=m.nodeValue;i.setAttribute(n,o);}}if(p.$.style.cssText!=='')i.$.style.cssText=p.$.style.cssText;},renameNode:function(i){var l=this;if(l.getName()==i)return;var j=l.getDocument(),k=new h(i,j);l.copyAttributes(k);l.moveChildren(k);l.$.parentNode.replaceChild(k.$,l.$);k.$._cke_expando=l.$._cke_expando;l.$=k.$;},getChild:function(i){var j=this.$;if(!i.slice)j=j.childNodes[i];else while(i.length>0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});}});a.command=function(i,j){this.uiItems=[];this.exec=function(k){if(this.state==0)return false;if(this.editorFocus)i.focus();return j.exec.call(this,i,k)!==false;};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:true,state:2});a.event.call(this);};a.command.prototype={enable:function(){var i=this;if(i.state==0)i.setState(!i.preserveState||typeof i.previousState=='undefined'?2:i.previousState);},disable:function(){this.setState(0);},setState:function(i){var j=this;if(j.state==i)return false;j.previousState=j.state;j.state=i;j.fire('state');return true;},toggleState:function(){var i=this;if(i.state==2)i.setState(1);else if(i.state==1)i.setState(2);}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:a.basePath+'contents.css',contentsLangDirection:'ltr',language:'',defaultLanguage:'en',enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:'',docType:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};
k.setHtml(i);return k.getFirst().remove();};h.setMarker=function(i,j,k,l){var m=j.getCustomData('list_marker_id')||j.setCustomData('list_marker_id',e.getNextNumber()).getCustomData('list_marker_id'),n=j.getCustomData('list_marker_names')||j.setCustomData('list_marker_names',{}).getCustomData('list_marker_names');i[m]=j;n[k]=1;return j.setCustomData(k,l);};h.clearAllMarkers=function(i){for(var j in i)h.clearMarkers(i,i[j],true);};h.clearMarkers=function(i,j,k){var l=j.getCustomData('list_marker_names'),m=j.getCustomData('list_marker_id');for(var n in l)j.removeCustomData(n);j.removeCustomData('list_marker_names');if(k){j.removeCustomData('list_marker_id');delete i[m];}};e.extend(h.prototype,{type:1,addClass:function(i){var j=this.$.className;if(j){var k=new RegExp('(?:^|\\s)'+i+'(?:\\s|$)','');if(!k.test(j))j+=' '+i;}this.$.className=j||i;},removeClass:function(i){var j=this.getAttribute('class');if(j){var k=new RegExp('(?:^|\\s+)'+i+'(?=\\s|$)','i');if(k.test(j)){j=j.replace(k,'').replace(/^\s+/,'');if(j)this.setAttribute('class',j);else this.removeAttribute('class');}}},hasClass:function(i){var j=new RegExp('(?:^|\\s+)'+i+'(?=\\s|$)','');return j.test(this.getAttribute('class'));},append:function(i,j){var k=this;if(typeof i=='string')i=k.getDocument().createElement(i);if(j)k.$.insertBefore(i.$,k.$.firstChild);else k.$.appendChild(i.$);return i;},appendHtml:function(i){var k=this;if(!k.$.childNodes.length)k.setHtml(i);else{var j=new h('div',k.getDocument());j.setHtml(i);j.moveChildren(k);}},appendText:function(i){if(this.$.text!=undefined)this.$.text+=i;else this.append(new d.text(i));},appendBogus:function(){var k=this;var i=k.getLast();while(i&&i.type==3&&!e.rtrim(i.getText()))i=i.getPrevious();if(!i||!i.is||!i.is('br')){var j=b.opera?k.getDocument().createText(''):k.getDocument().createElement('br');b.gecko&&j.setAttribute('type','_moz');k.append(j);}},breakParent:function(i){var l=this;var j=new d.range(l.getDocument());j.setStartAfter(l);j.setEndAfter(i);var k=j.extractContents();j.insertNode(l.remove());k.insertAfterNode(l);},contains:c||b.webkit?function(i){var j=this.$;return i.type!=1?j.contains(i.getParent().$):j!=i.$&&j.contains(i.$);}:function(i){return!!(this.$.compareDocumentPosition(i.$)&16);},focus:function(){try{this.$.focus();}catch(i){}},getHtml:function(){var i=this.$.innerHTML;return c?i.replace(/<\?[^>]*>/g,''):i;},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');
},onAttribute:function(q,r,s){var t=this._.attributes[r];if(t){var u=t.filter(s,q,this);if(u===false)return false;if(typeof u!='undefined')return u;}return s;}}});function l(q,r){for(var s=0;q&&s<r.length;s++){var t=r[s];q=q.replace(t[0],t[1]);}return q;};function m(q,r,s){if(typeof r=='function')r=[r];var t,u,v=q.length,w=r&&r.length;if(w){for(t=0;t<v&&q[t].pri<s;t++){}for(u=w-1;u>=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=typeof q=='object';for(var s=0;s<this.length;s++){var t=this[s],u=t.apply(window,arguments);if(typeof u!='undefined'){if(u===false)return false;if(r&&u!=q)return u;}}return null;};})();a.htmlParser.basicWriter=e.createClass({$:function(){this._={output:[]};},proto:{openTag:function(l,m){this._.output.push('<',l);},openTagClose:function(l,m){if(m)this._.output.push(' />');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('</',l,'>');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('<!--',l,'-->');},write:function(l){this._.output.push(l);},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=e.createClass({base:d.node,$:function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);this.base(l);},proto:{type:8,getOuterHtml:function(){return '<!--'+this.$.nodeValue+'-->';}}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q<r;q++){var s=p.getItem(q);if(s.type==1&&f.$block[s.getName()])return true;}return false;};d.elementPath=function(o){var u=this;
k.setHtml(i);return k.getFirst().remove();};h.setMarker=function(i,j,k,l){var m=j.getCustomData('list_marker_id')||j.setCustomData('list_marker_id',e.getNextNumber()).getCustomData('list_marker_id'),n=j.getCustomData('list_marker_names')||j.setCustomData('list_marker_names',{}).getCustomData('list_marker_names');i[m]=j;n[k]=1;return j.setCustomData(k,l);};h.clearAllMarkers=function(i){for(var j in i)h.clearMarkers(i,i[j],true);};h.clearMarkers=function(i,j,k){var l=j.getCustomData('list_marker_names'),m=j.getCustomData('list_marker_id');for(var n in l)j.removeCustomData(n);j.removeCustomData('list_marker_names');if(k){j.removeCustomData('list_marker_id');delete i[m];}};e.extend(h.prototype,{type:1,addClass:function(i){var j=this.$.className;if(j){var k=new RegExp('(?:^|\\s)'+i+'(?:\\s|$)','');if(!k.test(j))j+=' '+i;}this.$.className=j||i;},removeClass:function(i){var j=this.getAttribute('class');if(j){var k=new RegExp('(?:^|\\s+)'+i+'(?=\\s|$)','i');if(k.test(j)){j=j.replace(k,'').replace(/^\s+/,'');if(j)this.setAttribute('class',j);else this.removeAttribute('class');}}},hasClass:function(i){var j=new RegExp('(?:^|\\s+)'+i+'(?=\\s|$)','');return j.test(this.getAttribute('class'));},append:function(i,j){var k=this;if(typeof i=='string')i=k.getDocument().createElement(i);if(j)k.$.insertBefore(i.$,k.$.firstChild);else k.$.appendChild(i.$);return i;},appendHtml:function(i){var k=this;if(!k.$.childNodes.length)k.setHtml(i);else{var j=new h('div',k.getDocument());j.setHtml(i);j.moveChildren(k);}},appendText:function(i){if(this.$.text!=undefined)this.$.text+=i;else this.append(new d.text(i));},appendBogus:function(){var k=this;var i=k.getLast();while(i&&i.type==3&&!e.rtrim(i.getText()))i=i.getPrevious();if(!i||!i.is||!i.is('br')){var j=b.opera?k.getDocument().createText(''):k.getDocument().createElement('br');b.gecko&&j.setAttribute('type','_moz');k.append(j);}},breakParent:function(i){var l=this;var j=new d.range(l.getDocument());j.setStartAfter(l);j.setEndAfter(i);var k=j.extractContents();j.insertNode(l.remove());k.insertAfterNode(l);},contains:c||b.webkit?function(i){var j=this.$;return i.type!=1?j.contains(i.getParent().$):j!=i.$&&j.contains(i.$);}:function(i){return!!(this.$.compareDocumentPosition(i.$)&16);},focus:function(){try{this.$.focus();}catch(i){}},getHtml:function(){var i=this.$.innerHTML;return c?i.replace(/<\?[^>]*>/g,''):i;},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,t,g){var n=this;this.getId=function(){return t};this.WT=a;this.marginH=function(d){var k=d.parentNode;return a.px(d,"marginLeft")+a.px(d,"marginRight")+a.px(d,"borderLeftWidth")+a.px(d,"borderRightWidth")+a.px(k,"paddingLeft")+a.px(k,"paddingRight")};this.marginV=function(d){return a.px(d,"marginTop")+a.px(d,"marginBottom")+a.px(d,"borderTopWidth")+a.px(d,"borderBottomWidth")+a.px(d,"paddingTop")+a.px(d,"paddingBottom")};this.adjustRow=function(d,k){if(d.style.height!=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,t,i){var o=this;this.getId=function(){return t};this.WT=a;this.marginH=function(d){var e=d.parentNode,g=a.px(d,"marginLeft");g+=a.px(d,"marginRight");g+=a.px(d,"borderLeftWidth");g+=a.px(d,"borderRightWidth");g+=a.px(e,"paddingLeft");g+=a.px(e,"paddingRight");return g};this.marginV=function(d){var e=a.px(d,"marginTop");e+=a.px(d,"marginBottom");e+=a.px(d,"borderTopWidth");e+=a.px(d,"borderBottomWidth");e+=a.px(d,"paddingTop");e+=a.px(d,"paddingBottom");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,t,g){var n=this;this.getId=function(){return t};this.WT=a;this.marginH=function(d){var k=d.parentNode;return a.px(d,"marginLeft")+a.px(d,"marginRight")+a.px(d,"borderLeftWidth")+a.px(d,"borderRightWidth")+a.px(k,"paddingLeft")+a.px(k,"paddingRight")};this.marginV=function(d){return a.px(d,"marginTop")+a.px(d,"marginBottom")+a.px(d,"borderTopWidth")+a.px(d,"borderBottomWidth")+a.px(d,"paddingTop")+a.px(d,"paddingBottom")};this.adjustRow=function(d,k){if(d.style.height!=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,i){var o=this;this.getId=function(){return s};this.WT=a;this.marginH=function(b){var f=b.parentNode,g=a.px(b,"marginLeft");g+=a.px(b,"marginRight");g+=a.px(b,"borderLeftWidth");g+=a.px(b,"borderRightWidth");g+=a.px(b,"paddingLeft");g+=a.px(b,"paddingRight");g+=a.pxself(f,"paddingLeft");g+=a.pxself(f,"paddingRight");return g};this.marginV=function(b){var f=a.px(b,"marginTop");f+=a.px(b,"marginBottom");f+=a.px(b,"borderTopWidth");f+=a.px(b,"borderBottomWidth");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,i){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var h=c.parentNode,g=a.px(c,"marginLeft");g+=a.px(c,"marginRight");g+=a.px(c,"borderLeftWidth");g+=a.px(c,"borderRightWidth");g+=a.px(h,"paddingLeft");g+=a.px(h,"paddingRight");return g};this.marginV=function(c){var h=a.px(c,"marginTop");h+=a.px(c,"marginBottom");h+=a.px(c,"borderTopWidth");h+=a.px(c,"borderBottomWidth");h+=a.px(c,"paddingTop");h+=a.px(c,"paddingBottom");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,i){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var h=c.parentNode,g=a.px(c,"marginLeft");g+=a.px(c,"marginRight");g+=a.px(c,"borderLeftWidth");g+=a.px(c,"borderRightWidth");g+=a.px(h,"paddingLeft");g+=a.px(h,"paddingRight");return g};this.marginV=function(c){var h=a.px(c,"marginTop");h+=a.px(c,"marginBottom");h+=a.px(c,"borderTopWidth");h+=a.px(c,"borderBottomWidth");h+=a.px(c,"paddingTop");h+=a.px(c,"paddingBottom");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,t,i){var o=this;this.getId=function(){return t};this.WT=a;this.marginH=function(d){var e=d.parentNode,h=a.px(d,"marginLeft");h+=a.px(d,"marginRight");h+=a.px(d,"borderLeftWidth");h+=a.px(d,"borderRightWidth");h+=a.px(e,"paddingLeft");h+=a.px(e,"paddingRight");return h};this.marginV=function(d){var e=a.px(d,"marginTop");e+=a.px(d,"marginBottom");e+=a.px(d,"borderTopWidth");e+=a.px(d,"borderBottomWidth");e+=a.px(d,"paddingTop");e+=a.px(d,"paddingBottom");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,i){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var h=c.parentNode,g=a.px(c,"marginLeft");g+=a.px(c,"marginRight");g+=a.px(c,"borderLeftWidth");g+=a.px(c,"borderRightWidth");g+=a.px(h,"paddingLeft");g+=a.px(h,"paddingRight");return g};this.marginV=function(c){var h=a.px(c,"marginTop");h+=a.px(c,"marginBottom");h+=a.px(c,"borderTopWidth");h+=a.px(c,"borderBottomWidth");h+=a.px(c,"paddingTop");h+=a.px(c,"paddingBottom");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,t,i){var o=this;this.getId=function(){return t};this.WT=a;this.marginH=function(d){var e=d.parentNode,h=a.px(d,"marginLeft");h+=a.px(d,"marginRight");h+=a.px(d,"borderLeftWidth");h+=a.px(d,"borderRightWidth");h+=a.px(e,"paddingLeft");h+=a.px(e,"paddingRight");return h};this.marginV=function(d){var e=a.px(d,"marginTop");e+=a.px(d,"marginBottom");e+=a.px(d,"borderTopWidth");e+=a.px(d,"borderBottomWidth");e+=a.px(d,"paddingTop");e+=a.px(d,"paddingBottom");
var t = event.target || event.srcElement;
var t = WT.target(event);
function getItem(event) { var columnId = -1, nodeId = null, selected = false, drop = false, ele = null; var t = event.target || event.srcElement; while (t) { if (t.className.indexOf('c1 rh') == 0) { if (columnId == -1) columnId = 0; } else if (t.className.indexOf('Wt-tv-c') == 0) { if (t.className.indexOf('Wt-tv-c') == 0) columnId = t.className.split(' ')[0].substring(7) * 1; else if (columnId == -1) columnId = 0; if (t.getAttribute('drop') === 'true') drop = true; ele = t; } else if (t.className == 'Wt-tv-node') { nodeId = t.id; break; } if (t.className === 'Wt-selected') selected = true; t = t.parentNode; if (WT.hasTag(t, 'BODY')) break; } return { columnId: columnId, nodeId: nodeId, selected: selected, drop: drop, el: ele }; };
var t = event.target || event.srcElement;
var t = WT.target(event);
function getItem(event) { var columnId = -1, rowIdx = -1, selected = false, drop = false, ele = null; var t = event.target || event.srcElement; while (t) { var $t = $(t); if ($t.hasClass('Wt-tv-contents')) { break; } else if ($t.hasClass('Wt-tv-c')) { if (t.getAttribute('drop') === 'true') drop = true; if ($t.hasClass('Wt-selected')) selected = true; ele = t; t = t.parentNode; columnId = t.className.split(' ')[0].substring(7) * 1; break; } t = t.parentNode; } return { columnId: columnId, rowIdx: rowIdx, selected: selected, drop: drop, el: ele }; };
delete u._.commands[A];}for(A in w){delete u._.menuItems[A];delete u._.commands[A];}v={};w={};var M=u.config.scayt_moreSuggestions||'on',N=false,O=u.config.scayt_maxSuggestions;typeof O!='number'&&(O=5);!O&&(O=L.length);var P=u.config.scayt_contextCommands||'all';P=P.split('|');for(var Q=0,R=L.length;Q<R;Q+=1){var S='scayt_suggestion_'+L[Q].replace(' ','_'),T=(function(X,Y){return{exec:function(){G.replace(X,Y);}};})(H,L[Q]);if(Q<O){s(u,'button_'+S,L[Q],S,T,'scayt_suggest',Q+1);K[S]=2;w[S]=2;}else if(M=='on'){s(u,'button_'+S,L[Q],S,T,'scayt_moresuggest',Q+1);v[S]=2;N=true;}}if(N){u.addMenuItem('scayt_moresuggest',{label:u.lang.scayt.moreSuggestions,group:'scayt_moresuggest',order:10,getItems:function(){return v;}});w.scayt_moresuggest=2;}if(p('all',P)||p('ignore',P)){var U={exec:function(){G.ignore(H);}};s(u,'ignore',u.lang.scayt.ignore,'scayt_ignore',U,'scayt_control',1);w.scayt_ignore=2;}if(p('all',P)||p('ignoreall',P)){var V={exec:function(){G.ignoreAll(H);}};s(u,'ignore_all',u.lang.scayt.ignoreAll,'scayt_ignore_all',V,'scayt_control',2);w.scayt_ignore_all=2;}if(p('all',P)||p('add',P)){var W={exec:function(){window.scayt.addWordToUserDictionary(H);}};s(u,'add_word',u.lang.scayt.addWord,'scayt_add_word',W,'scayt_control',3);w.scayt_add_word=2;}if(G.fireOnContextMenu)G.fireOnContextMenu(u);return w;});if(u.config.scayt_autoStartup){var F=function(){u.removeListener('showScaytState',F);x.setState(r.isScaytEnabled(u)?1:2);};u.on('showScaytState',F);u.on('instanceReady',function(){r.loadEngine(u);});}},afterInit:function(u){var v;if(u._.elementsPath&&(v=u._.elementsPath.filters))v.push(function(w){if(w.hasAttribute('scaytid'))return false;});}});})();j.add('smiley',{requires:['dialog'],init:function(l){l.config.smiley_path=l.config.smiley_path||this.path+'images/';l.addCommand('smiley',new a.dialogCommand('smiley'));l.ui.addButton('Smiley',{label:l.lang.smiley.toolbar,command:'smiley'});a.dialog.add('smiley',this.path+'dialogs/smiley.js');}});i.smiley_images=['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'];i.smiley_descriptions=['smiley','sad','wink','laugh','frown','cheeky','blush','surprise','indecision','angry','angle','cool','devil','crying','enlightened','no','yes','heart','broken heart','kiss','mail'];
u(I,true);}});F.addCommand('cellInsertAfter',{exec:function(H){var I=H.getSelection();u(I);}});if(F.addMenuItems)F.addMenuItems({tablecell:{label:G.cell.menu,group:'tablecell',order:1,getItems:function(){var H=F.getSelection(),I=n(H);return{tablecell_insertBefore:2,tablecell_insertAfter:2,tablecell_delete:2,tablecell_merge:B(H,null,true)?2:0,tablecell_merge_right:B(H,'right',true)?2:0,tablecell_merge_down:B(H,'down',true)?2:0,tablecell_split_vertical:C(H,true)?2:0,tablecell_split_horizontal:D(H,true)?2:0,tablecell_properties:I.length>0?2:0};}},tablecell_insertBefore:{label:G.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:G.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:G.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:G.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:G.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:G.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:G.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:G.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:G.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:G.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:G.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:G.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:G.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:G.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:G.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:G.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:G.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(F.contextMenu)F.contextMenu.addListener(function(H,I){if(!H)return null;while(H){if(H.getName() in E)return{tablecell:2,tablerow:2,tablecolumn:2};
delete u._.commands[A];}for(A in w){delete u._.menuItems[A];delete u._.commands[A];}v={};w={};var M=u.config.scayt_moreSuggestions||'on',N=false,O=u.config.scayt_maxSuggestions;typeof O!='number'&&(O=5);!O&&(O=L.length);var P=u.config.scayt_contextCommands||'all';P=P.split('|');for(var Q=0,R=L.length;Q<R;Q+=1){var S='scayt_suggestion_'+L[Q].replace(' ','_'),T=(function(X,Y){return{exec:function(){G.replace(X,Y);}};})(H,L[Q]);if(Q<O){s(u,'button_'+S,L[Q],S,T,'scayt_suggest',Q+1);K[S]=2;w[S]=2;}else if(M=='on'){s(u,'button_'+S,L[Q],S,T,'scayt_moresuggest',Q+1);v[S]=2;N=true;}}if(N){u.addMenuItem('scayt_moresuggest',{label:u.lang.scayt.moreSuggestions,group:'scayt_moresuggest',order:10,getItems:function(){return v;}});w.scayt_moresuggest=2;}if(p('all',P)||p('ignore',P)){var U={exec:function(){G.ignore(H);}};s(u,'ignore',u.lang.scayt.ignore,'scayt_ignore',U,'scayt_control',1);w.scayt_ignore=2;}if(p('all',P)||p('ignoreall',P)){var V={exec:function(){G.ignoreAll(H);}};s(u,'ignore_all',u.lang.scayt.ignoreAll,'scayt_ignore_all',V,'scayt_control',2);w.scayt_ignore_all=2;}if(p('all',P)||p('add',P)){var W={exec:function(){window.scayt.addWordToUserDictionary(H);}};s(u,'add_word',u.lang.scayt.addWord,'scayt_add_word',W,'scayt_control',3);w.scayt_add_word=2;}if(G.fireOnContextMenu)G.fireOnContextMenu(u);return w;});if(u.config.scayt_autoStartup){var F=function(){u.removeListener('showScaytState',F);x.setState(r.isScaytEnabled(u)?1:2);};u.on('showScaytState',F);u.on('instanceReady',function(){r.loadEngine(u);});}},afterInit:function(u){var v;if(u._.elementsPath&&(v=u._.elementsPath.filters))v.push(function(w){if(w.hasAttribute('scaytid'))return false;});}});})();j.add('smiley',{requires:['dialog'],init:function(l){l.config.smiley_path=l.config.smiley_path||this.path+'images/';l.addCommand('smiley',new a.dialogCommand('smiley'));l.ui.addButton('Smiley',{label:l.lang.smiley.toolbar,command:'smiley'});a.dialog.add('smiley',this.path+'dialogs/smiley.js');}});i.smiley_images=['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'];i.smiley_descriptions=['smiley','sad','wink','laugh','frown','cheeky','blush','surprise','indecision','angry','angle','cool','devil','crying','enlightened','no','yes','heart','broken heart','kiss','mail'];
(a=[]);b=this.fetchAsObject();)a.push(b);return a},fetchAllCustom:function(a,b){var d;for(a||(a=[]);d=this.fetchCustom(b);)a.push(d);return a},mapAsObject:function(a,b,d){var c,e;a=a;for(var f=0,g=b.length,i=g-1;f<g;f++){c=b[f];c=d[c];if(e=a[c])if(f===i)if(e instanceof Array)e.push(d);else a[c]=[e,d];else a=e;else if(f===i)a[c]=d;else a=a[c]={}}},mapAllAsObject:function(a,b){b||(b={});a||(a=this.getKey());for(var d;d=this.fetchAsObject();)this.mapAsObject(b,a,d);return b},getKey:function(){var a; return a=this._type?Xmla.Rowset.KEYS[this._type]:this.getFieldNames()}};Xmla.Exception=function(a,b,d,c,e,f){this.type=a;this.code=b;this.message=d;this.source=e;this.helpfile=c;this.data=f;return this};Xmla.Exception.TYPE_WARNING="warning";Xmla.Exception.TYPE_ERROR="error";var l="http:
for(a||(a=[]);b=this.fetchAsObject();)a.push(b);return a},fetchAllCustom:function(a,b){var d;for(a||(a=[]);d=this.fetchCustom(b);)a.push(d);return a},mapAsObject:function(a,b,d){var c,e,h=b.length,f=h-1,i=a;for(a=0;a<h;a+=1){c=b[a];c=d[c];if(e=i[c])if(a===f)if(e instanceof Array)e.push(d);else i[c]=[e,d];else i=e;else if(a===f)i[c]=d;else i=i[c]={}}},mapAllAsObject:function(a,b){b||(b={});a||(a=this.getKey());for(var d;d=this.fetchAsObject();)this.mapAsObject(b,a,d);return b},getKey:function(){var a; return a=this._type?Xmla.Rowset.KEYS[this._type]:this.getFieldNames()}};Xmla.Exception=function(a,b,d,c,e,h){this.type=a;this.code=b;this.message=d;this.source=e;this.helpfile=c;this.data=h;return this};Xmla.Exception.TYPE_WARNING="warning";Xmla.Exception.TYPE_ERROR="error";var m="http:
(a=[]);b=this.fetchAsObject();)a.push(b);return a},fetchAllCustom:function(a,b){var d;for(a||(a=[]);d=this.fetchCustom(b);)a.push(d);return a},mapAsObject:function(a,b,d){var c,e;a=a;for(var f=0,g=b.length,i=g-1;f<g;f++){c=b[f];c=d[c];if(e=a[c])if(f===i)if(e instanceof Array)e.push(d);else a[c]=[e,d];else a=e;else if(f===i)a[c]=d;else a=a[c]={}}},mapAllAsObject:function(a,b){b||(b={});a||(a=this.getKey());for(var d;d=this.fetchAsObject();)this.mapAsObject(b,a,d);return b},getKey:function(){var a;return a=this._type?Xmla.Rowset.KEYS[this._type]:this.getFieldNames()}};Xmla.Exception=function(a,b,d,c,e,f){this.type=a;this.code=b;this.message=d;this.source=e;this.helpfile=c;this.data=f;return this};Xmla.Exception.TYPE_WARNING="warning";Xmla.Exception.TYPE_ERROR="error";var l="http://code.google.com/p/xmla4js/wiki/ExceptionCodes";Xmla.Exception.MISSING_REQUEST_TYPE_CDE=-1;Xmla.Exception.MISSING_REQUEST_TYPE_MSG="Missing_Request_Type";Xmla.Exception.MISSING_REQUEST_TYPE_HLP=l+"#"+Xmla.Exception.MISSING_REQUEST_TYPE_CDE+
'__': 'dblflat'
'__': 'dblflat', '_/': 'quarterflat', '^/': 'quartersharp'
this.getKeyAccidental = function(str) { var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i)) return {len: 1, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default: return {len: 1, warn: 'Expected note name after accidental'}; } };
case '/':
this.getKeyAccidental = function(str) { var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i)) return {len: 1, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default: return {len: 1, warn: 'Expected note name after accidental'}; } };
var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat', '_/': 'quarterflat', '^/': 'quartersharp' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i))
var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat', '_/': 'quarterflat', '^/': 'quartersharp' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i)) return {len: 1, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': case '/': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default:
this.getKeyAccidental = function(str) { var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat', '_/': 'quarterflat', '^/': 'quartersharp' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i)) return {len: 1, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': case '/': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default: return {len: 1, warn: 'Expected note name after accidental'}; } };
switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': case '/': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default: return {len: 1, warn: 'Expected note name after accidental'}; } };
} };
this.getKeyAccidental = function(str) { var accTranslation = { '^': 'sharp', '^^': 'dblsharp', '=': 'natural', '_': 'flat', '__': 'dblflat', '_/': 'quarterflat', '^/': 'quartersharp' }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var acc = null; switch (str[i]) { case '^': case '_': case '=': acc = str[i]; break; default:return {len: 0}; } i++; if (finished(str, i)) return {len: 1, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; case '^': case '_': case '/': acc += str[i]; i++; if (finished(str, i)) return {len: 2, warn: 'Expected note name after accidental'}; switch (str[i]) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': return {len: i+1, token: {acc: accTranslation[acc], note: str[i]}}; default: return {len: 2, warn: 'Expected note name after accidental'}; } break; default: return {len: 1, warn: 'Expected note name after accidental'}; } };
var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; switch (str[i]) { case 'A':return {len: i+1, token: 'A'}; case 'B':return {len: i+1, token: 'B'}; case 'C':return {len: i+1, token: 'C'}; case 'D':return {len: i+1, token: 'D'}; case 'E':return {len: i+1, token: 'E'}; case 'F':return {len: i+1, token: 'F'}; case 'G':return {len: i+1, token: 'G'}; case 'a':return {len: i+1, token: 'A'}; case 'b':return {len: i+1, token: 'B'}; case 'c':return {len: i+1, token: 'C'}; case 'd':return {len: i+1, token: 'D'}; case 'e':return {len: i+1, token: 'E'}; case 'f':return {len: i+1, token: 'F'}; case 'g':return {len: i+1, token: 'G'}; }
var i = this.skipWhiteSpace(str); if (finished(str, i))
this.getKeyPitch = function(str) { var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; switch (str[i]) { case 'A':return {len: i+1, token: 'A'}; case 'B':return {len: i+1, token: 'B'}; case 'C':return {len: i+1, token: 'C'}; case 'D':return {len: i+1, token: 'D'}; case 'E':return {len: i+1, token: 'E'}; case 'F':return {len: i+1, token: 'F'}; case 'G':return {len: i+1, token: 'G'}; case 'a':return {len: i+1, token: 'A'}; case 'b':return {len: i+1, token: 'B'}; case 'c':return {len: i+1, token: 'C'}; case 'd':return {len: i+1, token: 'D'}; case 'e':return {len: i+1, token: 'E'}; case 'f':return {len: i+1, token: 'F'}; case 'g':return {len: i+1, token: 'G'}; } return {len: 0}; };
};
switch (str[i]) { case 'A':return {len: i+1, token: 'A'}; case 'B':return {len: i+1, token: 'B'}; case 'C':return {len: i+1, token: 'C'}; case 'D':return {len: i+1, token: 'D'}; case 'E':return {len: i+1, token: 'E'}; case 'F':return {len: i+1, token: 'F'}; case 'G':return {len: i+1, token: 'G'}; case 'a':return {len: i+1, token: 'A'}; case 'b':return {len: i+1, token: 'B'}; case 'c':return {len: i+1, token: 'C'}; case 'd':return {len: i+1, token: 'D'}; case 'e':return {len: i+1, token: 'E'}; case 'f':return {len: i+1, token: 'F'}; case 'g':return {len: i+1, token: 'G'}; } return {len: 0}; };
this.getKeyPitch = function(str) { var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; switch (str[i]) { case 'A':return {len: i+1, token: 'A'}; case 'B':return {len: i+1, token: 'B'}; case 'C':return {len: i+1, token: 'C'}; case 'D':return {len: i+1, token: 'D'}; case 'E':return {len: i+1, token: 'E'}; case 'F':return {len: i+1, token: 'F'}; case 'G':return {len: i+1, token: 'G'}; case 'a':return {len: i+1, token: 'A'}; case 'b':return {len: i+1, token: 'B'}; case 'c':return {len: i+1, token: 'C'}; case 'd':return {len: i+1, token: 'D'}; case 'e':return {len: i+1, token: 'E'}; case 'f':return {len: i+1, token: 'F'}; case 'g':return {len: i+1, token: 'G'}; } return {len: 0}; };
getLastNote: function() {
this.getLastNote = function() {
getLastNote: function() { if (this.lines[this.lineNum] && this.lines[this.lineNum].staff && this.lines[this.lineNum].staff[this.staffNum] && this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum]) { for (var i = this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum].length-1; i >= 0; i--) { var el = this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum][i]; if (el.el_type === 'note') { return el; } } } return null; },
},
};
getLastNote: function() { if (this.lines[this.lineNum] && this.lines[this.lineNum].staff && this.lines[this.lineNum].staff[this.staffNum] && this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum]) { for (var i = this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum].length-1; i >= 0; i--) { var el = this.lines[this.lineNum].staff[this.staffNum].voices[this.voiceNum][i]; if (el.el_type === 'note') { return el; } } } return null; },
for (var i=0;i<t.length;i++){a[a.length]=$id(t[i]);};
for (var i=0;i<t.length;i++){a[a.length]=$id(t[i]);}
acl.getManyElements=function(s){ t=s.split(','); a=[]; for (var i=0;i<t.length;i++){a[a.length]=$id(t[i]);}; return a;};
case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 };
case 'cm': return { used: used+1, value: parseFloat(num)/2.54*72 };
this.getMeasurement = function(tokens) { if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; if (tokens.length === 0) return { used: used, value: parseFloat(num) }; } x = tokens.shift(); } switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift();
this.getMeasurement = function(tokens) { if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; } } if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') {
if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token;
this.getMeasurement = function(tokens) { if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; } } if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; }
this.getMeasurement = function(tokens) { if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; } } if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
} if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
this.getMeasurement = function(tokens) { if (tokens.length === 0) return { used: 0 }; if (tokens[0].type !== 'number') return { used: 0 }; var num = tokens.shift().token; if (tokens.length === 0) return { used: 1, value: parseInt(num) }; var x = tokens.shift(); var used = 1; if (x.token === '.') { used++; if (tokens.length === 0) return { used: used, value: parseInt(num) }; if (tokens[0].type === 'number') { x = tokens.shift(); num = num + '.' + x.token; used++; } } if (tokens.length === 0) return { used: used, value: parseFloat(num) }; x = tokens.shift(); switch (x.token) { case 'pt': return { used: used+1, value: parseFloat(num) }; case 'cm': return { used: used+1, value: parseFloat(num)*72*2.54 }; case 'in': return { used: used+1, value: parseFloat(num)*72 }; } return { used: 0 }; };
while (start < end && (line[start] === ' ' || line[start] === 't' || line[start] === '\x12'))
while (start < end && (line[start] === ' ' || line[start] === '\t' || line[start] === '\x12'))
this.getMeat = function(line, start, end) { // This removes any comments starting with '%' and trims the ends of the string so that there are no leading or trailing spaces. // it returns just the start and end characters that contain the meat. var comment = line.indexOf('%', start); if (comment >= 0 && comment < end) end = comment; while (start < end && (line[start] === ' ' || line[start] === 't' || line[start] === '\x12')) start++; while (start < end && (line[end-1] === ' ' || line[end-1] === 't' || line[end-1] === '\x12')) end--; return {start: start, end: end}; };
while (start < end && (line[end-1] === ' ' || line[end-1] === 't' || line[end-1] === '\x12'))
while (start < end && (line[end-1] === ' ' || line[end-1] === '\t' || line[end-1] === '\x12'))
this.getMeat = function(line, start, end) { // This removes any comments starting with '%' and trims the ends of the string so that there are no leading or trailing spaces. // it returns just the start and end characters that contain the meat. var comment = line.indexOf('%', start); if (comment >= 0 && comment < end) end = comment; while (start < end && (line[start] === ' ' || line[start] === 't' || line[start] === '\x12')) start++; while (start < end && (line[end-1] === ' ' || line[end-1] === 't' || line[end-1] === '\x12')) end--; return {start: start, end: end}; };
if (firstThree.length > 1 && firstThree[1] === ' ') firstThree = firstThree[0];
if (firstThree.length > 1 && firstThree[1] === ' ' || firstThree[1] === '^' || firstThree[1] === '_' || firstThree[1] === '=') firstThree = firstThree[0];
this.getMode = function(str) { var skipAlpha = function(str, start) { // This returns the index of the next non-alphabetic char, or the entire length of the string if not found. while (start < str.length && ((str[start] >= 'a' && str[start] <= 'z') || (str[start] >= 'A' && str[start] <= 'Z'))) start++; return start; }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree[1] === ' ') firstThree = firstThree[0]; // This will handle the case of 'm' switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; } return {len: 0}; };
if (firstThree.length > 1 && firstThree.charAt(1) === ' ' || firstThree.charAt(1) === '^' || firstThree.charAt(1) === '_' || firstThree.charAt(1) === '=') firstThree = firstThree.charAt(1);
if (firstThree.length > 1 && firstThree.charAt(1) === ' ' || firstThree.charAt(1) === '^' || firstThree.charAt(1) === '_' || firstThree.charAt(1) === '=') firstThree = firstThree.charAt(0);
this.getMode = function(str) { var skipAlpha = function(str, start) { // This returns the index of the next non-alphabetic char, or the entire length of the string if not found. while (start < str.length && ((str.charAt(start) >= 'a' && str.charAt(start) <= 'z') || (str.charAt(start) >= 'A' && str.charAt(start) <= 'Z'))) start++; return start; }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree.charAt(1) === ' ' || firstThree.charAt(1) === '^' || firstThree.charAt(1) === '_' || firstThree.charAt(1) === '=') firstThree = firstThree.charAt(1); // This will handle the case of 'm' switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; } return {len: 0}; };
var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree[1] === ' ' || firstThree[1] === '^' || firstThree[1] === '_' || firstThree[1] === '=') firstThree = firstThree[0]; switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; }
var i = this.skipWhiteSpace(str); if (finished(str, i))
this.getMode = function(str) { var skipAlpha = function(str, start) { // This returns the index of the next non-alphabetic char, or the entire length of the string if not found. while (start < str.length && ((str[start] >= 'a' && str[start] <= 'z') || (str[start] >= 'A' && str[start] <= 'Z'))) start++; return start; }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree[1] === ' ' || firstThree[1] === '^' || firstThree[1] === '_' || firstThree[1] === '=') firstThree = firstThree[0]; // This will handle the case of 'm' switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; } return {len: 0}; };
};
var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree[1] === ' ' || firstThree[1] === '^' || firstThree[1] === '_' || firstThree[1] === '=') firstThree = firstThree[0]; switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; } return {len: 0}; };
this.getMode = function(str) { var skipAlpha = function(str, start) { // This returns the index of the next non-alphabetic char, or the entire length of the string if not found. while (start < str.length && ((str[start] >= 'a' && str[start] <= 'z') || (str[start] >= 'A' && str[start] <= 'Z'))) start++; return start; }; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; var firstThree = str.substring(i,i+3).toLowerCase(); if (firstThree.length > 1 && firstThree[1] === ' ' || firstThree[1] === '^' || firstThree[1] === '_' || firstThree[1] === '=') firstThree = firstThree[0]; // This will handle the case of 'm' switch (firstThree) { case 'mix':return {len: skipAlpha(str, i), token: 'Mix'}; case 'dor':return {len: skipAlpha(str, i), token: 'Dor'}; case 'phr':return {len: skipAlpha(str, i), token: 'Phr'}; case 'lyd':return {len: skipAlpha(str, i), token: 'Lyd'}; case 'loc':return {len: skipAlpha(str, i), token: 'Loc'}; case 'aeo':return {len: skipAlpha(str, i), token: 'm'}; case 'maj':return {len: skipAlpha(str, i), token: ''}; case 'ion':return {len: skipAlpha(str, i), token: ''}; case 'min':return {len: skipAlpha(str, i), token: 'm'}; case 'm':return {len: skipAlpha(str, i), token: 'm'}; } return {len: 0}; };
if (!e) var e = window.event;
if (!e) {e = window.event;}
acl.getMousePosition=function(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY){ posx = e.clientX + (document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft); posy = e.clientY + (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop); } return {left:posx, top:posy};};
a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1)return;l.removeAttribute('id',false);l.removeAttribute('_cke_expando',false);var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);};k(j);}return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;if(l){for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(o==k)break;}i.unshift(m);}k=l;}return i;},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h;})();},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h)return j;i=i.nextSibling;}return-1;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j; },getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}}});d.nodeList=function(h){this.$=h;};d.nodeList.prototype={count:function(){return this.$.length;},getItem:function(h){var i=this.$[h];return i?new d.node(i):null;}};d.element=function(h,i){if(typeof h=='string')h=(i?i.$:document).createElement(h);d.domObject.call(this,h);};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i));};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h('div',j);
},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}},isReadOnly:function(){var h=this;while(h){if(h.type==1){if(h.is('body')||h.getCustomData('_cke_notReadOnly'))break;if(h.getAttribute('contentEditable')=='false')return h;else if(h.getAttribute('contentEditable')=='true')break;}h=h.getParent();}return false;}});d.nodeList=function(h){this.$=h;
a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1)return;l.removeAttribute('id',false);l.removeAttribute('_cke_expando',false);var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);};k(j);}return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;if(l){for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(o==k)break;}i.unshift(m);}k=l;}return i;},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h;})();},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h)return j;i=i.nextSibling;}return-1;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}}});d.nodeList=function(h){this.$=h;};d.nodeList.prototype={count:function(){return this.$.length;},getItem:function(h){var i=this.$[h];return i?new d.node(i):null;}};d.element=function(h,i){if(typeof h=='string')h=(i?i.$:document).createElement(h);d.domObject.call(this,h);};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i));};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h('div',j);
var num = 0; while (index < line.length) { switch (line[index]) { case '0':num = num*10;index++;break; case '1':num = num*10+1;index++;break; case '2':num = num*10+2;index++;break; case '3':num = num*10+3;index++;break; case '4':num = num*10+4;index++;break; case '5':num = num*10+5;index++;break; case '6':num = num*10+6;index++;break; case '7':num = num*10+7;index++;break; case '8':num = num*10+8;index++;break; case '9':num = num*10+9;index++;break; default: return {num: num, index: index}; }
var num = 0; while (index < line.length) { switch (line[index]) { case '0':num = num*10;index++;break; case '1':num = num*10+1;index++;break; case '2':num = num*10+2;index++;break; case '3':num = num*10+3;index++;break; case '4':num = num*10+4;index++;break; case '5':num = num*10+5;index++;break; case '6':num = num*10+6;index++;break; case '7':num = num*10+7;index++;break; case '8':num = num*10+8;index++;break; case '9':num = num*10+9;index++;break; default: return {num: num, index: index};
var getNumber = function(line, index) { var num = 0; while (index < line.length) { switch (line[index]) { case '0':num = num*10;index++;break; case '1':num = num*10+1;index++;break; case '2':num = num*10+2;index++;break; case '3':num = num*10+3;index++;break; case '4':num = num*10+4;index++;break; case '5':num = num*10+5;index++;break; case '6':num = num*10+6;index++;break; case '7':num = num*10+7;index++;break; case '8':num = num*10+8;index++;break; case '9':num = num*10+9;index++;break; default: return {num: num, index: index}; } } return {num: num, index: index}; };
return {num: num, index: index}; };
} return {num: num, index: index}; };
var getNumber = function(line, index) { var num = 0; while (index < line.length) { switch (line[index]) { case '0':num = num*10;index++;break; case '1':num = num*10+1;index++;break; case '2':num = num*10+2;index++;break; case '3':num = num*10+3;index++;break; case '4':num = num*10+4;index++;break; case '5':num = num*10+5;index++;break; case '6':num = num*10+6;index++;break; case '7':num = num*10+7;index++;break; case '8':num = num*10+8;index++;break; case '9':num = num*10+9;index++;break; default: return {num: num, index: index}; } } return {num: num, index: index}; };
getNumLines: function() {
this.getNumLines = function() {
getNumLines: function() { return this.lines.length; },
},
};
getNumLines: function() { return this.lines.length; },
if (!component)
if (!component) {
function getOPeNDAPParameters() { //Generates parameters recursively //as an array of constraints var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; }; var frm = Ext.getCmp('opendapDownloadFrm'); var params = '&opendapUrl=' + escape(Ext.getCmp('opendapUrl').value); //Generate constraints component var variableConstraints = []; for (var i = 0; i < frm.items.getCount(); i++) { var component = frm.items.get(i); if (component && !component.disabled) { var constraint = generateConstraints(component); if (constraint) variableConstraints.push(constraint); } } var constraintObj = { constraints : variableConstraints }; params += '&constraints=' + escape(Ext.util.JSON.encode(constraintObj)); params += '&downloadFormat=' + escape(Ext.getCmp('opendap-format').value); return params;}
obj['dimensionBounds'] = {
obj.dimensionBounds = {
function getOPeNDAPParameters() { //Generates parameters recursively //as an array of constraints var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; }; var frm = Ext.getCmp('opendapDownloadFrm'); var params = '&opendapUrl=' + escape(Ext.getCmp('opendapUrl').value); //Generate constraints component var variableConstraints = []; for (var i = 0; i < frm.items.getCount(); i++) { var component = frm.items.get(i); if (component && !component.disabled) { var constraint = generateConstraints(component); if (constraint) variableConstraints.push(constraint); } } var constraintObj = { constraints : variableConstraints }; params += '&constraints=' + escape(Ext.util.JSON.encode(constraintObj)); params += '&downloadFormat=' + escape(Ext.getCmp('opendap-format').value); return params;}
obj['valueBounds'] = {
obj.valueBounds = {
function getOPeNDAPParameters() { //Generates parameters recursively //as an array of constraints var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; }; var frm = Ext.getCmp('opendapDownloadFrm'); var params = '&opendapUrl=' + escape(Ext.getCmp('opendapUrl').value); //Generate constraints component var variableConstraints = []; for (var i = 0; i < frm.items.getCount(); i++) { var component = frm.items.get(i); if (component && !component.disabled) { var constraint = generateConstraints(component); if (constraint) variableConstraints.push(constraint); } } var constraintObj = { constraints : variableConstraints }; params += '&constraints=' + escape(Ext.util.JSON.encode(constraintObj)); params += '&downloadFormat=' + escape(Ext.getCmp('opendap-format').value); return params;}
if (child)
if (child) {
function getOPeNDAPParameters() { //Generates parameters recursively //as an array of constraints var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; }; var frm = Ext.getCmp('opendapDownloadFrm'); var params = '&opendapUrl=' + escape(Ext.getCmp('opendapUrl').value); //Generate constraints component var variableConstraints = []; for (var i = 0; i < frm.items.getCount(); i++) { var component = frm.items.get(i); if (component && !component.disabled) { var constraint = generateConstraints(component); if (constraint) variableConstraints.push(constraint); } } var constraintObj = { constraints : variableConstraints }; params += '&constraints=' + escape(Ext.util.JSON.encode(constraintObj)); params += '&downloadFormat=' + escape(Ext.getCmp('opendap-format').value); return params;}
if (constraint)
if (constraint) {
function getOPeNDAPParameters() { //Generates parameters recursively //as an array of constraints var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; }; var frm = Ext.getCmp('opendapDownloadFrm'); var params = '&opendapUrl=' + escape(Ext.getCmp('opendapUrl').value); //Generate constraints component var variableConstraints = []; for (var i = 0; i < frm.items.getCount(); i++) { var component = frm.items.get(i); if (component && !component.disabled) { var constraint = generateConstraints(component); if (constraint) variableConstraints.push(constraint); } } var constraintObj = { constraints : variableConstraints }; params += '&constraints=' + escape(Ext.util.JSON.encode(constraintObj)); params += '&downloadFormat=' + escape(Ext.getCmp('opendap-format').value); return params;}