code
stringlengths
501
5.19M
package
stringlengths
2
81
path
stringlengths
9
304
filename
stringlengths
4
145
(function( $ ) { function UTCDate(){ return new Date(Date.UTC.apply(Date, arguments)); } function UTCToday(){ var today = new Date(); return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()); } // Picker object var Datepicker = function(element, options) { var that = this; this._process_options(options); this.element = $(element); this.isInline = false; this.isInput = this.element.is('input'); this.component = this.element.is('.date') ? this.element.find('.add-on, .btn') : false; this.hasInput = this.component && this.element.find('input').length; if(this.component && this.component.length === 0) this.component = false; this.picker = $(DPGlobal.template); this._buildEvents(); this._attachEvents(); if(this.isInline) { this.picker.addClass('datepicker-inline').appendTo(this.element); } else { this.picker.addClass('datepicker-dropdown dropdown-menu'); } if (this.o.rtl){ this.picker.addClass('datepicker-rtl'); this.picker.find('.prev i, .next i') .toggleClass('icon-arrow-left icon-arrow-right'); } this.viewMode = this.o.startView; if (this.o.calendarWeeks) this.picker.find('tfoot th.today') .attr('colspan', function(i, val){ return parseInt(val) + 1; }); this._allow_update = false; this.setStartDate(this.o.startDate); this.setEndDate(this.o.endDate); this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled); this.fillDow(); this.fillMonths(); this._allow_update = true; this.update(); this.showMode(); if(this.isInline) { this.show(); } }; Datepicker.prototype = { constructor: Datepicker, _process_options: function(opts){ // Store raw options for reference this._o = $.extend({}, this._o, opts); // Processed options var o = this.o = $.extend({}, this._o); // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" var lang = o.language; if (!dates[lang]) { lang = lang.split('-')[0]; if (!dates[lang]) lang = $.fn.datepicker.defaults.language; } o.language = lang; switch(o.startView){ case 2: case 'decade': o.startView = 2; break; case 1: case 'year': o.startView = 1; break; default: o.startView = 0; } switch (o.minViewMode) { case 1: case 'months': o.minViewMode = 1; break; case 2: case 'years': o.minViewMode = 2; break; default: o.minViewMode = 0; } o.startView = Math.max(o.startView, o.minViewMode); o.weekStart %= 7; o.weekEnd = ((o.weekStart + 6) % 7); var format = DPGlobal.parseFormat(o.format) if (o.startDate !== -Infinity) { o.startDate = DPGlobal.parseDate(o.startDate, format, o.language); } if (o.endDate !== Infinity) { o.endDate = DPGlobal.parseDate(o.endDate, format, o.language); } o.daysOfWeekDisabled = o.daysOfWeekDisabled||[]; if (!$.isArray(o.daysOfWeekDisabled)) o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/); o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function (d) { return parseInt(d, 10); }); }, _events: [], _secondaryEvents: [], _applyEvents: function(evs){ for (var i=0, el, ev; i<evs.length; i++){ el = evs[i][0]; ev = evs[i][1]; el.on(ev); } }, _unapplyEvents: function(evs){ for (var i=0, el, ev; i<evs.length; i++){ el = evs[i][0]; ev = evs[i][1]; el.off(ev); } }, _buildEvents: function(){ if (this.isInput) { // single input this._events = [ [this.element, { focus: $.proxy(this.show, this), keyup: $.proxy(this.update, this), keydown: $.proxy(this.keydown, this) }] ]; } else if (this.component && this.hasInput){ // component: input + button this._events = [ // For components that are not readonly, allow keyboard nav [this.element.find('input'), { focus: $.proxy(this.show, this), keyup: $.proxy(this.update, this), keydown: $.proxy(this.keydown, this) }], [this.component, { click: $.proxy(this.show, this) }] ]; } else if (this.element.is('div')) { // inline datepicker this.isInline = true; } else { this._events = [ [this.element, { click: $.proxy(this.show, this) }] ]; } this._secondaryEvents = [ [this.picker, { click: $.proxy(this.click, this) }], [$(window), { resize: $.proxy(this.place, this) }], [$(document), { mousedown: $.proxy(function (e) { // Clicked outside the datepicker, hide it if (!( this.element.is(e.target) || this.element.find(e.target).size() || this.picker.is(e.target) || this.picker.find(e.target).size() )) { this.hide(); } }, this) }] ]; }, _attachEvents: function(){ this._detachEvents(); this._applyEvents(this._events); }, _detachEvents: function(){ this._unapplyEvents(this._events); }, _attachSecondaryEvents: function(){ this._detachSecondaryEvents(); this._applyEvents(this._secondaryEvents); }, _detachSecondaryEvents: function(){ this._unapplyEvents(this._secondaryEvents); }, _trigger: function(event, altdate){ var date = altdate || this.date, local_date = new Date(date.getTime() + (date.getTimezoneOffset()*60000)); this.element.trigger({ type: event, date: local_date, format: $.proxy(function(altformat){ var format = altformat || this.o.format; return DPGlobal.formatDate(date, format, this.o.language); }, this) }); }, show: function(e) { if (!this.isInline) this.picker.appendTo('body'); this.picker.show(); this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); this.place(); this._attachSecondaryEvents(); if (e) { e.preventDefault(); } this._trigger('show'); }, hide: function(e){ if(this.isInline) return; if (!this.picker.is(':visible')) return; this.picker.hide().detach(); this._detachSecondaryEvents(); this.viewMode = this.o.startView; this.showMode(); if ( this.o.forceParse && ( this.isInput && this.element.val() || this.hasInput && this.element.find('input').val() ) ) this.setValue(); this._trigger('hide'); }, remove: function() { this.hide(); this._detachEvents(); this._detachSecondaryEvents(); this.picker.remove(); delete this.element.data().datepicker; if (!this.isInput) { delete this.element.data().date; } }, getDate: function() { var d = this.getUTCDate(); return new Date(d.getTime() + (d.getTimezoneOffset()*60000)); }, getUTCDate: function() { return this.date; }, setDate: function(d) { this.setUTCDate(new Date(d.getTime() - (d.getTimezoneOffset()*60000))); }, setUTCDate: function(d) { this.date = d; this.setValue(); }, setValue: function() { var formatted = this.getFormattedDate(); if (!this.isInput) { if (this.component){ this.element.find('input').val(formatted); } } else { this.element.val(formatted); } }, getFormattedDate: function(format) { if (format === undefined) format = this.o.format; return DPGlobal.formatDate(this.date, format, this.o.language); }, setStartDate: function(startDate){ this._process_options({startDate: startDate}); this.update(); this.updateNavArrows(); }, setEndDate: function(endDate){ this._process_options({endDate: endDate}); this.update(); this.updateNavArrows(); }, setDaysOfWeekDisabled: function(daysOfWeekDisabled){ this._process_options({daysOfWeekDisabled: daysOfWeekDisabled}); this.update(); this.updateNavArrows(); }, place: function(){ if(this.isInline) return; var zIndex = parseInt(this.element.parents().filter(function() { return $(this).css('z-index') != 'auto'; }).first().css('z-index'))+10; var offset = this.component ? this.component.parent().offset() : this.element.offset(); var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(true); this.picker.css({ top: offset.top + height, left: offset.left, zIndex: zIndex }); }, _allow_update: true, update: function(){ if (!this._allow_update) return; var date, fromArgs = false; if(arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) { date = arguments[0]; fromArgs = true; } else { date = this.isInput ? this.element.val() : this.element.data('date') || this.element.find('input').val(); delete this.element.data().date; } this.date = DPGlobal.parseDate(date, this.o.format, this.o.language); if(fromArgs) this.setValue(); if (this.date < this.o.startDate) { this.viewDate = new Date(this.o.startDate); } else if (this.date > this.o.endDate) { this.viewDate = new Date(this.o.endDate); } else { this.viewDate = new Date(this.date); } this.fill(); }, fillDow: function(){ var dowCnt = this.o.weekStart, html = '<tr>'; if(this.o.calendarWeeks){ var cell = '<th class="cw">&nbsp;</th>'; html += cell; this.picker.find('.datepicker-days thead tr:first-child').prepend(cell); } while (dowCnt < this.o.weekStart + 7) { html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>'; } html += '</tr>'; this.picker.find('.datepicker-days thead').append(html); }, fillMonths: function(){ var html = '', i = 0; while (i < 12) { html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>'; } this.picker.find('.datepicker-months td').html(html); }, setRange: function(range){ if (!range || !range.length) delete this.range; else this.range = $.map(range, function(d){ return d.valueOf(); }); this.fill(); }, getClassNames: function(date){ var cls = [], year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(), currentDate = this.date.valueOf(), today = new Date(); if (date.getUTCFullYear() < year || (date.getUTCFullYear() == year && date.getUTCMonth() < month)) { cls.push('old'); } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() == year && date.getUTCMonth() > month)) { cls.push('new'); } // Compare internal UTC date with local today, not UTC today if (this.o.todayHighlight && date.getUTCFullYear() == today.getFullYear() && date.getUTCMonth() == today.getMonth() && date.getUTCDate() == today.getDate()) { cls.push('today'); } if (currentDate && date.valueOf() == currentDate) { cls.push('active'); } if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate || $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1) { cls.push('disabled'); } if (this.range){ if (date > this.range[0] && date < this.range[this.range.length-1]){ cls.push('range'); } if ($.inArray(date.valueOf(), this.range) != -1){ cls.push('selected'); } } return cls; }, fill: function() { var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, currentDate = this.date && this.date.valueOf(), tooltip; this.picker.find('.datepicker-days thead th.datepicker-switch') .text(dates[this.o.language].months[month]+' '+year); this.picker.find('tfoot th.today') .text(dates[this.o.language].today) .toggle(this.o.todayBtn !== false); this.picker.find('tfoot th.clear') .text(dates[this.o.language].clear) .toggle(this.o.clearBtn !== false); this.updateNavArrows(); this.fillMonths(); var prevMonth = UTCDate(year, month-1, 28,0,0,0,0), day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth()); prevMonth.setUTCDate(day); prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7); var nextMonth = new Date(prevMonth); nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); nextMonth = nextMonth.valueOf(); var html = []; var clsName; while(prevMonth.valueOf() < nextMonth) { if (prevMonth.getUTCDay() == this.o.weekStart) { html.push('<tr>'); if(this.o.calendarWeeks){ // ISO 8601: First week contains first thursday. // ISO also states week starts on Monday, but we can be more abstract here. var // Start of current week: based on weekstart/current date ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5), // Thursday of this week th = new Date(+ws + (7 + 4 - ws.getUTCDay()) % 7 * 864e5), // First Thursday of year, year from thursday yth = new Date(+(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5), // Calendar week: ms between thursdays, div ms per day, div 7 days calWeek = (th - yth) / 864e5 / 7 + 1; html.push('<td class="cw">'+ calWeek +'</td>'); } } clsName = this.getClassNames(prevMonth); clsName.push('day'); var before = this.o.beforeShowDay(prevMonth); if (before === undefined) before = {}; else if (typeof(before) === 'boolean') before = {enabled: before}; else if (typeof(before) === 'string') before = {classes: before}; if (before.enabled === false) clsName.push('disabled'); if (before.classes) clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; clsName = $.unique(clsName); html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>'); if (prevMonth.getUTCDay() == this.o.weekEnd) { html.push('</tr>'); } prevMonth.setUTCDate(prevMonth.getUTCDate()+1); } this.picker.find('.datepicker-days tbody').empty().append(html.join('')); var currentYear = this.date && this.date.getUTCFullYear(); var months = this.picker.find('.datepicker-months') .find('th:eq(1)') .text(year) .end() .find('span').removeClass('active'); if (currentYear && currentYear == year) { months.eq(this.date.getUTCMonth()).addClass('active'); } if (year < startYear || year > endYear) { months.addClass('disabled'); } if (year == startYear) { months.slice(0, startMonth).addClass('disabled'); } if (year == endYear) { months.slice(endMonth+1).addClass('disabled'); } html = ''; year = parseInt(year/10, 10) * 10; var yearCont = this.picker.find('.datepicker-years') .find('th:eq(1)') .text(year + '-' + (year + 9)) .end() .find('td'); year -= 1; for (var i = -1; i < 11; i++) { html += '<span class="year'+(i == -1 ? ' old' : i == 10 ? ' new' : '')+(currentYear == year ? ' active' : '')+(year < startYear || year > endYear ? ' disabled' : '')+'">'+year+'</span>'; year += 1; } yearCont.html(html); }, updateNavArrows: function() { if (!this._allow_update) return; var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(); switch (this.viewMode) { case 0: if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; case 1: case 2: if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; } }, click: function(e) { e.preventDefault(); var target = $(e.target).closest('span, td, th'); if (target.length == 1) { switch(target[0].nodeName.toLowerCase()) { case 'th': switch(target[0].className) { case 'datepicker-switch': this.showMode(1); break; case 'prev': case 'next': var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1); switch(this.viewMode){ case 0: this.viewDate = this.moveMonth(this.viewDate, dir); break; case 1: case 2: this.viewDate = this.moveYear(this.viewDate, dir); break; } this.fill(); break; case 'today': var date = new Date(); date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); this.showMode(-2); var which = this.o.todayBtn == 'linked' ? null : 'view'; this._setDate(date, which); break; case 'clear': var element; if (this.isInput) element = this.element; else if (this.component) element = this.element.find('input'); if (element) element.val("").change(); this._trigger('changeDate'); this.update(); if (this.o.autoclose) this.hide(); break; } break; case 'span': if (!target.is('.disabled')) { this.viewDate.setUTCDate(1); if (target.is('.month')) { var day = 1; var month = target.parent().find('span').index(target); var year = this.viewDate.getUTCFullYear(); this.viewDate.setUTCMonth(month); this._trigger('changeMonth', this.viewDate); if (this.o.minViewMode === 1) { this._setDate(UTCDate(year, month, day,0,0,0,0)); } } else { var year = parseInt(target.text(), 10)||0; var day = 1; var month = 0; this.viewDate.setUTCFullYear(year); this._trigger('changeYear', this.viewDate); if (this.o.minViewMode === 2) { this._setDate(UTCDate(year, month, day,0,0,0,0)); } } this.showMode(-1); this.fill(); } break; case 'td': if (target.is('.day') && !target.is('.disabled')){ var day = parseInt(target.text(), 10)||1; var year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(); if (target.is('.old')) { if (month === 0) { month = 11; year -= 1; } else { month -= 1; } } else if (target.is('.new')) { if (month == 11) { month = 0; year += 1; } else { month += 1; } } this._setDate(UTCDate(year, month, day,0,0,0,0)); } break; } } }, _setDate: function(date, which){ if (!which || which == 'date') this.date = new Date(date); if (!which || which == 'view') this.viewDate = new Date(date); this.fill(); this.setValue(); this._trigger('changeDate'); var element; if (this.isInput) { element = this.element; } else if (this.component){ element = this.element.find('input'); } if (element) { element.change(); if (this.o.autoclose && (!which || which == 'date')) { this.hide(); } } }, moveMonth: function(date, dir){ if (!dir) return date; var new_date = new Date(date.valueOf()), day = new_date.getUTCDate(), month = new_date.getUTCMonth(), mag = Math.abs(dir), new_month, test; dir = dir > 0 ? 1 : -1; if (mag == 1){ test = dir == -1 // If going back one month, make sure month is not current month // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) ? function(){ return new_date.getUTCMonth() == month; } // If going forward one month, make sure month is as expected // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) : function(){ return new_date.getUTCMonth() != new_month; }; new_month = month + dir; new_date.setUTCMonth(new_month); // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 if (new_month < 0 || new_month > 11) new_month = (new_month + 12) % 12; } else { // For magnitudes >1, move one month at a time... for (var i=0; i<mag; i++) // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... new_date = this.moveMonth(new_date, dir); // ...then reset the day, keeping it in the new month new_month = new_date.getUTCMonth(); new_date.setUTCDate(day); test = function(){ return new_month != new_date.getUTCMonth(); }; } // Common date-resetting loop -- if date is beyond end of month, make it // end of month while (test()){ new_date.setUTCDate(--day); new_date.setUTCMonth(new_month); } return new_date; }, moveYear: function(date, dir){ return this.moveMonth(date, dir*12); }, dateWithinRange: function(date){ return date >= this.o.startDate && date <= this.o.endDate; }, keydown: function(e){ if (this.picker.is(':not(:visible)')){ if (e.keyCode == 27) // allow escape to hide and re-show picker this.show(); return; } var dateChanged = false, dir, day, month, newDate, newViewDate; switch(e.keyCode){ case 27: // escape this.hide(); e.preventDefault(); break; case 37: // left case 39: // right if (!this.o.keyboardNavigation) break; dir = e.keyCode == 37 ? -1 : 1; if (e.ctrlKey){ newDate = this.moveYear(this.date, dir); newViewDate = this.moveYear(this.viewDate, dir); } else if (e.shiftKey){ newDate = this.moveMonth(this.date, dir); newViewDate = this.moveMonth(this.viewDate, dir); } else { newDate = new Date(this.date); newDate.setUTCDate(this.date.getUTCDate() + dir); newViewDate = new Date(this.viewDate); newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir); } if (this.dateWithinRange(newDate)){ this.date = newDate; this.viewDate = newViewDate; this.setValue(); this.update(); e.preventDefault(); dateChanged = true; } break; case 38: // up case 40: // down if (!this.o.keyboardNavigation) break; dir = e.keyCode == 38 ? -1 : 1; if (e.ctrlKey){ newDate = this.moveYear(this.date, dir); newViewDate = this.moveYear(this.viewDate, dir); } else if (e.shiftKey){ newDate = this.moveMonth(this.date, dir); newViewDate = this.moveMonth(this.viewDate, dir); } else { newDate = new Date(this.date); newDate.setUTCDate(this.date.getUTCDate() + dir * 7); newViewDate = new Date(this.viewDate); newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7); } if (this.dateWithinRange(newDate)){ this.date = newDate; this.viewDate = newViewDate; this.setValue(); this.update(); e.preventDefault(); dateChanged = true; } break; case 13: // enter this.hide(); e.preventDefault(); break; case 9: // tab this.hide(); break; } if (dateChanged){ this._trigger('changeDate'); var element; if (this.isInput) { element = this.element; } else if (this.component){ element = this.element.find('input'); } if (element) { element.change(); } } }, showMode: function(dir) { if (dir) { this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir)); } /* vitalets: fixing bug of very special conditions: jquery 1.7.1 + webkit + show inline datepicker in bootstrap popover. Method show() does not set display css correctly and datepicker is not shown. Changed to .css('display', 'block') solve the problem. See https://github.com/vitalets/x-editable/issues/37 In jquery 1.7.2+ everything works fine. */ //this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).css('display', 'block'); this.updateNavArrows(); } }; var DateRangePicker = function(element, options){ this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; $(this.inputs) .datepicker(options) .bind('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.date; }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ var dp = $(e.target).data('datepicker'), new_date = dp.getUTCDate(), i = $.inArray(e.target, this.inputs), l = this.inputs.length; if (i == -1) return; if (new_date < this.dates[i]){ // Date being moved earlier/left while (i>=0 && new_date < this.dates[i]){ this.pickers[i--].setUTCDate(new_date); } } else if (new_date > this.dates[i]){ // Date being moved later/right while (i<l && new_date > this.dates[i]){ this.pickers[i++].setUTCDate(new_date); } } this.updateDates(); }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; function opts_from_el(el, prefix){ // Derive options from element data-attrs var data = $(el).data(), out = {}, inkey, replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'), prefix = new RegExp('^' + prefix.toLowerCase()); for (var key in data) if (prefix.test(key)){ inkey = key.replace(replace, function(_,a){ return a.toLowerCase(); }); out[inkey] = data[key]; } return out; } function opts_from_locale(lang){ // Derive options from locale plugins var out = {}; // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" if (!dates[lang]) { lang = lang.split('-')[0] if (!dates[lang]) return; } var d = dates[lang]; $.each($.fn.datepicker.locale_opts, function(i,k){ if (k in d) out[k] = d[k]; }); return out; } var old = $.fn.datepicker; $.fn.datepicker = function ( option ) { var args = Array.apply(null, arguments); args.shift(); var internal_return, this_return; this.each(function () { var $this = $(this), data = $this.data('datepicker'), options = typeof option == 'object' && option; if (!data) { var elopts = opts_from_el(this, 'date'), // Preliminary otions xopts = $.extend({}, $.fn.datepicker.defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, $.fn.datepicker.defaults, locopts, elopts, options); if ($this.is('.input-daterange') || opts.inputs){ var ropts = { inputs: opts.inputs || $this.find('input').toArray() }; $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts)))); } else{ $this.data('datepicker', (data = new Datepicker(this, opts))); } } if (typeof option == 'string' && typeof data[option] == 'function') { internal_return = data[option].apply(data, args); if (internal_return !== undefined) return false; } }); if (internal_return !== undefined) return internal_return; else return this; }; $.fn.datepicker.defaults = { autoclose: false, beforeShowDay: $.noop, calendarWeeks: false, clearBtn: false, daysOfWeekDisabled: [], endDate: Infinity, forceParse: true, format: 'mm/dd/yyyy', keyboardNavigation: true, language: 'en', minViewMode: 0, rtl: false, startDate: -Infinity, startView: 0, todayBtn: false, todayHighlight: false, weekStart: 0 }; $.fn.datepicker.locale_opts = [ 'format', 'rtl', 'weekStart' ]; $.fn.datepicker.Constructor = Datepicker; var dates = $.fn.datepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", clear: "Clear" } }; var DPGlobal = { modes: [ { clsName: 'days', navFnc: 'Month', navStep: 1 }, { clsName: 'months', navFnc: 'FullYear', navStep: 1 }, { clsName: 'years', navFnc: 'FullYear', navStep: 10 }], isLeapYear: function (year) { return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); }, getDaysInMonth: function (year, month) { return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; }, validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, parseFormat: function(format){ // IE treats \0 as a string end in inputs (truncating the value), // so it's a bad format delimiter, anyway var separators = format.replace(this.validParts, '\0').split('\0'), parts = format.match(this.validParts); if (!separators || !separators.length || !parts || parts.length === 0){ throw new Error("Invalid date format."); } return {separators: separators, parts: parts}; }, parseDate: function(date, format, language) { if (date instanceof Date) return date; if (typeof format === 'string') format = DPGlobal.parseFormat(format); if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) { var part_re = /([\-+]\d+)([dmwy])/, parts = date.match(/([\-+]\d+)([dmwy])/g), part, dir; date = new Date(); for (var i=0; i<parts.length; i++) { part = part_re.exec(parts[i]); dir = parseInt(part[1]); switch(part[2]){ case 'd': date.setUTCDate(date.getUTCDate() + dir); break; case 'm': date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir); break; case 'w': date.setUTCDate(date.getUTCDate() + dir * 7); break; case 'y': date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir); break; } } return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0); } var parts = date && date.match(this.nonpunctuation) || [], date = new Date(), parsed = {}, setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'], setters_map = { yyyy: function(d,v){ return d.setUTCFullYear(v); }, yy: function(d,v){ return d.setUTCFullYear(2000+v); }, m: function(d,v){ v -= 1; while (v<0) v += 12; v %= 12; d.setUTCMonth(v); while (d.getUTCMonth() != v) d.setUTCDate(d.getUTCDate()-1); return d; }, d: function(d,v){ return d.setUTCDate(v); } }, val, filtered, part; setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); var fparts = format.parts.slice(); // Remove noop parts if (parts.length != fparts.length) { fparts = $(fparts).filter(function(i,p){ return $.inArray(p, setters_order) !== -1; }).toArray(); } // Process remainder if (parts.length == fparts.length) { for (var i=0, cnt = fparts.length; i < cnt; i++) { val = parseInt(parts[i], 10); part = fparts[i]; if (isNaN(val)) { switch(part) { case 'MM': filtered = $(dates[language].months).filter(function(){ var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m == p; }); val = $.inArray(filtered[0], dates[language].months) + 1; break; case 'M': filtered = $(dates[language].monthsShort).filter(function(){ var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m == p; }); val = $.inArray(filtered[0], dates[language].monthsShort) + 1; break; } } parsed[part] = val; } for (var i=0, s; i<setters_order.length; i++){ s = setters_order[i]; if (s in parsed && !isNaN(parsed[s])) setters_map[s](date, parsed[s]); } } return date; }, formatDate: function(date, format, language){ if (typeof format === 'string') format = DPGlobal.parseFormat(format); var val = { d: date.getUTCDate(), D: dates[language].daysShort[date.getUTCDay()], DD: dates[language].days[date.getUTCDay()], m: date.getUTCMonth() + 1, M: dates[language].monthsShort[date.getUTCMonth()], MM: dates[language].months[date.getUTCMonth()], yy: date.getUTCFullYear().toString().substring(2), yyyy: date.getUTCFullYear() }; val.dd = (val.d < 10 ? '0' : '') + val.d; val.mm = (val.m < 10 ? '0' : '') + val.m; var date = [], seps = $.extend([], format.separators); for (var i=0, cnt = format.parts.length; i <= cnt; i++) { if (seps.length) date.push(seps.shift()); date.push(val[format.parts[i]]); } return date.join(''); }, headTemplate: '<thead>'+ '<tr>'+ '<th class="prev"><i class="icon-arrow-left"/></th>'+ '<th colspan="5" class="datepicker-switch"></th>'+ '<th class="next"><i class="icon-arrow-right"/></th>'+ '</tr>'+ '</thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>' }; DPGlobal.template = '<div class="datepicker">'+ '<div class="datepicker-days">'+ '<table class=" table-condensed">'+ DPGlobal.headTemplate+ '<tbody></tbody>'+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-months">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-years">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '</div>'; $.fn.datepicker.DPGlobal = DPGlobal; /* DATEPICKER NO CONFLICT * =================== */ $.fn.datepicker.noConflict = function(){ $.fn.datepicker = old; return this; }; /* DATEPICKER DATA-API * ================== */ $(document).on( 'focus.datepicker.data-api click.datepicker.data-api', '[data-provide="datepicker"]', function(e){ var $this = $(this); if ($this.data('datepicker')) return; e.preventDefault(); // component click requires us to explicitly show it $this.datepicker('show'); } ); $(function(){ $('[data-provide="datepicker-inline"]').datepicker(); }); }( window.jQuery ));
z3c.formwidget.bootstrap_datepicker
/z3c.formwidget.bootstrap_datepicker-0.1.tar.gz/z3c.formwidget.bootstrap_datepicker-0.1/src/z3c/formwidget/bootstrap_datepicker/resources/bootstrap-datepicker.js
bootstrap-datepicker.js
import os, shutil, sys, tempfile from optparse import OptionParser tmpeggs = tempfile.mkdtemp() usage = '''\ [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] Bootstraps a buildout-based project. Simply run this script in a directory containing a buildout.cfg, using the Python that you want bin/buildout to use. Note that by using --setup-source and --download-base to point to local resources, you can keep this script from going over the network. ''' parser = OptionParser(usage=usage) parser.add_option("-v", "--version", help="use a specific zc.buildout version") parser.add_option("-t", "--accept-buildout-test-releases", dest='accept_buildout_test_releases', action="store_true", default=False, help=("Normally, if you do not specify a --version, the " "bootstrap script and buildout gets the newest " "*final* versions of zc.buildout and its recipes and " "extensions for you. If you use this flag, " "bootstrap and buildout will get the newest releases " "even if they are alphas or betas.")) parser.add_option("-c", "--config-file", help=("Specify the path to the buildout configuration " "file to be used.")) parser.add_option("-f", "--find-links", help=("Specify a URL to search for buildout releases")) options, args = parser.parse_args() ###################################################################### # load/install distribute to_reload = False try: import pkg_resources, setuptools if not hasattr(pkg_resources, '_distribute'): to_reload = True raise ImportError except ImportError: ez = {} try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen exec(urlopen('http://python-distribute.org/distribute_setup.py').read(), ez) setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True) ez['use_setuptools'](**setup_args) if to_reload: reload(pkg_resources) import pkg_resources # This does not (always?) update the default working set. We will # do it. for path in sys.path: if path not in pkg_resources.working_set.entries: pkg_resources.working_set.add_entry(path) ###################################################################### # Install buildout ws = pkg_resources.working_set cmd = [sys.executable, '-c', 'from setuptools.command.easy_install import main; main()', '-mZqNxd', tmpeggs] find_links = os.environ.get( 'bootstrap-testing-find-links', options.find_links or ('http://downloads.buildout.org/' if options.accept_buildout_test_releases else None) ) if find_links: cmd.extend(['-f', find_links]) distribute_path = ws.find( pkg_resources.Requirement.parse('distribute')).location requirement = 'zc.buildout' version = options.version if version is None and not options.accept_buildout_test_releases: # Figure out the most recent final version of zc.buildout. import setuptools.package_index _final_parts = '*final-', '*final' def _final_version(parsed_version): for part in parsed_version: if (part[:1] == '*') and (part not in _final_parts): return False return True index = setuptools.package_index.PackageIndex( search_path=[distribute_path]) if find_links: index.add_find_links((find_links,)) req = pkg_resources.Requirement.parse(requirement) if index.obtain(req) is not None: best = [] bestv = None for dist in index[req.project_name]: distv = dist.parsed_version if _final_version(distv): if bestv is None or distv > bestv: best = [dist] bestv = distv elif distv == bestv: best.append(dist) if best: best.sort() version = best[-1].version if version: requirement = '=='.join((requirement, version)) cmd.append(requirement) import subprocess if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=distribute_path)) != 0: raise Exception( "Failed to execute command:\n%s", repr(cmd)[1:-1]) ###################################################################### # Import and run buildout ws.add_entry(tmpeggs) ws.require(requirement) import zc.buildout.buildout if not [a for a in args if '=' not in a]: args.append('bootstrap') # if -c was provided, we push it back into args for buildout' main function if options.config_file is not None: args[0:0] = ['-c', options.config_file] zc.buildout.buildout.main(args) shutil.rmtree(tmpeggs)
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/bootstrap.py
bootstrap.py
==================================== RichText Fields and CKEditor Widgets ==================================== This package a provides a new field called `RichText`, which is a simple extension to the default `Text` field. The `RichText` field declares that it contains HTML-markup as part of its text. >>> from z3c.formwidget.ckeditor import richtext So let's create a rich text field: >>> text = richtext.RichText(__name__='text') Let's now verify that the field provides the text and rich text schema: >>> import zope.schema >>> from zope.interface import verify >>> from z3c.formwidget.ckeditor import interfaces >>> verify.verifyObject(interfaces.IRichText, text) True >>> verify.verifyObject(zope.schema.interfaces.IText, text) True Next, a widget is provided to edit the rich text field. It uses the CKEditor. >>> from z3c.formwidget.ckeditor import interfaces, ckeditor The ``CKEditorWidget`` is a widget: >>> from z3c.form.interfaces import IWidget >>> verify.verifyClass(interfaces.ICKEditorWidget, ckeditor.CKEditorWidget) True >>> verify.verifyClass(IWidget, ckeditor.CKEditorWidget) True The widget can render an input field only by adapting a request: >>> from z3c.form.testing import TestRequest >>> request = TestRequest() >>> widget = ckeditor.CKEditorWidget(request) Such a widget provides ``IWidget``: >>> IWidget.providedBy(widget) True Let's add some meaningful generic data: >>> widget.id = 'id' >>> widget.name = 'name' If we render the widget we get the HTML: >>> widget.update() >>> print(widget.render()) <textarea id="id" name="name" class="CKEditorWidget"></textarea> <script type="text/javascript">CKEDITOR.replace('name', {});</script> As you can see, initially, CK Editor is instantiated with all its defaults. This can be changed by modifying the `config` attribute on the widget. If the `config` attribute is a string, it is interpreted as a JavaScript variable name. The variable must be declared beforehand. >>> widget.config = 'myCKEditorConfig' >>> widget.update() >>> print(widget.render()) <textarea id="id" name="name" class="CKEditorWidget"></textarea> <script type="text/javascript">CKEDITOR.replace('name', myCKEditorConfig);</script> Alternatively, the config attribute can be a dictionary of options, which are encoded to Javascript upon render time: >>> widget.config = '{"toolbar": "Basic", "uiColor": "#9AB8F3"}' >>> widget.update() >>> print(widget.render()) <textarea id="id" name="name" class="CKEditorWidget"></textarea> <script type="text/javascript">CKEDITOR.replace('name', {"toolbar": "Basic", "uiColor": "#9AB8F3"});</script> All other values cause a `ValueError` to be raised. >>> widget.config = 3 >>> widget.update() Traceback (most recent call last): ... ValueError: ('Invalid config object', 3) The field widget for the rich text field is available too of course: >>> import zope.component >>> from z3c.form.interfaces import IFieldWidget >>> widget = zope.component.getMultiAdapter((text, request), IFieldWidget) >>> widget <CKEditorWidget 'text'> >>> widget.update() >>> print(widget.render()) <textarea id="text" name="text" class="CKEditorWidget required richtext-field"></textarea> <script type="text/javascript">CKEDITOR.replace('text', {});</script> You can also create CKEditor Field Widget factories on the fly using a given configuration: >>> MinimalCKEditorWidget = ckeditor.CKEditorFieldWidgetFactory( ... '{"toolbar": "Basic", "uiColor": "#9AB8F3"}') >>> widget = MinimalCKEditorWidget(text, request) >>> widget.update() >>> print(widget.render()) <textarea id="text" name="text" class="CKEditorWidget required richtext-field"></textarea> <script type="text/javascript">CKEDITOR.replace('text', {"toolbar": "Basic", "uiColor": "#9AB8F3"});</script>
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/README.txt
README.txt
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'B1GG4Z6',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;if(!d)throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/'&&!/[&?]t=/.test(d))d+=(d.indexOf('?')>=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b){var c=a.event.prototype;for(var d in c){if(b[d]==undefined)b[d]=c[d];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e<f.length;e++){if(f[e].fn==d)return e;}return-1;}};return{on:function(d,e,f,g,h){var i=b(this),j=i[d]||(i[d]=new c(d));if(j.getListenerIndex(e)<0){var k=j.listeners;if(!f)f=this;if(isNaN(h))h=10;var l=this,m=function(o,p,q,r){var s={name:d,sender:this,editor:o,data:p,listenerData:g,stop:q,cancel:r,removeListener:function(){l.removeListener(d,e);}};e.call(f,s);return s.data;};m.fn=e;m.priority=h;for(var n=k.length-1;n>=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o<n.length;o++){var p=n[o].call(this,j,i,e,g);if(typeof p!='undefined')i=p;if(d||f)break;}}}var q=f||(typeof i=='undefined'?false:i);d=l;f=m;return q;};})(),fireOnce:function(d,e,f){var g=this.fire(d,e,f);delete b(this)[d];return g;},removeListener:function(d,e){var f=b(this)[d];if(f){var g=f.getListenerIndex(e);if(g>=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d]; return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(d&&d.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1})d=null;if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';}};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown');if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7'); if(d.quirks)d.cssClass+=' cke_browser_iequirks';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';if(d.air)d.cssClass+=' cke_browser_air';return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=1;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=1;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f<e.length;f++){var g=null,h=e[f],i=h.name;if(!h.name&&!h.id)continue;if(typeof arguments[0]=='string'){var j=new RegExp('(?:^|\\s)'+arguments[0]+'(?:$|\\s)');if(!j.test(h.className))continue;}else if(typeof arguments[0]=='function'){g={};if(arguments[0](h,g)===false)continue;}this.replace(h,g);}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled)a.replaceAll(a.replaceClass);a.status='basic_ready';if(f&&f._load)f();else if(g)setTimeout(function(){if(a.loadFullCore)a.loadFullCore();},g*1000);};if(window.addEventListener)window.addEventListener('load',e,false);else if(window.attachEvent)window.attachEvent('onload',e);})();a.status='basic_loaded';})();})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/ckeditor_basic.js
ckeditor_basic.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(b,c,d,e,f,g,h){var i=b.config,j=f.split(';'),k=[],l={};for(var m=0;m<j.length;m++){var n={},o=j[m].split('/'),p=j[m]=o[0];n[d]=k[m]=o[1]||p;l[p]=new CKEDITOR.style(h,n);}b.ui.addRichCombo(c,{label:e.label,title:e.panelTitle,voiceLabel:e.voiceLabel,className:'cke_'+(d=='size'?'fontSize':'font'),multiSelect:false,panel:{css:[CKEDITOR.getUrl(b.skinPath+'editor.css')].concat(i.contentsCss),voiceLabel:e.panelVoiceLabel},init:function(){this.startGroup(e.panelTitle);for(var q=0;q<j.length;q++){var r=j[q];this.add(r,'<span style="font-'+d+':'+k[q]+'">'+r+'</span>',r);}},onClick:function(q){b.focus();b.fire('saveSnapshot');var r=l[q];if(this.getValue()==q)r.remove(b.document);else r.apply(b.document);b.fire('saveSnapshot');},onRender:function(){b.on('selectionChange',function(q){var r=this.getValue(),s=q.data.path,t=s.elements;for(var u=0,v;u<t.length;u++){v=t[u];for(var w in l)if(l[w].checkElementRemovable(v,true)){if(w!=r)this.setValue(w);return;}}this.setValue('',g);},this);}});};CKEDITOR.plugins.add('font',{requires:['richcombo','styles'],init:function(b){var c=b.config;a(b,'Font','family',b.lang.font,c.font_names,c.font_defaultLabel,c.font_style);a(b,'FontSize','size',b.lang.fontSize,c.fontSize_sizes,c.fontSize_defaultLabel,c.fontSize_style);}});})();CKEDITOR.config.font_names='Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';CKEDITOR.config.font_defaultLabel='';CKEDITOR.config.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};CKEDITOR.config.fontSize_sizes='8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px';CKEDITOR.config.fontSize_defaultLabel='';CKEDITOR.config.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/font/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a={ol:1,ul:1},b=/^[\n\r\t ]*$/;CKEDITOR.plugins.list={listToArray:function(i,j,k,l,m){if(!a[i.getName()])return[];if(!l)l=0;if(!k)k=[];for(var n=0,o=i.getChildCount();n<o;n++){var p=i.getChild(n);if(p.$.nodeName.toLowerCase()!='li')continue;var q={parent:i,indent:l,contents:[]};if(!m){q.grandparent=i.getParent();if(q.grandparent&&q.grandparent.$.nodeName.toLowerCase()=='li')q.grandparent=q.grandparent.getParent();}else q.grandparent=m;if(j)CKEDITOR.dom.element.setMarker(j,p,'listarray_index',k.length);k.push(q);for(var r=0,s=p.getChildCount();r<s;r++){var t=p.getChild(r);if(t.type==CKEDITOR.NODE_ELEMENT&&a[t.getName()])CKEDITOR.plugins.list.listToArray(t,j,k,l+1,q.grandparent);else q.contents.push(t);}}return k;},arrayToList:function(i,j,k,l){if(!k)k=0;if(!i||i.length<k+1)return null;var m=i[k].parent.getDocument(),n=new CKEDITOR.dom.documentFragment(m),o=null,p=k,q=Math.max(i[k].indent,0),r=null,s=l==CKEDITOR.ENTER_P?'p':'div';for(;;){var t=i[p];if(t.indent==q){if(!o||i[p].parent.getName()!=o.getName()){o=i[p].parent.clone(false,true);n.append(o);}r=o.append(m.createElement('li'));for(var u=0;u<t.contents.length;u++)r.append(t.contents[u].clone(true,true));p++;}else if(t.indent==Math.max(q,0)+1){var v=CKEDITOR.plugins.list.arrayToList(i,null,p,l);r.append(v.listNode);p=v.nextIndex;}else if(t.indent==-1&&!k&&t.grandparent){r;if(a[t.grandparent.getName()])r=m.createElement('li');else if(l!=CKEDITOR.ENTER_BR&&t.grandparent.getName()!='td')r=m.createElement(s);else r=new CKEDITOR.dom.documentFragment(m);for(u=0;u<t.contents.length;u++)r.append(t.contents[u].clone(true,true));if(r.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&p!=i.length-1){if(r.getLast()&&r.getLast().type==CKEDITOR.NODE_ELEMENT&&r.getLast().getAttribute('type')=='_moz')r.getLast().remove();r.appendBogus();}if(r.type==CKEDITOR.NODE_ELEMENT&&r.getName()==s&&r.$.firstChild){r.trim();var w=r.getFirst();if(w.type==CKEDITOR.NODE_ELEMENT&&w.isBlockBoundary()){var x=new CKEDITOR.dom.documentFragment(m);r.moveChildren(x);r=x;}}var y=r.$.nodeName.toLowerCase();if(!CKEDITOR.env.ie&&(y=='div'||y=='p'))r.appendBogus();n.append(r);o=null;p++;}else return null;if(i.length<=p||Math.max(i[p].indent,0)<q)break;}if(j){var z=n.getFirst();while(z){if(z.type==CKEDITOR.NODE_ELEMENT)CKEDITOR.dom.element.clearMarkers(j,z);z=z.getNextSourceNode();}}return{listNode:n,nextIndex:p};}};function c(i,j){i.getCommand(this.name).setState(j);};function d(i){var j=i.data.path,k=j.blockLimit,l=j.elements,m;for(var n=0;n<l.length&&(m=l[n])&&(!m.equals(k)); n++)if(a[l[n].getName()])return c.call(this,i.editor,this.type==l[n].getName()?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);return c.call(this,i.editor,CKEDITOR.TRISTATE_OFF);};function e(i,j,k,l){var m=CKEDITOR.plugins.list.listToArray(j.root,k),n=[];for(var o=0;o<j.contents.length;o++){var p=j.contents[o];p=p.getAscendant('li',true);if(!p||p.getCustomData('list_item_processed'))continue;n.push(p);CKEDITOR.dom.element.setMarker(k,p,'list_item_processed',true);}var q=j.root.getDocument().createElement(this.type);for(o=0;o<n.length;o++){var r=n[o].getCustomData('listarray_index');m[r].parent=q;}var s=CKEDITOR.plugins.list.arrayToList(m,k,null,i.config.enterMode),t,u=s.listNode.getChildCount();for(o=0;o<u&&(t=s.listNode.getChild(o));o++)if(t.getName()==this.type)l.push(t);s.listNode.replace(j.root);};function f(i,j,k){var l=j.contents,m=j.root.getDocument(),n=[];if(l.length==1&&l[0].equals(j.root)){var o=m.createElement('div');l[0].moveChildren&&l[0].moveChildren(o);l[0].append(o);l[0]=o;}var p=j.contents[0].getParent();for(var q=0;q<l.length;q++)p=p.getCommonAncestor(l[q].getParent());for(q=0;q<l.length;q++){var r=l[q],s;while(s=r.getParent()){if(s.equals(p)){n.push(r);break;}r=s;}}if(n.length<1)return;var t=n[n.length-1].getNext(),u=m.createElement(this.type);k.push(u);while(n.length){var v=n.shift(),w=m.createElement('li');v.moveChildren(w);v.remove();w.appendTo(u);if(!CKEDITOR.env.ie)w.appendBogus();}if(t)u.insertBefore(t);else u.appendTo(p);};function g(i,j,k){var l=CKEDITOR.plugins.list.listToArray(j.root,k),m=[];for(var n=0;n<j.contents.length;n++){var o=j.contents[n];o=o.getAscendant('li',true);if(!o||o.getCustomData('list_item_processed'))continue;m.push(o);CKEDITOR.dom.element.setMarker(k,o,'list_item_processed',true);}var p=null;for(n=0;n<m.length;n++){var q=m[n].getCustomData('listarray_index');l[q].indent=-1;p=q;}for(n=p+1;n<l.length;n++)if(l[n].indent>l[n-1].indent+1){var r=l[n-1].indent+1-l[n].indent,s=l[n].indent;while(l[n]&&l[n].indent>=s){l[n].indent+=r;n++;}n--;}var t=CKEDITOR.plugins.list.arrayToList(l,k,null,i.config.enterMode),u=t.listNode,v,w;function x(z){if((v=u[z?'getFirst':'getLast']())&&(!(v.is&&v.isBlockBoundary())&&(w=j.root[z?'getPrevious':'getNext'](CKEDITOR.dom.walker.whitespaces(true)))&&(!(w.is&&w.isBlockBoundary({br:1})))))i.document.createElement('br')[z?'insertBefore':'insertAfter'](v);};x(true);x();var y=j.root.getParent();u.replace(j.root);};function h(i,j){this.name=i;this.type=j;};h.prototype={exec:function(i){i.focus(); var j=i.document,k=i.getSelection(),l=k&&k.getRanges();if(!l||l.length<1)return;if(this.state==CKEDITOR.TRISTATE_OFF){var m=j.getBody();m.trim();if(!m.getFirst()){var n=j.createElement(i.config.enterMode==CKEDITOR.ENTER_P?'p':i.config.enterMode==CKEDITOR.ENTER_DIV?'div':'br');n.appendTo(m);l=[new CKEDITOR.dom.range(j)];if(n.is('br')){l[0].setStartBefore(n);l[0].setEndAfter(n);}else l[0].selectNodeContents(n);k.selectRanges(l);}else{var o=l.length==1&&l[0],p=o&&o.getEnclosedNode();if(p&&p.is&&this.type==p.getName())c.call(this,i,CKEDITOR.TRISTATE_ON);}}var q=k.createBookmarks(true),r=[],s={};while(l.length>0){o=l.shift();var t=o.getBoundaryNodes(),u=t.startNode,v=t.endNode;if(u.type==CKEDITOR.NODE_ELEMENT&&u.getName()=='td')o.setStartAt(t.startNode,CKEDITOR.POSITION_AFTER_START);if(v.type==CKEDITOR.NODE_ELEMENT&&v.getName()=='td')o.setEndAt(t.endNode,CKEDITOR.POSITION_BEFORE_END);var w=o.createIterator(),x;w.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;while(x=w.getNextParagraph()){var y=new CKEDITOR.dom.elementPath(x),z=null,A=false,B=y.blockLimit,C;for(var D=0;D<y.elements.length&&(C=y.elements[D])&&(!C.equals(B));D++)if(a[C.getName()]){B.removeCustomData('list_group_object');var E=C.getCustomData('list_group_object');if(E)E.contents.push(x);else{E={root:C,contents:[x]};r.push(E);CKEDITOR.dom.element.setMarker(s,C,'list_group_object',E);}A=true;break;}if(A)continue;var F=B;if(F.getCustomData('list_group_object'))F.getCustomData('list_group_object').contents.push(x);else{E={root:F,contents:[x]};CKEDITOR.dom.element.setMarker(s,F,'list_group_object',E);r.push(E);}}}var G=[];while(r.length>0){E=r.shift();if(this.state==CKEDITOR.TRISTATE_OFF){if(a[E.root.getName()])e.call(this,i,E,s,G);else f.call(this,i,E,G);}else if(this.state==CKEDITOR.TRISTATE_ON&&a[E.root.getName()])g.call(this,i,E,s);}for(D=0;D<G.length;D++){z=G[D];var H,I=this;(H=function(J){var K=z[J?'getPrevious':'getNext'](CKEDITOR.dom.walker.whitespaces(true));if(K&&K.getName&&K.getName()==I.type){K.remove();K.moveChildren(z,J?true:false);}})();H(true);}CKEDITOR.dom.element.clearAllMarkers(s);k.selectBookmarks(q);i.focus();}};CKEDITOR.plugins.add('list',{init:function(i){var j=new h('numberedlist','ol'),k=new h('bulletedlist','ul');i.addCommand('numberedlist',j);i.addCommand('bulletedlist',k);i.ui.addButton('NumberedList',{label:i.lang.numberedlist,command:'numberedlist'});i.ui.addButton('BulletedList',{label:i.lang.bulletedlist,command:'bulletedlist'});i.on('selectionChange',CKEDITOR.tools.bind(d,j)); i.on('selectionChange',CKEDITOR.tools.bind(d,k));},requires:['domiterator']});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/list/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){CKEDITOR.plugins.add('stylescombo',{requires:['richcombo','styles'],init:function(d){var e=d.config,f=d.lang.stylesCombo,g=this.path,h;d.ui.addRichCombo('Styles',{label:f.label,title:f.panelTitle,voiceLabel:f.voiceLabel,className:'cke_styles',multiSelect:true,panel:{css:[CKEDITOR.getUrl(d.skinPath+'editor.css')].concat(e.contentsCss),voiceLabel:f.panelVoiceLabel},init:function(){var i=this,j=e.stylesCombo_stylesSet.split(':'),k=j[1]?j.slice(1).join(':'):CKEDITOR.getUrl(g+'styles/'+j[0]+'.js');j=j[0];CKEDITOR.loadStylesSet(j,k,function(l){var m,n,o=[];h={};for(var p=0;p<l.length;p++){var q=l[p];n=q.name;m=h[n]=new CKEDITOR.style(q);m._name=n;o.push(m);}o.sort(c);var r;for(p=0;p<o.length;p++){m=o[p];n=m._name;var s=m.type;if(s!=r){i.startGroup(f['panelTitle'+String(s)]);r=s;}i.add(n,m.type==CKEDITOR.STYLE_OBJECT?n:b(m._.definition),n);}i.commit();i.onOpen();});},onClick:function(i){d.focus();d.fire('saveSnapshot');var j=h[i],k=d.getSelection();if(j.type==CKEDITOR.STYLE_OBJECT){var l=k.getSelectedElement();if(l)j.applyToObject(l);return;}var m=new CKEDITOR.dom.elementPath(k.getStartElement());if(j.type==CKEDITOR.STYLE_INLINE&&j.checkActive(m))j.remove(d.document);else j.apply(d.document);d.fire('saveSnapshot');},onRender:function(){d.on('selectionChange',function(i){var j=this.getValue(),k=i.data.path,l=k.elements;for(var m=0,n;m<l.length;m++){n=l[m];for(var o in h)if(h[o].checkElementRemovable(n,true)){if(o!=j)this.setValue(o);return;}}this.setValue('');},this);},onOpen:function(){var q=this;if(CKEDITOR.env.ie)d.focus();var i=d.getSelection(),j=i.getSelectedElement(),k=j&&j.getName(),l=new CKEDITOR.dom.elementPath(j||i.getStartElement()),m=[0,0,0,0];q.showAll();q.unmarkAll();for(var n in h){var o=h[n],p=o.type;if(p==CKEDITOR.STYLE_OBJECT){if(j&&o.element==k){if(o.checkElementRemovable(j,true))q.mark(n);m[p]++;}else q.hideItem(n);}else{if(o.checkActive(l))q.mark(n);m[p]++;}}if(!m[CKEDITOR.STYLE_BLOCK])q.hideGroup(f['panelTitle'+String(CKEDITOR.STYLE_BLOCK)]);if(!m[CKEDITOR.STYLE_INLINE])q.hideGroup(f['panelTitle'+String(CKEDITOR.STYLE_INLINE)]);if(!m[CKEDITOR.STYLE_OBJECT])q.hideGroup(f['panelTitle'+String(CKEDITOR.STYLE_OBJECT)]);}});}});var a={};CKEDITOR.addStylesSet=function(d,e){a[d]=e;};CKEDITOR.loadStylesSet=function(d,e,f){var g=a[d];if(g){f(g);return;}CKEDITOR.scriptLoader.load(e,function(){f(a[d]);});};function b(d){var e=[],f=d.element;if(f=='bdo')f='span';e=['<',f];var g=d.attributes;if(g)for(var h in g)e.push(' ',h,'="',g[h],'"');var i=CKEDITOR.style.getStyleText(d); if(i)e.push(' style="',i,'"');e.push('>',d.name,'</',f,'>');return e.join('');};function c(d,e){var f=d.type,g=e.type;return f==g?0:f==CKEDITOR.STYLE_OBJECT?-1:g==CKEDITOR.STYLE_OBJECT?1:g==CKEDITOR.STYLE_BLOCK?1:-1;};})();CKEDITOR.config.stylesCombo_stylesSet='default';
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/stylescombo/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('listblock',{requires:['panel'],onLoad:function(){CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b));};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){var d=this;d.base(a);d.multiSelect=!!b;var c=d.keys;c[40]='next';c[9]='next';c[38]='prev';c[CKEDITOR.SHIFT+9]='prev';c[32]='click';d._.pendingHtml=[];d._.items={};d._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('</ul>');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=CKEDITOR.tools.addFunction(function(a){var c=this;var b=true;if(c.multiSelect)b=c.toggle(a);else c.mark(a);if(c.onClick)c.onClick(a,b);},this);return this._.click;}},proto:{add:function(a,b,c){var f=this;var d=f._.pendingHtml,e='cke_'+CKEDITOR.tools.getNextNumber();if(!f._.started){d.push('<ul class=cke_panel_list>');f._.started=1;}f._.items[a]=e;d.push('<li id=',e,' class=cke_panel_listItem><a _cke_focus=1 hidefocus=true title="',c||a,'" href="javascript:void(\'',a,'\')" onclick="CKEDITOR.tools.callFunction(',f._.getClick(),",'",a,"'); return false;\">",b||a,'</a></li>');},startGroup:function(a){this._.close();var b='cke_'+CKEDITOR.tools.getNextNumber();this._.groups[a]=b;this._.pendingHtml.push('<h1 id=',b,' class=cke_panel_grouptitle>',a,'</h1>');},commit:function(){var a=this;a._.close();a.element.appendHtml(a._.pendingHtml.join(''));a._.pendingHtml=[];},toggle:function(a){var b=this.isMarked(a);if(b)this.unmark(a);else this.mark(a);return!b;},hideGroup:function(a){var b=this.element.getDocument().getById(this._.groups[a]),c=b&&b.getNext();if(b){b.setStyle('display','none');if(c&&c.getName()=='ul')c.setStyle('display','none');}},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle('display','none');},showAll:function(){var a=this._.items,b=this._.groups,c=this.element.getDocument();for(var d in a)c.getById(a[d]).setStyle('display','');for(var e in b){var f=c.getById(b[e]),g=f.getNext();f.setStyle('display','');if(g&&g.getName()=='ul')g.setStyle('display','');}},mark:function(a){var b=this;if(!b.multiSelect)b.unmarkAll();b.element.getDocument().getById(b._.items[a]).addClass('cke_selected');},unmark:function(a){this.element.getDocument().getById(this._.items[a]).removeClass('cke_selected');},unmarkAll:function(){var a=this._.items,b=this.element.getDocument();for(var c in a)b.getById(a[c]).removeClass('cke_selected'); },isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass('cke_selected');},focus:function(a){this._.focusIndex=-1;if(a){var b=this.element.getDocument().getById(this._.items[a]).getFirst(),c=this.element.getElementsByTag('a'),d,e=-1;while(d=c.getItem(++e))if(d.equals(b)){this._.focusIndex=e;break;}setTimeout(function(){b.focus();},0);}}}});}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/listblock/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('uicolor',function(a){var b,c,d,e=a.getUiColor(),f='cke_uicolor_picker'+CKEDITOR.tools.getNextNumber();function g(j){if(/^#/.test(j))j=window.YAHOO.util.Color.hex2rgb(j.substr(1));c.setValue(j,true);c.refresh(f);};function h(j,k){if(k||b._.contents.tab1.livePeview.getValue())a.setUiColor(j);b._.contents.tab1.configBox.setValue('config.uiColor = "#'+c.get('hex')+'"');};d={id:'yuiColorPicker',type:'html',html:"<div id='"+f+"' class='cke_uicolor_picker' style='width: 360px; height: 200px; position: relative;'></div>",onLoad:function(j){var k=CKEDITOR.getUrl('plugins/uicolor/yui/');c=new window.YAHOO.widget.ColorPicker(f,{showhsvcontrols:true,showhexcontrols:true,images:{PICKER_THUMB:k+'assets/picker_thumb.png',HUE_THUMB:k+'assets/hue_thumb.png'}});if(e)g(e);c.on('rgbChange',function(){b._.contents.tab1.predefined.setValue('');h('#'+c.get('hex'));});var l=new CKEDITOR.dom.nodeList(c.getElementsByTagName('input'));for(var m=0;m<l.count();m++)l.getItem(m).addClass('cke_dialog_ui_input_text');}};var i=true;return{title:a.lang.uicolor.title,minWidth:360,minHeight:320,onLoad:function(){b=this;this.setupContent();if(CKEDITOR.env.ie7Compat)b.parts.contents.setStyle('overflow','hidden');},contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[d,{id:'tab1',type:'vbox',children:[{id:'livePeview',type:'checkbox',label:a.lang.uicolor.preview,'default':1,onLoad:function(){i=true;},onChange:function(){if(i)return;var j=this.getValue(),k=j?'#'+c.get('hex'):e;h(k,true);}},{type:'hbox',children:[{id:'predefined',type:'select','default':'',label:a.lang.uicolor.predefined,items:[[''],['Light blue','#9AB8F3'],['Sand','#D2B48C'],['Metallic','#949AAA'],['Purple','#C2A3C7'],['Olive','#A2C980'],['Happy green','#9BD446'],['Jezebel Blue','#14B8C4'],['Burn','#FF893A'],['Easy red','#FF6969'],['Pisces 3','#48B4F2'],['Aquarius 5','#487ED4'],['Absinthe','#A8CF76'],['Scrambled Egg','#C7A622'],['Hello monday','#8E8D80'],['Lovely sunshine','#F1E8B1'],['Recycled air','#B3C593'],['Down','#BCBCA4'],['Mark Twain','#CFE91D'],['Specks of dust','#D1B596'],['Lollipop','#F6CE23']],onChange:function(){var j=this.getValue();if(j){g(j);h(j);CKEDITOR.document.getById('predefinedPreview').setStyle('background',j);}else CKEDITOR.document.getById('predefinedPreview').setStyle('background','');},onShow:function(){var j=a.getUiColor();if(j)this.setValue(j);}},{id:'predefinedPreview',type:'html',html:'<div id="cke_uicolor_preview" style="border: 1px solid black; padding: 3px; width: 30px;"><div id="predefinedPreview" style="width: 30px; height: 30px;">&nbsp;</div></div>'}]},{id:'configBox',type:'text',label:a.lang.uicolor.config,onShow:function(){var j=a.getUiColor(); if(j)this.setValue('config.uiColor = "'+j+'"');}}]}]}],buttons:[CKEDITOR.dialog.okButton]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/uicolor/dialogs/uicolor.js
uicolor.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /*jsl:ignoreall*/ /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1796"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G}); },_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B); }else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN]; I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E); }else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.7.0", build: "1796"}); /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue; }if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id); }return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D); }this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ (function(){var B=YAHOO.util.Dom.getXY,A=YAHOO.util.Event,D=Array.prototype.slice;function C(G,E,F,H){C.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(G){this.init(G,E,true);this.initSlider(H);this.initThumb(F);}}YAHOO.lang.augmentObject(C,{getHorizSlider:function(F,G,I,H,E){return new C(F,F,new YAHOO.widget.SliderThumb(G,F,I,H,0,0,E),"horiz");},getVertSlider:function(G,H,E,I,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,0,0,E,I,F),"vert");},getSliderRegion:function(G,H,J,I,E,K,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,J,I,E,K,F),"region");},SOURCE_UI_EVENT:1,SOURCE_SET_VALUE:2,SOURCE_KEY_EVENT:3,ANIM_AVAIL:false},true);YAHOO.extend(C,YAHOO.util.DragDrop,{_mouseDown:false,dragOnly:true,initSlider:function(E){this.type=E;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=C.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(F){var E=this;this.thumb=F;F.cacheBetweenDrags=true;if(F._isHoriz&&F.xTicks&&F.xTicks.length){this.tickPause=Math.round(360/F.xTicks.length);}else{if(F.yTicks&&F.yTicks.length){this.tickPause=Math.round(360/F.yTicks.length);}}F.onAvailable=function(){return E.setStartSliderState();};F.onMouseDown=function(){E._mouseDown=true;return E.focus();};F.startDrag=function(){E._slideStart();};F.onDrag=function(){E.fireEvents(true);};F.onMouseUp=function(){E.thumbMouseUp();};},onAvailable:function(){this._bindKeyEvents();},_bindKeyEvents:function(){A.on(this.id,"keydown",this.handleKeyDown,this,true);A.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(F){if(this.enableKeys){var E=A.getCharCode(F);switch(E){case 37:case 38:case 39:case 40:case 36:case 35:A.preventDefault(F);break;default:}}},handleKeyDown:function(J){if(this.enableKeys){var G=A.getCharCode(J),F=this.thumb,H=this.getXValue(),E=this.getYValue(),I=true;switch(G){case 37:H-=this.keyIncrement;break;case 38:E-=this.keyIncrement;break;case 39:H+=this.keyIncrement;break;case 40:E+=this.keyIncrement;break;case 36:H=F.leftConstraint;E=F.topConstraint;break;case 35:H=F.rightConstraint;E=F.bottomConstraint;break;default:I=false;}if(I){if(F._isRegion){this._setRegionValue(C.SOURCE_KEY_EVENT,H,E,true);}else{this._setValue(C.SOURCE_KEY_EVENT,(F._isHoriz?H:E),true);}A.stopEvent(J);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=B(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this._setRegionValue.apply(this,this.deferredSetRegionValue);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this._setValue.apply(this,this.deferredSetValue);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var E=this.thumb.getEl();if(E){this.thumbCenterPoint={x:parseInt(E.offsetWidth/2,10),y:parseInt(E.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){this._mouseDown=false;if(!this.isLocked()&&!this.moveComplete){this.endMove();}},onMouseUp:function(){this._mouseDown=false;if(this.backgroundEnabled&&!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=C.SOURCE_UI_EVENT;var E=this.getEl();if(E.focus){try{E.focus();}catch(F){}}this.verifyOffset();return !this.isLocked();},onChange:function(E,F){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},setValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setValue.apply(this,E);},_setValue:function(I,L,G,H,E){var F=this.thumb,K,J;if(!F.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!H){return false;}if(isNaN(L)){return false;}if(F._isRegion){return false;}this._silent=E;this.valueChangeSource=I||C.SOURCE_SET_VALUE;F.lastOffset=[L,L];this.verifyOffset(true);this._slideStart();if(F._isHoriz){K=F.initPageX+L+this.thumbCenterPoint.x;this.moveThumb(K,F.initPageY,G);}else{J=F.initPageY+L+this.thumbCenterPoint.y;this.moveThumb(F.initPageX,J,G);}return true;},setRegionValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setRegionValue.apply(this,E);},_setRegionValue:function(F,J,H,I,G,K){var L=this.thumb,E,M;if(!L.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!G){return false;}if(isNaN(J)){return false;}if(!L._isRegion){return false;}this._silent=K;this.valueChangeSource=F||C.SOURCE_SET_VALUE;L.lastOffset=[J,H];this.verifyOffset(true);this._slideStart();E=L.initPageX+J+this.thumbCenterPoint.x;M=L.initPageY+H+this.thumbCenterPoint.y;this.moveThumb(E,M,I);return true;},verifyOffset:function(F){var G=B(this.getEl()),E=this.thumb;if(!this.thumbCenterPoint||!this.thumbCenterPoint.x){this.setThumbCenterPoint();}if(G){if(G[0]!=this.baselinePos[0]||G[1]!=this.baselinePos[1]){this.setInitPosition();this.baselinePos=G;E.initPageX=this.initPageX+E.startOffset[0];E.initPageY=this.initPageY+E.startOffset[1];E.deltaSetXY=null;this.resetThumbConstraints();return false;}}return true;},moveThumb:function(K,J,I,G){var L=this.thumb,M=this,F,E,H;if(!L.available){return;}L.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);E=L.getTargetCoord(K,J);F=[Math.round(E.x),Math.round(E.y)];if(this.animate&&L._graduated&&!I){this.lock();this.curCoord=B(this.thumb.getEl());this.curCoord=[Math.round(this.curCoord[0]),Math.round(this.curCoord[1])];setTimeout(function(){M.moveOneTick(F); },this.tickPause);}else{if(this.animate&&C.ANIM_AVAIL&&!I){this.lock();H=new YAHOO.util.Motion(L.id,{points:{to:F}},this.animationDuration,YAHOO.util.Easing.easeOut);H.onComplete.subscribe(function(){M.unlock();if(!M._mouseDown){M.endMove();}});H.animate();}else{L.setDragElPos(K,J);if(!G&&!this._mouseDown){this.endMove();}}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();this.fireEvent("slideStart");}this._sliding=true;}},_slideEnd:function(){if(this._sliding&&this.moveComplete){var E=this._silent;this._sliding=false;this._silent=false;this.moveComplete=false;if(!E){this.onSlideEnd();this.fireEvent("slideEnd");}}},moveOneTick:function(F){var H=this.thumb,G=this,I=null,E,J;if(H._isRegion){I=this._getNextX(this.curCoord,F);E=(I!==null)?I[0]:this.curCoord[0];I=this._getNextY(this.curCoord,F);J=(I!==null)?I[1]:this.curCoord[1];I=E!==this.curCoord[0]||J!==this.curCoord[1]?[E,J]:null;}else{if(H._isHoriz){I=this._getNextX(this.curCoord,F);}else{I=this._getNextY(this.curCoord,F);}}if(I){this.curCoord=I;this.thumb.alignElWithMouse(H.getEl(),I[0]+this.thumbCenterPoint.x,I[1]+this.thumbCenterPoint.y);if(!(I[0]==F[0]&&I[1]==F[1])){setTimeout(function(){G.moveOneTick(F);},this.tickPause);}else{this.unlock();if(!this._mouseDown){this.endMove();}}}else{this.unlock();if(!this._mouseDown){this.endMove();}}},_getNextX:function(E,F){var H=this.thumb,J,G=[],I=null;if(E[0]>F[0]){J=H.tickSize-this.thumbCenterPoint.x;G=H.getTargetCoord(E[0]-J,E[1]);I=[G.x,G.y];}else{if(E[0]<F[0]){J=H.tickSize+this.thumbCenterPoint.x;G=H.getTargetCoord(E[0]+J,E[1]);I=[G.x,G.y];}else{}}return I;},_getNextY:function(E,F){var H=this.thumb,J,G=[],I=null;if(E[1]>F[1]){J=H.tickSize-this.thumbCenterPoint.y;G=H.getTargetCoord(E[0],E[1]-J);I=[G.x,G.y];}else{if(E[1]<F[1]){J=H.tickSize+this.thumbCenterPoint.y;G=H.getTargetCoord(E[0],E[1]+J);I=[G.x,G.y];}else{}}return I;},b4MouseDown:function(E){if(!this.backgroundEnabled){return false;}this.thumb.autoOffset();this.resetThumbConstraints();},onMouseDown:function(F){if(!this.backgroundEnabled||this.isLocked()){return false;}this._mouseDown=true;var E=A.getPageX(F),G=A.getPageY(F);this.focus();this._slideStart();this.moveThumb(E,G);},onDrag:function(F){if(this.backgroundEnabled&&!this.isLocked()){var E=A.getPageX(F),G=A.getPageY(F);this.moveThumb(E,G,true,true);this.fireEvents();}},endMove:function(){this.unlock();this.fireEvents();this.moveComplete=true;this._slideEnd();},resetThumbConstraints:function(){var E=this.thumb;E.setXConstraint(E.leftConstraint,E.rightConstraint,E.xTickSize);E.setYConstraint(E.topConstraint,E.bottomConstraint,E.xTickSize);},fireEvents:function(G){var F=this.thumb,I,H,E;if(!G){F.cachePosition();}if(!this.isLocked()){if(F._isRegion){I=F.getXValue();H=F.getYValue();if(I!=this.previousX||H!=this.previousY){if(!this._silent){this.onChange(I,H);this.fireEvent("change",{x:I,y:H});}}this.previousX=I;this.previousY=H;}else{E=F.getValue();if(E!=this.previousVal){if(!this._silent){this.onChange(E);this.fireEvent("change",E);}}this.previousVal=E;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.lang.augmentProto(C,YAHOO.util.EventProvider);YAHOO.widget.Slider=C;})();YAHOO.widget.SliderThumb=function(G,B,E,D,A,F,C){if(G){YAHOO.widget.SliderThumb.superclass.constructor.call(this,G,B);this.parentElId=B;}this.isTarget=false;this.tickSize=C;this.maintainOffset=true;this.initSlider(E,D,A,F,C);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,dragOnly:true,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(C){var A=YAHOO.util.Dom.getXY(this.getEl()),B=C||YAHOO.util.Dom.getXY(this.parentElId);return[(A[0]-B[0]),(A[1]-B[1])];},getOffsetFromParent:function(H){var A=this.getEl(),E,I,F,B,K,D,C,J,G;if(!this.deltaOffset){I=YAHOO.util.Dom.getXY(A);F=H||YAHOO.util.Dom.getXY(this.parentElId);E=[(I[0]-F[0]),(I[1]-F[1])];B=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);K=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);D=B-E[0];C=K-E[1];if(isNaN(D)||isNaN(C)){}else{this.deltaOffset=[D,C];}}else{J=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);G=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);E=[J+this.deltaOffset[0],G+this.deltaOffset[1]];}return E;},initSlider:function(D,C,A,E,B){this.initLeft=D;this.initRight=C;this.initUp=A;this.initDown=E;this.setXConstraint(D,C,B);this.setYConstraint(A,E,B);if(B&&B>1){this._graduated=true;}this._isHoriz=(D||C);this._isVert=(A||E);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[0])){this.lastOffset=A;return(A[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[1])){this.lastOffset=A;return(A[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(A,B){}});(function(){var A=YAHOO.util.Event,B=YAHOO.widget;function C(I,F,H,D){var G=this,J={min:false,max:false},E,K;this.minSlider=I;this.maxSlider=F;this.activeSlider=I;this.isHoriz=I.thumb._isHoriz;E=this.minSlider.thumb.onMouseDown;K=this.maxSlider.thumb.onMouseDown;this.minSlider.thumb.onMouseDown=function(){G.activeSlider=G.minSlider;E.apply(this,arguments);};this.maxSlider.thumb.onMouseDown=function(){G.activeSlider=G.maxSlider;K.apply(this,arguments);};this.minSlider.thumb.onAvailable=function(){I.setStartSliderState();J.min=true;if(J.max){G.fireEvent("ready",G);}};this.maxSlider.thumb.onAvailable=function(){F.setStartSliderState();J.max=true;if(J.min){G.fireEvent("ready",G);}};I.onMouseDown=F.onMouseDown=function(L){return this.backgroundEnabled&&G._handleMouseDown(L); };I.onDrag=F.onDrag=function(L){G._handleDrag(L);};I.onMouseUp=F.onMouseUp=function(L){G._handleMouseUp(L);};I._bindKeyEvents=function(){G._bindKeyEvents(this);};F._bindKeyEvents=function(){};I.subscribe("change",this._handleMinChange,I,this);I.subscribe("slideStart",this._handleSlideStart,I,this);I.subscribe("slideEnd",this._handleSlideEnd,I,this);F.subscribe("change",this._handleMaxChange,F,this);F.subscribe("slideStart",this._handleSlideStart,F,this);F.subscribe("slideEnd",this._handleSlideEnd,F,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);D=YAHOO.lang.isArray(D)?D:[0,H];D[0]=Math.min(Math.max(parseInt(D[0],10)|0,0),H);D[1]=Math.max(Math.min(parseInt(D[1],10)|0,H),0);if(D[0]>D[1]){D.splice(0,2,D[1],D[0]);}this.minVal=D[0];this.maxVal=D[1];this.minSlider.setValue(this.minVal,true,true,true);this.maxSlider.setValue(this.maxVal,true,true,true);}C.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(E,D){this.fireEvent("slideStart",D);},_handleSlideEnd:function(E,D){this.fireEvent("slideEnd",D);},_handleDrag:function(D){B.Slider.prototype.onDrag.call(this.activeSlider,D);},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},_bindKeyEvents:function(D){A.on(D.id,"keydown",this._handleKeyDown,this,true);A.on(D.id,"keypress",this._handleKeyPress,this,true);},_handleKeyDown:function(D){this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments);},_handleKeyPress:function(D){this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments);},setValues:function(H,K,I,E,J){var F=this.minSlider,M=this.maxSlider,D=F.thumb,L=M.thumb,N=this,G={min:false,max:false};if(D._isHoriz){D.setXConstraint(D.leftConstraint,L.rightConstraint,D.tickSize);L.setXConstraint(D.leftConstraint,L.rightConstraint,L.tickSize);}else{D.setYConstraint(D.topConstraint,L.bottomConstraint,D.tickSize);L.setYConstraint(D.topConstraint,L.bottomConstraint,L.tickSize);}this._oneTimeCallback(F,"slideEnd",function(){G.min=true;if(G.max){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});this._oneTimeCallback(M,"slideEnd",function(){G.max=true;if(G.min){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});F.setValue(H,I,E,false);M.setValue(K,I,E,false);},setMinValue:function(F,H,I,E){var G=this.minSlider,D=this;this.activeSlider=G;D=this;this._oneTimeCallback(G,"slideEnd",function(){D.updateValue(E);setTimeout(function(){D._cleanEvent(G,"slideEnd");},0);});G.setValue(F,H,I);},setMaxValue:function(D,H,I,F){var G=this.maxSlider,E=this;this.activeSlider=G;this._oneTimeCallback(G,"slideEnd",function(){E.updateValue(F);setTimeout(function(){E._cleanEvent(G,"slideEnd");},0);});G.setValue(D,H,I);},updateValue:function(J){var E=this.minSlider.getValue(),K=this.maxSlider.getValue(),F=false,D,M,H,I,L,G;if(E!=this.minVal||K!=this.maxVal){F=true;D=this.minSlider.thumb;M=this.maxSlider.thumb;H=this.isHoriz?"x":"y";G=this.minSlider.thumbCenterPoint[H]+this.maxSlider.thumbCenterPoint[H];I=Math.max(K-G-this.minRange,0);L=Math.min(-E-G-this.minRange,0);if(this.isHoriz){I=Math.min(I,M.rightConstraint);D.setXConstraint(D.leftConstraint,I,D.tickSize);M.setXConstraint(L,M.rightConstraint,M.tickSize);}else{I=Math.min(I,M.bottomConstraint);D.setYConstraint(D.leftConstraint,I,D.tickSize);M.setYConstraint(L,M.bottomConstraint,M.tickSize);}}this.minVal=E;this.maxVal=K;if(F&&!J){this.fireEvent("change",this);}},selectActiveSlider:function(H){var E=this.minSlider,D=this.maxSlider,J=E.isLocked()||!E.backgroundEnabled,G=D.isLocked()||!E.backgroundEnabled,F=YAHOO.util.Event,I;if(J||G){this.activeSlider=J?D:E;}else{if(this.isHoriz){I=F.getPageX(H)-E.thumb.initPageX-E.thumbCenterPoint.x;}else{I=F.getPageY(H)-E.thumb.initPageY-E.thumbCenterPoint.y;}this.activeSlider=I*2>D.getValue()+E.getValue()?D:E;}},_handleMouseDown:function(D){if(!D._handled){D._handled=true;this.selectActiveSlider(D);return B.Slider.prototype.onMouseDown.call(this.activeSlider,D);}else{return false;}},_handleMouseUp:function(D){B.Slider.prototype.onMouseUp.apply(this.activeSlider,arguments);},_oneTimeCallback:function(F,D,E){F.subscribe(D,function(){F.unsubscribe(D,arguments.callee);E.apply({},[].slice.apply(arguments));});},_cleanEvent:function(K,E){var J,I,D,G,H,F;if(K.__yui_events&&K.events[E]){for(I=K.__yui_events.length;I>=0;--I){if(K.__yui_events[I].type===E){J=K.__yui_events[I];break;}}if(J){H=J.subscribers;F=[];G=0;for(I=0,D=H.length;I<D;++I){if(H[I]){F[G++]=H[I];}}J.subscribers=F;}}}};YAHOO.lang.augmentProto(C,YAHOO.util.EventProvider);B.Slider.getHorizDualSlider=function(H,J,K,G,F,D){var I=new B.SliderThumb(J,H,0,G,0,0,F),E=new B.SliderThumb(K,H,0,G,0,0,F);return new C(new B.Slider(H,H,I,"horiz"),new B.Slider(H,H,E,"horiz"),G,D);};B.Slider.getVertDualSlider=function(H,J,K,G,F,D){var I=new B.SliderThumb(J,H,0,0,0,G,F),E=new B.SliderThumb(K,H,0,0,0,G,F);return new B.DualSlider(new B.Slider(H,H,I,"vert"),new B.Slider(H,H,E,"vert"),G,D);};YAHOO.widget.DualSlider=C;})();YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name);}return A;},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};if(C){this._written=false;}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null;}return B.getValue();},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B;}}return C;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,C=YAHOO.util.AttributeProvider;var A=function(D,E){this.init.apply(this,arguments);};A.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true,"change":true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(F,D){var E=this.get("element");if(E){E[D]=F;}},DEFAULT_HTML_GETTER:function(D){var E=this.get("element"),F;if(E){F=E[D];}return F;},appendChild:function(D){D=D.get?D.get("element"):D;return this.get("element").appendChild(D);},getElementsByTagName:function(D){return this.get("element").getElementsByTagName(D);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(D,E){D=D.get?D.get("element"):D;E=(E&&E.get)?E.get("element"):E;return this.get("element").insertBefore(D,E);},removeChild:function(D){D=D.get?D.get("element"):D;return this.get("element").removeChild(D);},replaceChild:function(D,E){D=D.get?D.get("element"):D;E=E.get?E.get("element"):E;return this.get("element").replaceChild(D,E);},initAttributes:function(D){},addListener:function(H,G,I,F){var E=this.get("element")||this.get("id");F=F||this;var D=this;if(!this._events[H]){if(E&&this.DOM_EVENTS[H]){YAHOO.util.Event.addListener(E,H,function(J){if(J.srcElement&&!J.target){J.target=J.srcElement;}D.fireEvent(H,J);},I,F);}this.createEvent(H,this);}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){return this.addListener.apply(this,arguments);},subscribe:function(){return this.addListener.apply(this,arguments);},removeListener:function(E,D){return this.unsubscribe.apply(this,arguments);},addClass:function(D){B.addClass(this.get("element"),D);},getElementsByClassName:function(E,D){return B.getElementsByClassName(E,D,this.get("element"));},hasClass:function(D){return B.hasClass(this.get("element"),D);},removeClass:function(D){return B.removeClass(this.get("element"),D);},replaceClass:function(E,D){return B.replaceClass(this.get("element"),E,D);},setStyle:function(E,D){return B.setStyle(this.get("element"),E,D);},getStyle:function(D){return B.getStyle(this.get("element"),D);},fireQueue:function(){var E=this._queue;for(var F=0,D=E.length;F<D;++F){this[E[F][0]].apply(this,E[F][1]);}},appendTo:function(E,F){E=(E.get)?E.get("element"):B.get(E);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:E}); F=(F&&F.get)?F.get("element"):B.get(F);var D=this.get("element");if(!D){return false;}if(!E){return false;}if(D.parent!=E){if(F){E.insertBefore(D,F);}else{E.appendChild(D);}}this.fireEvent("appendTo",{type:"appendTo",target:E});return D;},get:function(D){var F=this._configs||{},E=F.element;if(E&&!F[D]&&!YAHOO.lang.isUndefined(E.value[D])){this._setHTMLAttrConfig(D);}return C.prototype.get.call(this,D);},setAttributes:function(J,G){var E={},H=this._configOrder;for(var I=0,D=H.length;I<D;++I){if(J[H[I]]!==undefined){E[H[I]]=true;this.set(H[I],J[H[I]],G);}}for(var F in J){if(J.hasOwnProperty(F)&&!E[F]){this.set(F,J[F],G);}}},set:function(E,G,D){var F=this.get("element");if(!F){this._queue[this._queue.length]=["set",arguments];if(this._configs[E]){this._configs[E].value=G;}return;}if(!this._configs[E]&&!YAHOO.lang.isUndefined(F[E])){this._setHTMLAttrConfig(E);}return C.prototype.set.apply(this,arguments);},setAttributeConfig:function(D,E,F){this._configOrder.push(D);C.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(E,D){this._events[E]=true;return C.prototype.createEvent.apply(this,arguments);},init:function(E,D){this._initElement(E,D);},destroy:function(){var D=this.get("element");YAHOO.util.Event.purgeElement(D,true);this.unsubscribeAll();if(D&&D.parentNode){D.parentNode.removeChild(D);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(F,E){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];E=E||{};E.element=E.element||F||null;var H=false;var D=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var G in D){if(D.hasOwnProperty(G)){this.DOM_EVENTS[G]=D[G];}}if(typeof E.element==="string"){this._setHTMLAttrConfig("id",{value:E.element});}if(B.get(E.element)){H=true;this._initHTMLElement(E);this._initContent(E);}YAHOO.util.Event.onAvailable(E.element,function(){if(!H){this._initHTMLElement(E);}this.fireEvent("available",{type:"available",target:B.get(E.element)});},this,true);YAHOO.util.Event.onContentReady(E.element,function(){if(!H){this._initContent(E);}this.fireEvent("contentReady",{type:"contentReady",target:B.get(E.element)});},this,true);},_initHTMLElement:function(D){this.setAttributeConfig("element",{value:B.get(D.element),readOnly:true});},_initContent:function(D){this.initAttributes(D);this.setAttributes(D,true);this.fireQueue();},_setHTMLAttrConfig:function(D,F){var E=this.get("element");F=F||{};F.name=D;F.setter=F.setter||this.DEFAULT_HTML_SETTER;F.getter=F.getter||this.DEFAULT_HTML_GETTER;F.value=F.value||E[D];this._configs[D]=new YAHOO.util.Attribute(F,this);}};YAHOO.augment(A,C);YAHOO.util.Element=A;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ YAHOO.util.Color=function(){var A="0",B=YAHOO.lang.isArray,C=YAHOO.lang.isNumber;return{real2dec:function(D){return Math.min(255,Math.round(D*256));},hsv2rgb:function(H,O,M){if(B(H)){return this.hsv2rgb.call(this,H[0],H[1],H[2]);}var D,I,L,G=Math.floor((H/60)%6),J=(H/60)-G,F=M*(1-O),E=M*(1-J*O),N=M*(1-(1-J)*O),K;switch(G){case 0:D=M;I=N;L=F;break;case 1:D=E;I=M;L=F;break;case 2:D=F;I=M;L=N;break;case 3:D=F;I=E;L=M;break;case 4:D=N;I=F;L=M;break;case 5:D=M;I=F;L=E;break;}K=this.real2dec;return[K(D),K(I),K(L)];},rgb2hsv:function(D,H,I){if(B(D)){return this.rgb2hsv.apply(this,D);}D/=255;H/=255;I/=255;var G,L,E=Math.min(Math.min(D,H),I),J=Math.max(Math.max(D,H),I),K=J-E,F;switch(J){case E:G=0;break;case D:G=60*(H-I)/K;if(H<I){G+=360;}break;case H:G=(60*(I-D)/K)+120;break;case I:G=(60*(D-H)/K)+240;break;}L=(J===0)?0:1-(E/J);F=[Math.round(G),L,J];return F;},rgb2hex:function(F,E,D){if(B(F)){return this.rgb2hex.apply(this,F);}var G=this.dec2hex;return G(F)+G(E)+G(D);},dec2hex:function(D){D=parseInt(D,10)|0;D=(D>255||D<0)?0:D;return(A+D.toString(16)).slice(-2).toUpperCase();},hex2dec:function(D){return parseInt(D,16);},hex2rgb:function(D){var E=this.hex2dec;return[E(D.slice(0,2)),E(D.slice(2,4)),E(D.slice(4,6))];},websafe:function(F,E,D){if(B(F)){return this.websafe.apply(this,F);}var G=function(H){if(C(H)){H=Math.min(Math.max(0,H),255);var I,J;for(I=0;I<256;I=I+51){J=I+51;if(H>=I&&H<=J){return(H-I>25)?J:I;}}}return H;};return[G(F),G(E),G(D)];}};}();(function(){var J=0,F=YAHOO.util,C=YAHOO.lang,D=YAHOO.widget.Slider,B=F.Color,E=F.Dom,I=F.Event,A=C.substitute,H="yui-picker";function G(L,K){J=J+1;K=K||{};if(arguments.length===1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element||null;}if(!L&&!K.element){L=this._createHostElement(K);}G.superclass.constructor.call(this,L,K);this.initPicker();}YAHOO.extend(G,YAHOO.util.Element,{ID:{R:H+"-r",R_HEX:H+"-rhex",G:H+"-g",G_HEX:H+"-ghex",B:H+"-b",B_HEX:H+"-bhex",H:H+"-h",S:H+"-s",V:H+"-v",PICKER_BG:H+"-bg",PICKER_THUMB:H+"-thumb",HUE_BG:H+"-hue-bg",HUE_THUMB:H+"-hue-thumb",HEX:H+"-hex",SWATCH:H+"-swatch",WEBSAFE_SWATCH:H+"-websafe-swatch",CONTROLS:H+"-controls",RGB_CONTROLS:H+"-rgb-controls",HSV_CONTROLS:H+"-hsv-controls",HEX_CONTROLS:H+"-hex-controls",HEX_SUMMARY:H+"-hex-summary",CONTROLS_LABEL:H+"-controls-label"},TXT:{ILLEGAL_HEX:"Illegal hex value entered",SHOW_CONTROLS:"Show color details",HIDE_CONTROLS:"Hide color details",CURRENT_COLOR:"Currently selected color: {rgb}",CLOSEST_WEBSAFE:"Closest websafe color: {rgb}. Click to select.",R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"},IMAGE:{PICKER_THUMB:"../../build/colorpicker/assets/picker_thumb.png",HUE_THUMB:"../../build/colorpicker/assets/hue_thumb.png"},DEFAULT:{PICKER_SIZE:180},OPT:{HUE:"hue",SATURATION:"saturation",VALUE:"value",RED:"red",GREEN:"green",BLUE:"blue",HSV:"hsv",RGB:"rgb",WEBSAFE:"websafe",HEX:"hex",PICKER_SIZE:"pickersize",SHOW_CONTROLS:"showcontrols",SHOW_RGB_CONTROLS:"showrgbcontrols",SHOW_HSV_CONTROLS:"showhsvcontrols",SHOW_HEX_CONTROLS:"showhexcontrols",SHOW_HEX_SUMMARY:"showhexsummary",SHOW_WEBSAFE:"showwebsafe",CONTAINER:"container",IDS:"ids",ELEMENTS:"elements",TXT:"txt",IMAGES:"images",ANIMATE:"animate"},skipAnim:true,_createHostElement:function(){var K=document.createElement("div");if(this.CSS.BASE){K.className=this.CSS.BASE;}return K;},_updateHueSlider:function(){var K=this.get(this.OPT.PICKER_SIZE),L=this.get(this.OPT.HUE);L=K-Math.round(L/360*K);if(L===K){L=0;}this.hueSlider.setValue(L,this.skipAnim);},_updatePickerSlider:function(){var L=this.get(this.OPT.PICKER_SIZE),M=this.get(this.OPT.SATURATION),K=this.get(this.OPT.VALUE);M=Math.round(M*L/100);K=Math.round(L-(K*L/100));this.pickerSlider.setRegionValue(M,K,this.skipAnim);},_updateSliders:function(){this._updateHueSlider();this._updatePickerSlider();},setValue:function(L,K){K=(K)||false;this.set(this.OPT.RGB,L,K);this._updateSliders();},hueSlider:null,pickerSlider:null,_getH:function(){var K=this.get(this.OPT.PICKER_SIZE),L=(K-this.hueSlider.getValue())/K;L=Math.round(L*360);return(L===360)?0:L;},_getS:function(){return this.pickerSlider.getXValue()/this.get(this.OPT.PICKER_SIZE);},_getV:function(){var K=this.get(this.OPT.PICKER_SIZE);return(K-this.pickerSlider.getYValue())/K;},_updateSwatch:function(){var M=this.get(this.OPT.RGB),O=this.get(this.OPT.WEBSAFE),N=this.getElement(this.ID.SWATCH),L=M.join(","),K=this.get(this.OPT.TXT);E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CURRENT_COLOR,{"rgb":"#"+this.get(this.OPT.HEX)});N=this.getElement(this.ID.WEBSAFE_SWATCH);L=O.join(",");E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CLOSEST_WEBSAFE,{"rgb":"#"+B.rgb2hex(O)});},_getValuesFromSliders:function(){this.set(this.OPT.RGB,B.hsv2rgb(this._getH(),this._getS(),this._getV()));},_updateFormFields:function(){this.getElement(this.ID.H).value=this.get(this.OPT.HUE);this.getElement(this.ID.S).value=this.get(this.OPT.SATURATION);this.getElement(this.ID.V).value=this.get(this.OPT.VALUE);this.getElement(this.ID.R).value=this.get(this.OPT.RED);this.getElement(this.ID.R_HEX).innerHTML=B.dec2hex(this.get(this.OPT.RED));this.getElement(this.ID.G).value=this.get(this.OPT.GREEN);this.getElement(this.ID.G_HEX).innerHTML=B.dec2hex(this.get(this.OPT.GREEN));this.getElement(this.ID.B).value=this.get(this.OPT.BLUE);this.getElement(this.ID.B_HEX).innerHTML=B.dec2hex(this.get(this.OPT.BLUE));this.getElement(this.ID.HEX).value=this.get(this.OPT.HEX);},_onHueSliderChange:function(N){var L=this._getH(),K=B.hsv2rgb(L,1,1),M="rgb("+K.join(",")+")";this.set(this.OPT.HUE,L,true);E.setStyle(this.getElement(this.ID.PICKER_BG),"background-color",M);if(this.hueSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders();}this._updateFormFields();this._updateSwatch();},_onPickerSliderChange:function(M){var L=this._getS(),K=this._getV();this.set(this.OPT.SATURATION,Math.round(L*100),true);this.set(this.OPT.VALUE,Math.round(K*100),true);if(this.pickerSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders(); }this._updateFormFields();this._updateSwatch();},_getCommand:function(K){var L=I.getCharCode(K);if(L===38){return 3;}else{if(L===13){return 6;}else{if(L===40){return 4;}else{if(L>=48&&L<=57){return 1;}else{if(L>=97&&L<=102){return 2;}else{if(L>=65&&L<=70){return 2;}else{if("8, 9, 13, 27, 37, 39".indexOf(L)>-1||K.ctrlKey||K.metaKey){return 5;}else{return 0;}}}}}}}},_useFieldValue:function(L,K,N){var M=K.value;if(N!==this.OPT.HEX){M=parseInt(M,10);}if(M!==this.get(N)){this.set(N,M);}},_rgbFieldKeypress:function(M,K,O){var N=this._getCommand(M),L=(M.shiftKey)?10:1;switch(N){case 6:this._useFieldValue.apply(this,arguments);break;case 3:this.set(O,Math.min(this.get(O)+L,255));this._updateFormFields();break;case 4:this.set(O,Math.max(this.get(O)-L,0));this._updateFormFields();break;default:}},_hexFieldKeypress:function(L,K,N){var M=this._getCommand(L);if(M===6){this._useFieldValue.apply(this,arguments);}},_hexOnly:function(L,K){var M=this._getCommand(L);switch(M){case 6:case 5:case 1:break;case 2:if(K!==true){break;}default:I.stopEvent(L);return false;}},_numbersOnly:function(K){return this._hexOnly(K,true);},getElement:function(K){return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[K]];},_createElements:function(){var N,M,P,O,L,K=this.get(this.OPT.IDS),Q=this.get(this.OPT.TXT),S=this.get(this.OPT.IMAGES),R=function(U,V){var W=document.createElement(U);if(V){C.augmentObject(W,V,true);}return W;},T=function(U,V){var W=C.merge({autocomplete:"off",value:"0",size:3,maxlength:3},V);W.name=W.id;return new R(U,W);};L=this.get("element");N=new R("div",{id:K[this.ID.PICKER_BG],className:"yui-picker-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.PICKER_THUMB],className:"yui-picker-thumb"});P=new R("img",{src:S.PICKER_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HUE_BG],className:"yui-picker-hue-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.HUE_THUMB],className:"yui-picker-hue-thumb"});P=new R("img",{src:S.HUE_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.CONTROLS],className:"yui-picker-controls"});L.appendChild(N);L=N;N=new R("div",{className:"hd"});M=new R("a",{id:K[this.ID.CONTROLS_LABEL],href:"#"});N.appendChild(M);L.appendChild(N);N=new R("div",{className:"bd"});L.appendChild(N);L=N;N=new R("ul",{id:K[this.ID.RGB_CONTROLS],className:"yui-picker-rgb-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.R+" "));O=new T("input",{id:K[this.ID.R],className:"yui-picker-r"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.G+" "));O=new T("input",{id:K[this.ID.G],className:"yui-picker-g"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.B+" "));O=new T("input",{id:K[this.ID.B],className:"yui-picker-b"});M.appendChild(O);N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HSV_CONTROLS],className:"yui-picker-hsv-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.H+" "));O=new T("input",{id:K[this.ID.H],className:"yui-picker-h"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.DEG));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.S+" "));O=new T("input",{id:K[this.ID.S],className:"yui-picker-s"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.V+" "));O=new T("input",{id:K[this.ID.V],className:"yui-picker-v"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HEX_SUMMARY],className:"yui-picker-hex_summary"});M=new R("li",{id:K[this.ID.R_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.G_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.B_HEX]});N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HEX_CONTROLS],className:"yui-picker-hex-controls"});N.appendChild(document.createTextNode(Q.HEX+" "));M=new T("input",{id:K[this.ID.HEX],className:"yui-picker-hex",size:6,maxlength:6});N.appendChild(M);L.appendChild(N);L=this.get("element");N=new R("div",{id:K[this.ID.SWATCH],className:"yui-picker-swatch"});L.appendChild(N);N=new R("div",{id:K[this.ID.WEBSAFE_SWATCH],className:"yui-picker-websafe-swatch"});L.appendChild(N);},_attachRGBHSV:function(L,K){I.on(this.getElement(L),"keydown",function(N,M){M._rgbFieldKeypress(N,this,K);},this);I.on(this.getElement(L),"keypress",this._numbersOnly,this,true);I.on(this.getElement(L),"blur",function(N,M){M._useFieldValue(N,this,K);},this);},_updateRGB:function(){var K=[this.get(this.OPT.RED),this.get(this.OPT.GREEN),this.get(this.OPT.BLUE)];this.set(this.OPT.RGB,K);this._updateSliders();},_initElements:function(){var O=this.OPT,N=this.get(O.IDS),L=this.get(O.ELEMENTS),K,M,P;for(K in this.ID){if(C.hasOwnProperty(this.ID,K)){N[this.ID[K]]=N[K];}}M=E.get(N[this.ID.PICKER_BG]);if(!M){this._createElements();}else{}for(K in N){if(C.hasOwnProperty(N,K)){M=E.get(N[K]);P=E.generateId(M);N[K]=P;N[N[K]]=P;L[P]=M;}}},initPicker:function(){this._initSliders();this._bindUI();this.syncUI(true);},_initSliders:function(){var K=this.ID,L=this.get(this.OPT.PICKER_SIZE);this.hueSlider=D.getVertSlider(this.getElement(K.HUE_BG),this.getElement(K.HUE_THUMB),0,L);this.pickerSlider=D.getSliderRegion(this.getElement(K.PICKER_BG),this.getElement(K.PICKER_THUMB),0,L,0,L);this.set(this.OPT.ANIMATE,this.get(this.OPT.ANIMATE));},_bindUI:function(){var K=this.ID,L=this.OPT;this.hueSlider.subscribe("change",this._onHueSliderChange,this,true);this.pickerSlider.subscribe("change",this._onPickerSliderChange,this,true);I.on(this.getElement(K.WEBSAFE_SWATCH),"click",function(M){this.setValue(this.get(L.WEBSAFE));},this,true);I.on(this.getElement(K.CONTROLS_LABEL),"click",function(M){this.set(L.SHOW_CONTROLS,!this.get(L.SHOW_CONTROLS));I.preventDefault(M);},this,true);this._attachRGBHSV(K.R,L.RED);this._attachRGBHSV(K.G,L.GREEN);this._attachRGBHSV(K.B,L.BLUE);this._attachRGBHSV(K.H,L.HUE); this._attachRGBHSV(K.S,L.SATURATION);this._attachRGBHSV(K.V,L.VALUE);I.on(this.getElement(K.HEX),"keydown",function(N,M){M._hexFieldKeypress(N,this,L.HEX);},this);I.on(this.getElement(this.ID.HEX),"keypress",this._hexOnly,this,true);I.on(this.getElement(this.ID.HEX),"blur",function(N,M){M._useFieldValue(N,this,L.HEX);},this);},syncUI:function(K){this.skipAnim=K;this._updateRGB();this.skipAnim=false;},_updateRGBFromHSV:function(){var L=[this.get(this.OPT.HUE),this.get(this.OPT.SATURATION)/100,this.get(this.OPT.VALUE)/100],K=B.hsv2rgb(L);this.set(this.OPT.RGB,K);this._updateSliders();},_updateHex:function(){var N=this.get(this.OPT.HEX),K=N.length,O,M,L;if(K===3){O=N.split("");for(M=0;M<K;M=M+1){O[M]=O[M]+O[M];}N=O.join("");}if(N.length!==6){return false;}L=B.hex2rgb(N);this.setValue(L);},_hideShowEl:function(M,K){var L=(C.isString(M)?this.getElement(M):M);E.setStyle(L,"display",(K)?"":"none");},initAttributes:function(K){K=K||{};G.superclass.initAttributes.call(this,K);this.setAttributeConfig(this.OPT.PICKER_SIZE,{value:K.size||this.DEFAULT.PICKER_SIZE});this.setAttributeConfig(this.OPT.HUE,{value:K.hue||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.SATURATION,{value:K.saturation||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.VALUE,{value:C.isNumber(K.value)?K.value:100,validator:C.isNumber});this.setAttributeConfig(this.OPT.RED,{value:C.isNumber(K.red)?K.red:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.GREEN,{value:C.isNumber(K.green)?K.green:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.BLUE,{value:C.isNumber(K.blue)?K.blue:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.HEX,{value:K.hex||"FFFFFF",validator:C.isString});this.setAttributeConfig(this.OPT.RGB,{value:K.rgb||[255,255,255],method:function(O){this.set(this.OPT.RED,O[0],true);this.set(this.OPT.GREEN,O[1],true);this.set(this.OPT.BLUE,O[2],true);var Q=B.websafe(O),P=B.rgb2hex(O),N=B.rgb2hsv(O);this.set(this.OPT.WEBSAFE,Q,true);this.set(this.OPT.HEX,P,true);if(N[1]){this.set(this.OPT.HUE,N[0],true);}this.set(this.OPT.SATURATION,Math.round(N[1]*100),true);this.set(this.OPT.VALUE,Math.round(N[2]*100),true);},readonly:true});this.setAttributeConfig(this.OPT.CONTAINER,{value:null,method:function(N){if(N){N.showEvent.subscribe(function(){this.pickerSlider.focus();},this,true);}}});this.setAttributeConfig(this.OPT.WEBSAFE,{value:K.websafe||[255,255,255]});var M=K.ids||C.merge({},this.ID),L;if(!K.ids&&J>1){for(L in M){if(C.hasOwnProperty(M,L)){M[L]=M[L]+J;}}}this.setAttributeConfig(this.OPT.IDS,{value:M,writeonce:true});this.setAttributeConfig(this.OPT.TXT,{value:K.txt||this.TXT,writeonce:true});this.setAttributeConfig(this.OPT.IMAGES,{value:K.images||this.IMAGE,writeonce:true});this.setAttributeConfig(this.OPT.ELEMENTS,{value:{},readonly:true});this.setAttributeConfig(this.OPT.SHOW_CONTROLS,{value:C.isBoolean(K.showcontrols)?K.showcontrols:true,method:function(N){var O=E.getElementsByClassName("bd","div",this.getElement(this.ID.CONTROLS))[0];this._hideShowEl(O,N);this.getElement(this.ID.CONTROLS_LABEL).innerHTML=(N)?this.get(this.OPT.TXT).HIDE_CONTROLS:this.get(this.OPT.TXT).SHOW_CONTROLS;}});this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS,{value:C.isBoolean(K.showrgbcontrols)?K.showrgbcontrols:true,method:function(N){this._hideShowEl(this.ID.RGB_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS,{value:C.isBoolean(K.showhsvcontrols)?K.showhsvcontrols:false,method:function(N){this._hideShowEl(this.ID.HSV_CONTROLS,N);if(N&&this.get(this.OPT.SHOW_HEX_SUMMARY)){this.set(this.OPT.SHOW_HEX_SUMMARY,false);}}});this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS,{value:C.isBoolean(K.showhexcontrols)?K.showhexcontrols:false,method:function(N){this._hideShowEl(this.ID.HEX_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_WEBSAFE,{value:C.isBoolean(K.showwebsafe)?K.showwebsafe:true,method:function(N){this._hideShowEl(this.ID.WEBSAFE_SWATCH,N);}});this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY,{value:C.isBoolean(K.showhexsummary)?K.showhexsummary:true,method:function(N){this._hideShowEl(this.ID.HEX_SUMMARY,N);if(N&&this.get(this.OPT.SHOW_HSV_CONTROLS)){this.set(this.OPT.SHOW_HSV_CONTROLS,false);}}});this.setAttributeConfig(this.OPT.ANIMATE,{value:C.isBoolean(K.animate)?K.animate:true,method:function(N){if(this.pickerSlider){this.pickerSlider.animate=N;this.hueSlider.animate=N;}}});this.on(this.OPT.HUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.SATURATION+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.VALUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.RED+"Change",this._updateRGB,this,true);this.on(this.OPT.GREEN+"Change",this._updateRGB,this,true);this.on(this.OPT.BLUE+"Change",this._updateRGB,this,true);this.on(this.OPT.HEX+"Change",this._updateHex,this,true);this._initElements();}});YAHOO.widget.ColorPicker=G;})();YAHOO.register("colorpicker",YAHOO.widget.ColorPicker,{version:"2.7.0",build:"1796"}); /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ (function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,F,E){var D=this.getEl();if(this.patterns.noNegatives.test(C)){F=(F>0)?F:0;}if("style" in D){B.Dom.setStyle(D,C,F+E);}else{if(C in D){D[C]=F;}}},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if("style" in E){if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}}else{if(C in E){G=E[C];}}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]; }return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I);});if(F){I=C.Dom.getStyle(F,E);}else{I=A.DEFAULT_BGCOLOR;}}}else{I=D.getAttribute.call(this,E);}return I;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})(); /* TERMS OF USE - EASING EQUATIONS Open source under the BSD License. Copyright 2001 Robert Penner All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]); }else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.7.0",build:"1799"});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/uicolor/yui/yui.js
yui.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('styles',{requires:['selection']});CKEDITOR.editor.prototype.attachStyleStateChange=function(a,b){var c=this._.styleStateChangeCallbacks;if(!c){c=this._.styleStateChangeCallbacks=[];this.on('selectionChange',function(d){for(var e=0;e<c.length;e++){var f=c[e],g=f.style.checkActive(d.data.path)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;if(f.state!==g){f.fn.call(this,g);f.state!==g;}}});}c.push({style:a,fn:b});};CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;(function(){var a={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1},b={a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1},c=/\s*(?:;\s*|$)/;CKEDITOR.style=function(A,B){if(B){A=CKEDITOR.tools.clone(A);v(A.attributes,B);v(A.styles,B);}var C=this.element=(A.element||'*').toLowerCase();this.type=C=='#'||a[C]?CKEDITOR.STYLE_BLOCK:b[C]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE;this._={definition:A};};CKEDITOR.style.prototype={apply:function(A){z.call(this,A,false);},remove:function(A){z.call(this,A,true);},applyToRange:function(A){var B=this;return(B.applyToRange=B.type==CKEDITOR.STYLE_INLINE?d:B.type==CKEDITOR.STYLE_BLOCK?f:null).call(B,A);},removeFromRange:function(A){return(this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?e:null).call(this,A);},applyToObject:function(A){t(A,this);},checkActive:function(A){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(A.block||A.blockLimit,true);case CKEDITOR.STYLE_INLINE:var B=A.elements;for(var C=0,D;C<B.length;C++){D=B[C];if(D==A.block||D==A.blockLimit)continue;if(this.checkElementRemovable(D,true))return true;}}return false;},checkElementRemovable:function(A,B){if(!A)return false;var C=this._.definition,D;if(A.getName()==this.element){if(!B&&!A.hasAttributes())return true;D=w(C);if(D._length){for(var E in D){if(E=='_length')continue;var F=A.getAttribute(E);if(D[E]==(E=='style'?y(F,false):F)){if(!B)return true;}else if(B)return false;}if(B)return true;}else return true;}var G=x(this)[A.getName()];if(G){if(!(D=G.attributes))return true;for(var H=0;H<D.length;H++){E=D[H][0];var I=A.getAttribute(E);if(I){var J=D[H][1];if(J===null||typeof J=='string'&&I==J||J.test(I))return true;}}}return false;}};CKEDITOR.style.getStyleText=function(A){var B=A._ST;if(B)return B;B=A.styles;var C=A.attributes&&A.attributes.style||'';if(C.length)C=C.replace(c,';');for(var D in B)C+=(D+':'+B[D]).replace(c,';');if(C.length)C=y(C);return A._ST=C;};function d(A){var aa=this;var B=A.document;if(A.collapsed){var C=s(aa,B); A.insertNode(C);A.moveToPosition(C,CKEDITOR.POSITION_BEFORE_END);return;}var D=aa.element,E=aa._.definition,F,G=CKEDITOR.dtd[D]||(F=true,CKEDITOR.dtd.span),H=A.createBookmark();A.enlarge(CKEDITOR.ENLARGE_ELEMENT);A.trim();var I=A.getBoundaryNodes(),J=I.startNode,K=I.endNode.getNextSourceNode(true);if(!K){var L;K=L=B.createText('');K.insertAfter(A.endContainer);}var M=K.getParent();if(M&&M.getAttribute('_fck_bookmark'))K=M;if(K.equals(J)){K=K.getNextSourceNode(true);if(!K){K=L=B.createText('');K.insertAfter(J);}}var N=J,O,P;while(N){var Q=false;if(N.equals(K)){N=null;Q=true;}else{var R=N.type,S=R==CKEDITOR.NODE_ELEMENT?N.getName():null;if(S&&N.getAttribute('_fck_bookmark')){N=N.getNextSourceNode(true);continue;}if(!S||G[S]&&(N.getPosition(K)|CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED)==(CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_IDENTICAL+CKEDITOR.POSITION_IS_CONTAINED)){var T=N.getParent();if(T&&((T.getDtd()||CKEDITOR.dtd.span)[D]||F)){if(!O&&(!S||!CKEDITOR.dtd.$removeEmpty[S]||(N.getPosition(K)|CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED)==(CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_IDENTICAL+CKEDITOR.POSITION_IS_CONTAINED))){O=new CKEDITOR.dom.range(B);O.setStartBefore(N);}if(R==CKEDITOR.NODE_TEXT||R==CKEDITOR.NODE_ELEMENT&&!N.getChildCount()){var U=N,V;while(!U.$.nextSibling&&(V=U.getParent(),G[V.getName()])&&((V.getPosition(J)|CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED)==(CKEDITOR.POSITION_FOLLOWING+CKEDITOR.POSITION_IDENTICAL+CKEDITOR.POSITION_IS_CONTAINED)))U=V;O.setEndAfter(U);if(!U.$.nextSibling)Q=true;if(!P)P=R!=CKEDITOR.NODE_TEXT||/[^\s\ufeff]/.test(N.getText());}}else Q=true;}else Q=true;N=N.getNextSourceNode();}if(Q&&P&&O&&!O.collapsed){var W=s(aa,B),X=O.getCommonAncestor();while(W&&X){if(X.getName()==D){for(var Y in E.attributes)if(W.getAttribute(Y)==X.getAttribute(Y))W.removeAttribute(Y);for(var Z in E.styles)if(W.getStyle(Z)==X.getStyle(Z))W.removeStyle(Z);if(!W.hasAttributes()){W=null;break;}}X=X.getParent();}if(W){O.extractContents().appendTo(W);n(aa,W);O.insertNode(W);q(W);if(!CKEDITOR.env.ie)W.$.normalize();}O=null;}}L&&L.remove();A.moveToBookmark(H);};function e(A){A.enlarge(CKEDITOR.ENLARGE_ELEMENT);var B=A.createBookmark(),C=B.startNode;if(A.collapsed){var D=new CKEDITOR.dom.elementPath(C.getParent()),E;for(var F=0,G;F<D.elements.length&&(G=D.elements[F]);F++){if(G==D.block||G==D.blockLimit)break;if(this.checkElementRemovable(G)){var H=A.checkBoundaryOfElement(G,CKEDITOR.END),I=!H&&A.checkBoundaryOfElement(G,CKEDITOR.START); if(I||H){E=G;E.match=I?'start':'end';}else{q(G);m(this,G);}}}if(E){var J=C;for(F=0;true;F++){var K=D.elements[F];if(K.equals(E))break;else if(K.match)continue;else K=K.clone();K.append(J);J=K;}J[E.match=='start'?'insertBefore':'insertAfter'](E);}}else{var L=B.endNode,M=this;function N(){var Q=new CKEDITOR.dom.elementPath(C.getParent()),R=new CKEDITOR.dom.elementPath(L.getParent()),S=null,T=null;for(var U=0;U<Q.elements.length;U++){var V=Q.elements[U];if(V==Q.block||V==Q.blockLimit)break;if(M.checkElementRemovable(V))S=V;}for(U=0;U<R.elements.length;U++){V=R.elements[U];if(V==R.block||V==R.blockLimit)break;if(M.checkElementRemovable(V))T=V;}if(T)L.breakParent(T);if(S)C.breakParent(S);};N();var O=C.getNext();while(!O.equals(L)){var P=O.getNextSourceNode();if(O.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(O)){if(O.getName()==this.element)m(this,O);else o(O,x(this)[O.getName()]);if(P.type==CKEDITOR.NODE_ELEMENT&&P.contains(C)){N();P=C.getNext();}}O=P;}}A.moveToBookmark(B);};function f(A){var B=A.createBookmark(true),C=A.createIterator();C.enforceRealBlocks=true;var D,E=A.document,F;while(D=C.getNextParagraph()){var G=s(this,E);g(D,G);}A.moveToBookmark(B);};function g(A,B){var C=B.is('pre'),D=A.is('pre'),E=C&&!D,F=!C&&D;if(E)B=l(A,B);else if(F)B=k(i(A),B);else A.moveChildren(B);B.replace(A);if(C)h(B);};function h(A){var B;if(!((B=A.getPreviousSourceNode(true,CKEDITOR.NODE_ELEMENT))&&(B.is&&B.is('pre'))))return;var C=j(B.getHtml(),/\n$/,'')+'\n\n'+j(A.getHtml(),/^\n/,'');if(CKEDITOR.env.ie)A.$.outerHTML='<pre>'+C+'</pre>';else A.setHtml(C);B.remove();};function i(A){var B=/(\S\s*)\n(?:\s|(<span[^>]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,C=A.getName(),D=j(A.getOuterHtml(),B,function(F,G,H){return G+'</pre>'+H+'<pre>';}),E=[];D.replace(/<pre>([\s\S]*?)<\/pre>/gi,function(F,G){E.push(G);});return E;};function j(A,B,C){var D='',E='';A=A.replace(/(^<span[^>]+_fck_bookmark.*?\/span>)|(<span[^>]+_fck_bookmark.*?\/span>$)/gi,function(F,G,H){G&&(D=G);H&&(E=H);return '';});return D+A.replace(B,C)+E;};function k(A,B){var C=new CKEDITOR.dom.documentFragment(B.getDocument());for(var D=0;D<A.length;D++){var E=A[D];E=E.replace(/(\r\n|\r)/g,'\n');E=j(E,/^[ \t]*\n/,'');E=j(E,/\n$/,'');E=j(E,/^[ \t]+|[ \t]+$/g,function(G,H,I){if(G.length==1)return '&nbsp;';else if(!H)return CKEDITOR.tools.repeat('&nbsp;',G.length-1)+' ';else return ' '+CKEDITOR.tools.repeat('&nbsp;',G.length-1);});E=E.replace(/\n/g,'<br>');E=E.replace(/[ \t]{2,}/g,function(G){return CKEDITOR.tools.repeat('&nbsp;',G.length-1)+' '; });var F=B.clone();F.setHtml(E);C.append(F);}return C;};function l(A,B){var C=A.getHtml();C=j(C,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');C=C.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,'$1');C=C.replace(/([ \t\n\r]+|&nbsp;)/g,' ');C=C.replace(/<br\b[^>]*>/gi,'\n');if(CKEDITOR.env.ie){var D=A.getDocument().createElement('div');D.append(B);B.$.outerHTML='<pre>'+C+'</pre>';B=D.getFirst().remove();}else B.setHtml(C);return B;};function m(A,B){var C=A._.definition,D=C.attributes,E=C.styles,F=x(A);function G(){for(var I in D){if(I=='class'&&B.getAttribute(I)!=D[I])continue;B.removeAttribute(I);}};G();for(var H in E)B.removeStyle(H);D=F[B.getName()];if(D)G();p(B);};function n(A,B){var C=A._.definition,D=C.attributes,E=C.styles,F=x(A),G=B.getElementsByTag(A.element);for(var H=G.count();--H>=0;)m(A,G.getItem(H));for(var I in F)if(I!=A.element){G=B.getElementsByTag(I);for(H=G.count()-1;H>=0;H--){var J=G.getItem(H);o(J,F[I]);}}};function o(A,B){var C=B&&B.attributes;if(C)for(var D=0;D<C.length;D++){var E=C[D][0],F;if(F=A.getAttribute(E)){var G=C[D][1];if(G===null||G.test&&G.test(F)||typeof G=='string'&&F==G)A.removeAttribute(E);}}p(A);};function p(A){if(!A.hasAttributes()){var B=A.getFirst(),C=A.getLast();A.remove(true);if(B){q(B);if(C&&!B.equals(C))q(C);}}};function q(A){if(!A||A.type!=CKEDITOR.NODE_ELEMENT||!CKEDITOR.dtd.$removeEmpty[A.getName()])return;r(A,A.getNext(),true);r(A,A.getPrevious());};function r(A,B,C){if(B&&B.type==CKEDITOR.NODE_ELEMENT){var D=B.getAttribute('_fck_bookmark');if(D)B=C?B.getNext():B.getPrevious();if(B&&B.type==CKEDITOR.NODE_ELEMENT&&A.isIdentical(B)){var E=C?A.getLast():A.getFirst();if(D)(C?B.getPrevious():B.getNext()).move(A,!C);B.moveChildren(A,!C);B.remove();if(E)q(E);}}};function s(A,B){var C,D=A._.definition,E=A.element;if(E=='*')E='span';C=new CKEDITOR.dom.element(E,B);return t(C,A);};function t(A,B){var C=B._.definition,D=C.attributes,E=CKEDITOR.style.getStyleText(C);if(D)for(var F in D)A.setAttribute(F,D[F]);if(E)A.setAttribute('style',E);return A;};var u=/#\((.+?)\)/g;function v(A,B){for(var C in A)A[C]=A[C].replace(u,function(D,E){return B[E];});};function w(A){var B=A._AC;if(B)return B;B={};var C=0,D=A.attributes;if(D)for(var E in D){C++;B[E]=D[E];}var F=CKEDITOR.style.getStyleText(A);if(F){if(!B.style)C++;B.style=F;}B._length=C;return A._AC=B;};function x(A){if(A._.overrides)return A._.overrides;var B=A._.overrides={},C=A._.definition.overrides;if(C){if(!CKEDITOR.tools.isArray(C))C=[C];for(var D=0;D<C.length;D++){var E=C[D],F,G,H; if(typeof E=='string')F=E.toLowerCase();else{F=E.element?E.element.toLowerCase():A.element;H=E.attributes;}G=B[F]||(B[F]={});if(H){var I=G.attributes=G.attributes||[];for(var J in H)I.push([J.toLowerCase(),H[J]]);}}}return B;};function y(A,B){var C;if(B!==false){var D=new CKEDITOR.dom.element('span');D.setAttribute('style',A);C=D.getAttribute('style');}else C=A;return C.replace(/\s*([;:])\s*/,'$1').replace(/([^\s;])$/,'$1;').replace(/,\s+/g,',').toLowerCase();};function z(A,B){var C=A.getSelection(),D=C.getRanges(),E=B?this.removeFromRange:this.applyToRange;for(var F=0;F<D.length;F++)E.call(this,D[F]);C.selectRanges(D);};})();CKEDITOR.styleCommand=function(a){this.style=a;};CKEDITOR.styleCommand.prototype.exec=function(a){var c=this;a.focus();var b=a.document;if(b)if(c.state==CKEDITOR.TRISTATE_OFF)c.style.apply(b);else if(c.state==CKEDITOR.TRISTATE_ON)c.style.remove(b);return!!b;};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/styles/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('a11yHelp',function(a){var b=a.lang.accessibilityHelp,c=CKEDITOR.tools.getNextId(),d={8:'BACKSPACE',9:'TAB',13:'ENTER',16:'SHIFT',17:'CTRL',18:'ALT',19:'PAUSE',20:'CAPSLOCK',27:'ESCAPE',33:'PAGE UP',34:'PAGE DOWN',35:'END',36:'HOME',37:'LEFT ARROW',38:'UP ARROW',39:'RIGHT ARROW',40:'DOWN ARROW',45:'INSERT',46:'DELETE',91:'LEFT WINDOW KEY',92:'RIGHT WINDOW KEY',93:'SELECT KEY',96:'NUMPAD 0',97:'NUMPAD 1',98:'NUMPAD 2',99:'NUMPAD 3',100:'NUMPAD 4',101:'NUMPAD 5',102:'NUMPAD 6',103:'NUMPAD 7',104:'NUMPAD 8',105:'NUMPAD 9',106:'MULTIPLY',107:'ADD',109:'SUBTRACT',110:'DECIMAL POINT',111:'DIVIDE',112:'F1',113:'F2',114:'F3',115:'F4',116:'F5',117:'F6',118:'F7',119:'F8',120:'F9',121:'F10',122:'F11',123:'F12',144:'NUM LOCK',145:'SCROLL LOCK',186:'SEMI-COLON',187:'EQUAL SIGN',188:'COMMA',189:'DASH',190:'PERIOD',191:'FORWARD SLASH',192:'GRAVE ACCENT',219:'OPEN BRACKET',220:'BACK SLASH',221:'CLOSE BRAKET',222:'SINGLE QUOTE'};d[CKEDITOR.ALT]='ALT';d[CKEDITOR.SHIFT]='SHIFT';d[CKEDITOR.CTRL]='CTRL';var e=[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL];function f(j){var k,l,m=[];for(var n=0;n<e.length;n++){l=e[n];k=j/e[n];if(k>1&&k<=2){j-=l;m.push(d[l]);}}m.push(d[j]||String.fromCharCode(j));return m.join('+');};var g=/\$\{(.*?)\}/g;function h(j,k){var l=a.config.keystrokes,m,n=l.length;for(var o=0;o<n;o++){m=l[o];if(m[1]==k)break;}return f(m[0]);};function i(){var j='<div class="cke_accessibility_legend" role="document" aria-labelledby="'+c+'_arialbl" tabIndex="-1">%1</div>'+'<span id="'+c+'_arialbl" class="cke_voice_label">'+b.contents+' </span>',k='<h1>%1</h1><dl>%2</dl>',l='<dt>%1</dt><dd>%2</dd>',m=[],n=b.legend,o=n.length;for(var p=0;p<o;p++){var q=n[p],r=[],s=q.items,t=s.length;for(var u=0;u<t;u++){var v=s[u],w;w=l.replace('%1',v.name).replace('%2',v.legend.replace(g,h));r.push(w);}m.push(k.replace('%1',q.name).replace('%2',r.join('')));}return j.replace('%1',m.join(''));};return{title:b.title,minWidth:600,minHeight:400,contents:[{id:'info',label:a.lang.common.generalTab,expand:true,elements:[{type:'html',id:'legends',focus:function(){},html:i()+'<style type="text/css">'+'.cke_accessibility_legend'+'{'+'width:600px;'+'height:400px;'+'padding-right:5px;'+'overflow-y:auto;'+'overflow-x:hidden;'+'}'+'.cke_accessibility_legend h1'+'{'+'font-size: 20px;'+'border-bottom: 1px solid #AAA;'+'margin: 5px 0px 15px;'+'}'+'.cke_accessibility_legend dl'+'{'+'margin-left: 5px;'+'}'+'.cke_accessibility_legend dt'+'{'+'font-size: 13px;'+'font-weight: bold;'+'}'+'.cke_accessibility_legend dd'+'{'+'white-space:normal;'+'margin:10px'+'}'+'</style>'}]}],buttons:[CKEDITOR.dialog.cancelButton]}; });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/a11yhelp/dialogs/a11yhelp.js
a11yhelp.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('a11yhelp','en',{accessibilityHelp:{title:'Accessibility Instructions',contents:'Help Contents. To close this dialog press ESC.',legend:[{name:'General',items:[{name:'Editor Toolbar',legend:'Press ${toolbarFocus} to navigate to the toolbar. Move to next toolbar button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button.'},{name:'Editor Dialog',legend:'Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page.'},{name:'Editor Context Menu',legend:'Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option wtih SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC.'},{name:'Editor List Box',legend:'Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.'},{name:'Editor Element Path Bar',legend:'Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor.'}]},{name:'Commands',items:[{name:' Undo command',legend:'Press ${undo}'},{name:' Redo command',legend:'Press ${redo}'},{name:' Bold command',legend:'Press ${bold}'},{name:' Italic command',legend:'Press ${italic}'},{name:' Underline command',legend:'Press ${underline}'},{name:' Link command',legend:'Press ${link}'},{name:' Toolbar Collapse command',legend:'Press ${toolbarCollapse}'},{name:' Accessibility Help',legend:'Press ${a11yHelp}'}]}]}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/a11yhelp/lang/en.js
en.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('a11yhelp','he',{accessibilityHelp:{title:'הוראות נגישות',contents:'הוראות נגישות. לסגירה לחץ אסקייפ (ESC).',legend:[{name:'כללי',items:[{name:'סרגל הכלים',legend:'לחץ על ${toolbarFocus} כדי לנווט לסרגל הכלים. עבור לכפתור הבא עם מקש הטאב (TAB) או חץ שמאלי. עבור לכפתור הקודם עם מקש השיפט (SHIFT) + טאב (TAB) או חץ ימני. לחץ רווח או אנטר (ENTER) כדי להפעיל את הכפתור הנבחר.'},{name:'דיאלוגים (חלונות תשאול)',legend:'בתוך דיאלוג, לחץ טאב (TAB) כדי לנווט לשדה הבא, לחץ שיפט (SHIFT) + טאב (TAB) כדי לנווט לשדה הקודם, לחץ אנטר (ENTER) כדי לשלוח את הדיאלוג, לחץ אסקייפ (ESC) כדי לבטל. בתוך דיאלוגים בעלי מספר טאבים (לשוניות), לחץ אלט (ALT) + F10 כדי לנווט לשורת הטאבים. נווט לטאב הבא עם טאב (TAB) או חץ שמאלי. עבור לטאב הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. לחץ רווח או אנטר (ENTER) כדי להיכנס לטאב.'},{name:'תפריט ההקשר (Context Menu)',legend:'לחץ ${contextMenu} או APPLICATION KEYכדי לפתוח את תפריט ההקשר. עבור לאפשרות הבאה עם טאב (TAB) או חץ למטה. עבור לאפשרות הקודמת עם שיפט (SHIFT) + טאב (TAB) או חץ למעלה. לחץ רווח או אנטר (ENTER) כדי לבחור את האפשרות. פתח את תת התפריט (Sub-menu) של האפשרות הנוכחית עם רווח או אנטר (ENTER) או חץ שמאלי. חזור לתפריט האב עם אסקייפ (ESC) או חץ שמאלי. סגור את תפריט ההקשר עם אסקייפ (ESC).'},{name:'תפריטים צפים (List boxes)',legend:'בתוך תפריט צף, עבור לפריט הבא עם טאב (TAB) או חץ למטה. עבור לתפריט הקודם עם שיפט (SHIFT) + טאב (TAB) or חץ עליון. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.'},{name:'עץ אלמנטים (Elements Path)',legend:'לחץ ${elementsPathFocus} כדי לנווט לעץ האלמנטים. עבור לפריט הבא עם טאב (TAB) או חץ ימני. עבור לפריט הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. לחץ רווח או אנטר (ENTER) כדי לבחור את האלמנט בעורך.'}]},{name:'פקודות',items:[{name:' ביטול צעד אחרון',legend:'לחץ ${undo}'},{name:' חזרה על צעד אחרון',legend:'לחץ ${redo}'},{name:' הדגשה',legend:'לחץ ${bold}'},{name:' הטייה',legend:'לחץ ${italic}'},{name:' הוספת קו תחתון',legend:'לחץ ${underline}'},{name:' הוספת לינק',legend:'לחץ ${link}'},{name:' כיווץ סרגל הכלים',legend:'לחץ ${toolbarCollapse}'},{name:' הוראות נגישות',legend:'לחץ ${a11yHelp}'}]}]}});CKEDITOR.plugins.setLang('a11yhelp','he',{accessibilityHelp:{title:'הוראות נגישות',contents:'הוראות נגישות. לסגירה לחץ אסקייפ (ESC).',legend:[{name:'כללי',items:[{name:'סרגל הכלים',legend:'לחץ על ${toolbarFocus} כדי לנווט לסרגל הכלים. עבור לכפתור הבא עם מקש הטאב (TAB) או חץ שמאלי. עבור לכפתור הקודם עם מקש השיפט (SHIFT) + טאב (TAB) או חץ ימני. לחץ רווח או אנטר (ENTER) כדי להפעיל את הכפתור הנבחר.'},{name:'דיאלוגים (חלונות תשאול)',legend:'בתוך דיאלוג, לחץ טאב (TAB) כדי לנווט לשדה הבא, לחץ שיפט (SHIFT) + טאב (TAB) כדי לנווט לשדה הקודם, לחץ אנטר (ENTER) כדי לשלוח את הדיאלוג, לחץ אסקייפ (ESC) כדי לבטל. בתוך דיאלוגים בעלי מספר טאבים (לשוניות), לחץ אלט (ALT) + F10 כדי לנווט לשורת הטאבים. נווט לטאב הבא עם טאב (TAB) או חץ שמאלי. עבור לטאב הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. לחץ רווח או אנטר (ENTER) כדי להיכנס לטאב.'},{name:'תפריט ההקשר (Context Menu)',legend:'לחץ ${contextMenu} או APPLICATION KEYכדי לפתוח את תפריט ההקשר. עבור לאפשרות הבאה עם טאב (TAB) או חץ למטה. עבור לאפשרות הקודמת עם שיפט (SHIFT) + טאב (TAB) או חץ למעלה. לחץ רווח או אנטר (ENTER) כדי לבחור את האפשרות. פתח את תת התפריט (Sub-menu) של האפשרות הנוכחית עם רווח או אנטר (ENTER) או חץ שמאלי. חזור לתפריט האב עם אסקייפ (ESC) או חץ שמאלי. סגור את תפריט ההקשר עם אסקייפ (ESC).'},{name:'תפריטים צפים (List boxes)',legend:'בתוך תפריט צף, עבור לפריט הבא עם טאב (TAB) או חץ למטה. עבור לתפריט הקודם עם שיפט (SHIFT) + טאב (TAB) or חץ עליון. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.'},{name:'עץ אלמנטים (Elements Path)',legend:'לחץ ${elementsPathFocus} כדי לנווט לעץ האלמנטים. עבור לפריט הבא עם טאב (TAB) או חץ ימני. עבור לפריט הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. לחץ רווח או אנטר (ENTER) כדי לבחור את האלמנט בעורך.'}]},{name:'פקודות',items:[{name:' ביטול צעד אחרון',legend:'לחץ ${undo}'},{name:' חזרה על צעד אחרון',legend:'לחץ ${redo}'},{name:' הדגשה',legend:'לחץ ${bold}'},{name:' הטייה',legend:'לחץ ${italic}'},{name:' הוספת קו תחתון',legend:'לחץ ${underline}'},{name:' הוספת לינק',legend:'לחץ ${link}'},{name:' כיווץ סרגל הכלים',legend:'לחץ ${toolbarCollapse}'},{name:' הוראות נגישות',legend:'לחץ ${a11yHelp}'}]}]}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/a11yhelp/lang/he.js
he.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(f){if(!f||f.type!=CKEDITOR.NODE_ELEMENT||f.getName()!='form')return[];var g=[],h=['style','className'];for(var i=0;i<h.length;i++){var j=h[i],k=f.$.elements.namedItem(j);if(k){var l=new CKEDITOR.dom.element(k);g.push([l,l.nextSibling]);l.remove();}}return g;};function b(f,g){if(!f||f.type!=CKEDITOR.NODE_ELEMENT||f.getName()!='form')return;if(g.length>0)for(var h=g.length-1;h>=0;h--){var i=g[h][0],j=g[h][1];if(j)i.insertBefore(j);else i.appendTo(f);}};function c(f,g){var h=a(f),i={},j=f.$;if(!g){i['class']=j.className||'';j.className='';}i.inline=j.style.cssText||'';if(!g)j.style.cssText='position: static; overflow: visible';b(h);return i;};function d(f,g){var h=a(f),i=f.$;if('class' in g)i.className=g['class'];if('inline' in g)i.style.cssText=g.inline;b(h);};function e(f,g){return function(){var h=f.getViewPaneSize();g.resize(h.width,h.height,null,true);};};CKEDITOR.plugins.add('maximize',{init:function(f){var g=f.lang,h=CKEDITOR.document,i=h.getWindow(),j,k,l,m=e(i,f),n=CKEDITOR.TRISTATE_OFF;f.addCommand('maximize',{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var B=this;var o=f.container.getChild([0,0]),p=f.getThemeSpace('contents');if(f.mode=='wysiwyg'){var q=f.getSelection();j=q&&q.getRanges();k=i.getScrollPosition();}else{var r=f.textarea.$;j=!CKEDITOR.env.ie&&[r.selectionStart,r.selectionEnd];k=[r.scrollLeft,r.scrollTop];}if(B.state==CKEDITOR.TRISTATE_OFF){i.on('resize',m);l=i.getScrollPosition();var s=f.container;while(s=s.getParent()){s.setCustomData('maximize_saved_styles',c(s));s.setStyle('z-index',f.config.baseFloatZIndex-1);}p.setCustomData('maximize_saved_styles',c(p,true));o.setCustomData('maximize_saved_styles',c(o,true));if(CKEDITOR.env.ie)h.$.documentElement.style.overflow=h.getBody().$.style.overflow='hidden';else h.getBody().setStyles({overflow:'hidden',width:'0px',height:'0px'});i.$.scrollTo(0,0);var t=i.getViewPaneSize();o.setStyle('position','absolute');o.$.offsetLeft;o.setStyles({'z-index':f.config.baseFloatZIndex-1,left:'0px',top:'0px'});f.resize(t.width,t.height,null,true);var u=o.getDocumentPosition();o.setStyles({left:-1*u.x+'px',top:-1*u.y+'px'});o.addClass('cke_maximized');}else if(B.state==CKEDITOR.TRISTATE_ON){i.removeListener('resize',m);var v=[p,o];for(var w=0;w<v.length;w++){d(v[w],v[w].getCustomData('maximize_saved_styles'));v[w].removeCustomData('maximize_saved_styles');}s=f.container;while(s=s.getParent()){d(s,s.getCustomData('maximize_saved_styles'));s.removeCustomData('maximize_saved_styles'); }i.$.scrollTo(l.x,l.y);o.removeClass('cke_maximized');f.fire('resize');}B.toggleState();var x=B.uiItems[0],y=B.state==CKEDITOR.TRISTATE_OFF?g.maximize:g.minimize,z=f.element.getDocument().getById(x._.id);z.getChild(1).setHtml(y);z.setAttribute('title',y);z.setAttribute('href','javascript:void("'+y+'");');if(f.mode=='wysiwyg'){if(j){f.getSelection().selectRanges(j);var A=f.getSelection().getStartElement();A&&A.scrollIntoView(true);}else i.$.scrollTo(k.x,k.y);}else{if(j){r.selectionStart=j[0];r.selectionEnd=j[1];}r.scrollLeft=k[0];r.scrollTop=k[1];}j=k=null;n=B.state;},canUndo:false});f.ui.addButton('Maximize',{label:g.maximize,command:'maximize'});f.on('mode',function(){f.getCommand('maximize').setState(n);},null,null,100);}});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/maximize/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('smiley',function(a){var b=a.config,c=a.lang.smiley,d=b.smiley_images,e=b.smiley_columns||8,f,g,h=function(o){var p=o.data.getTarget(),q=p.getName();if(q=='a')p=p.getChild(0);else if(q!='img')return;var r=p.getAttribute('cke_src'),s=p.getAttribute('title'),t=a.document.createElement('img',{attributes:{src:r,'data-cke-saved-src':r,title:s,alt:s,width:p.$.width,height:p.$.height}});a.insertElement(t);g.hide();o.data.preventDefault();},i=CKEDITOR.tools.addFunction(function(o,p){o=new CKEDITOR.dom.event(o);p=new CKEDITOR.dom.element(p);var q,r,s=o.getKeystroke(),t=a.lang.dir=='rtl';switch(s){case 38:if(q=p.getParent().getParent().getPrevious()){r=q.getChild([p.getParent().getIndex(),0]);r.focus();}o.preventDefault();break;case 40:if(q=p.getParent().getParent().getNext()){r=q.getChild([p.getParent().getIndex(),0]);if(r)r.focus();}o.preventDefault();break;case 32:h({data:o});o.preventDefault();break;case t?37:39:case 9:if(q=p.getParent().getNext()){r=q.getChild(0);r.focus();o.preventDefault(true);}else if(q=p.getParent().getParent().getNext()){r=q.getChild([0,0]);if(r)r.focus();o.preventDefault(true);}break;case t?39:37:case CKEDITOR.SHIFT+9:if(q=p.getParent().getPrevious()){r=q.getChild(0);r.focus();o.preventDefault(true);}else if(q=p.getParent().getParent().getPrevious()){r=q.getLast().getChild(0);r.focus();o.preventDefault(true);}break;default:return;}}),j=CKEDITOR.tools.getNextId()+'_smiley_emtions_label',k=['<div><span id="'+j+'" class="cke_voice_label">'+c.options+'</span>','<table role="listbox" aria-labelledby="'+j+'" style="width:100%;height:100%" cellspacing="2" cellpadding="2"',CKEDITOR.env.ie&&CKEDITOR.env.quirks?' style="position:absolute;"':'','><tbody>'],l=d.length;for(f=0;f<l;f++){if(f%e===0)k.push('<tr>');var m='cke_smile_label_'+f+'_'+CKEDITOR.tools.getNextNumber();k.push('<td class="cke_dark_background cke_centered" style="vertical-align: middle;"><a href="javascript:void(0)" role="option"',' aria-posinset="'+(f+1)+'"',' aria-setsize="'+l+'"',' aria-labelledby="'+m+'"',' class="cke_smile cke_hand" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ',i,', event, this );">','<img class="cke_hand" title="',b.smiley_descriptions[f],'" cke_src="',CKEDITOR.tools.htmlEncode(b.smiley_path+d[f]),'" alt="',b.smiley_descriptions[f],'"',' src="',CKEDITOR.tools.htmlEncode(b.smiley_path+d[f]),'"',CKEDITOR.env.ie?" onload=\"this.setAttribute('width', 2); this.removeAttribute('width');\" ":'','><span id="'+m+'" class="cke_voice_label">'+b.smiley_descriptions[f]+'</span>'+'</a>','</td>'); if(f%e==e-1)k.push('</tr>');}if(f<e-1){for(;f<e-1;f++)k.push('<td></td>');k.push('</tr>');}k.push('</tbody></table></div>');var n={type:'html',html:k.join(''),onLoad:function(o){g=o.sender;},focus:function(){var o=this;setTimeout(function(){var p=o.getElement().getElementsByTag('a').getItem(0);p.focus();},0);},onClick:h,style:'width: 100%; border-collapse: separate;'};return{title:a.lang.smiley.title,minWidth:270,minHeight:120,contents:[{id:'tab1',label:'',title:'',expand:true,padding:0,elements:[n]}],buttons:[CKEDITOR.dialog.cancelButton]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/smiley/dialogs/smiley.js
smiley.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('button',{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler);}});CKEDITOR.UI_BUTTON=1;CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,className:a.className||a.command&&'cke_button_'+a.command||'',click:a.click||(function(b){b.execCommand(a.command);})});this._={};};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a);}};CKEDITOR.ui.button.prototype={canGroup:true,render:function(a,b){var c=CKEDITOR.env,d=this._.id='cke_'+CKEDITOR.tools.getNextNumber();this._.editor=a;var e={id:d,button:this,editor:a,focus:function(){var k=CKEDITOR.document.getById(d);k.focus();},execute:function(){this.button.click(a);}},f=CKEDITOR.tools.addFunction(e.execute,e),g=CKEDITOR.ui.button._.instances.push(e)-1,h='',i=this.command;if(this.modes)a.on('mode',function(){this.setState(this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);},this);else if(i){i=a.getCommand(i);if(i){i.on('state',function(){this.setState(i.state);},this);h+='cke_'+(i.state==CKEDITOR.TRISTATE_ON?'on':i.state==CKEDITOR.TRISTATE_DISABLED?'disabled':'off');}}if(!i)h+='cke_off';if(this.className)h+=' '+this.className;b.push('<span class="cke_button">','<a id="',d,'" class="',h,'" href="javascript:void(\'',(this.title||'').replace("'",''),'\')" title="',this.title,'" tabindex="-1" hidefocus="true"');if(c.opera||c.gecko&&c.mac)b.push(' onkeypress="return false;"');if(c.gecko)b.push(' onblur="this.style.cssText = this.style.cssText;"');b.push(' onkeydown="return CKEDITOR.ui.button._.keydown(',g,', event);" onfocus="return CKEDITOR.ui.button._.focus(',g,', event);" onclick="CKEDITOR.tools.callFunction(',f,', this); return false;"><span class="cke_icon"');if(this.icon){var j=(this.iconOffset||0)*(-16);b.push(' style="background-image:url(',CKEDITOR.getUrl(this.icon),');background-position:0 '+j+'px;"');}b.push('></span><span class="cke_label">',this.label,'</span>');if(this.hasArrow)b.push('<span class="cke_buttonarrow"></span>');b.push('</a>','</span>');if(this.onRender)this.onRender();return e;},setState:function(a){var f=this;if(f._.state==a)return;var b=CKEDITOR.document.getById(f._.id);if(b){b.setState(a);var c=f.title,d=f._.editor.lang.common.unavailable,e=b.getChild(1);if(a==CKEDITOR.TRISTATE_DISABLED)c=d.replace('%1',f.title);e.setHtml(c);}f._.state=a;}};CKEDITOR.ui.button._={instances:[],keydown:function(a,b){var c=CKEDITOR.ui.button._.instances[a];if(c.onkey){b=new CKEDITOR.dom.event(b); return c.onkey(c,b.getKeystroke())!==false;}},focus:function(a,b){var c=CKEDITOR.ui.button._.instances[a],d;if(c.onfocus)d=c.onfocus(c,new CKEDITOR.dom.event(b))!==false;if(CKEDITOR.env.gecko&&CKEDITOR.env.version<10900)b.preventBubble();return d;}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b);};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/button/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(){var k=this;try{var h=k.getSelection();if(!h)return;var i=h.getStartElement(),j=new CKEDITOR.dom.elementPath(i);if(!j.compare(k._.selectionPreviousPath)){k._.selectionPreviousPath=j;k.fire('selectionChange',{selection:h,path:j,element:i});}}catch(l){}};var b,c;function d(){c=true;if(b)return;e.call(this);b=CKEDITOR.tools.setTimeout(e,200,this);};function e(){b=null;if(c){CKEDITOR.tools.setTimeout(a,0,this);c=false;}};var f={exec:function(h){switch(h.mode){case 'wysiwyg':h.document.$.execCommand('SelectAll',false,null);break;case 'source':}},canUndo:false};CKEDITOR.plugins.add('selection',{init:function(h){h.on('contentDom',function(){var i=h.document;if(CKEDITOR.env.ie){var j,k;i.on('focusin',function(){if(j){try{j.select();}catch(n){}j=null;}});h.window.on('focus',function(){k=true;m();});h.document.on('beforedeactivate',function(){k=false;h.document.$.execCommand('Unselect');});i.on('mousedown',l);i.on('mouseup',function(){k=true;setTimeout(function(){m(true);},0);});i.on('keydown',l);i.on('keyup',function(){k=true;m();});i.on('selectionchange',m);function l(){k=false;};function m(n){if(k){var o=h.document,p=o&&o.$.selection;if(n&&p&&p.type=='None')if(!o.$.queryCommandEnabled('InsertImage')){CKEDITOR.tools.setTimeout(m,50,this,true);return;}j=p&&p.createRange();d.call(h);}};}else{i.on('mouseup',d,h);i.on('keyup',d,h);}});h.addCommand('selectAll',f);h.ui.addButton('SelectAll',{label:h.lang.selectAll,command:'selectAll'});h.selectionChange=d;}});CKEDITOR.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};CKEDITOR.dom.document.prototype.getSelection=function(){var h=new CKEDITOR.dom.selection(this);return!h||h.isInvalid?null:h;};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(h){var k=this;var i=h.getCustomData('cke_locked_selection');if(i)return i;k.document=h;k.isLocked=false;k._={cache:{}};if(CKEDITOR.env.ie){var j=k.getNative().createRange();if(!j||j.item&&j.item(0).ownerDocument!=k.document.$||j.parentElement&&j.parentElement().ownerDocument!=k.document.$)k.isInvalid=true;}return k;};var g={img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype={getNative:CKEDITOR.env.ie?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection); }:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:CKEDITOR.env.ie?function(){var h=this._.cache;if(h.type)return h.type;var i=CKEDITOR.SELECTION_NONE;try{var j=this.getNative(),k=j.type;if(k=='Text')i=CKEDITOR.SELECTION_TEXT;if(k=='Control')i=CKEDITOR.SELECTION_ELEMENT;if(j.createRange().parentElement)i=CKEDITOR.SELECTION_TEXT;}catch(l){}return h.type=i;}:function(){var h=this._.cache;if(h.type)return h.type;var i=CKEDITOR.SELECTION_TEXT,j=this.getNative();if(!j)i=CKEDITOR.SELECTION_NONE;else if(j.rangeCount==1){var k=j.getRangeAt(0),l=k.startContainer;if(l==k.endContainer&&l.nodeType==1&&k.endOffset-k.startOffset==1&&g[l.childNodes[k.startOffset].nodeName.toLowerCase()])i=CKEDITOR.SELECTION_ELEMENT;}return h.type=i;},getRanges:CKEDITOR.env.ie?(function(){var h=function(i,j){i=i.duplicate();i.collapse(j);var k=i.parentElement(),l=k.childNodes,m;for(var n=0;n<l.length;n++){var o=l[n];if(o.nodeType==1){m=i.duplicate();m.moveToElementText(o);m.collapse();var p=m.compareEndPoints('StartToStart',i);if(p>0)break;else if(p===0)return{container:k,offset:n};m=null;}}if(!m){m=i.duplicate();m.moveToElementText(k);m.collapse(false);}m.setEndPoint('StartToStart',i);var q=m.text.replace(/(\r\n|\r)/g,'\n').length;while(q>0)q-=l[--n].nodeValue.length;if(q===0)return{container:k,offset:n};else return{container:l[n],offset:-q};};return function(){var t=this;var i=t._.cache;if(i.ranges)return i.ranges;var j=t.getNative(),k=j&&j.createRange(),l=t.getType(),m;if(!j)return[];if(l==CKEDITOR.SELECTION_TEXT){m=new CKEDITOR.dom.range(t.document);var n=h(k,true);m.setStart(new CKEDITOR.dom.node(n.container),n.offset);n=h(k);m.setEnd(new CKEDITOR.dom.node(n.container),n.offset);return i.ranges=[m];}else if(l==CKEDITOR.SELECTION_ELEMENT){var o=t._.cache.ranges=[];for(var p=0;p<k.length;p++){var q=k.item(p),r=q.parentNode,s=0;m=new CKEDITOR.dom.range(t.document);for(;s<r.childNodes.length&&r.childNodes[s]!=q;s++){}m.setStart(new CKEDITOR.dom.node(r),s);m.setEnd(new CKEDITOR.dom.node(r),s+1);o.push(m);}return o;}return i.ranges=[];};})():function(){var h=this._.cache;if(h.ranges)return h.ranges;var i=[],j=this.getNative();if(!j)return[];for(var k=0;k<j.rangeCount;k++){var l=j.getRangeAt(k),m=new CKEDITOR.dom.range(this.document);m.setStart(new CKEDITOR.dom.node(l.startContainer),l.startOffset);m.setEnd(new CKEDITOR.dom.node(l.endContainer),l.endOffset);i.push(m);}return h.ranges=i;},getStartElement:function(){var o=this; var h=o._.cache;if(h.startElement!==undefined)return h.startElement;var i,j=o.getNative();switch(o.getType()){case CKEDITOR.SELECTION_ELEMENT:return o.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var k=o.getRanges()[0];if(k)if(!k.collapsed){k.optimize();for(;;){var l=k.startContainer,m=k.startOffset;if(m==(l.getChildCount?l.getChildCount():l.getLength()))k.setStartAfter(l);else break;}i=k.startContainer;if(i.type!=CKEDITOR.NODE_ELEMENT)return i.getParent();i=i.getChild(k.startOffset);if(!i||i.type!=CKEDITOR.NODE_ELEMENT)return k.startContainer;var n=i.getFirst();while(n&&n.type==CKEDITOR.NODE_ELEMENT){i=n;n=n.getFirst();}return i;}if(CKEDITOR.env.ie){k=j.createRange();k.collapse(true);i=k.parentElement();}else{i=j.anchorNode;if(i&&i.nodeType!=1)i=i.parentNode;}}return h.startElement=i?new CKEDITOR.dom.element(i):null;},getSelectedElement:function(){var h=this._.cache;if(h.selectedElement!==undefined)return h.selectedElement;var i;if(this.getType()==CKEDITOR.SELECTION_ELEMENT){var j=this.getNative();if(CKEDITOR.env.ie)try{i=j.createRange().item(0);}catch(l){}else{var k=j.getRangeAt(0);i=k.startContainer.childNodes[k.startOffset];}}return h.selectedElement=i?new CKEDITOR.dom.element(i):null;},lock:function(){var h=this;h.getRanges();h.getStartElement();h.getSelectedElement();h._.cache.nativeSel={};h.isLocked=true;h.document.setCustomData('cke_locked_selection',h);},unlock:function(h){var m=this;var i=m.document,j=i.getCustomData('cke_locked_selection');if(j){i.setCustomData('cke_locked_selection',null);if(h){var k=j.getSelectedElement(),l=!k&&j.getRanges();m.isLocked=false;m.reset();i.getBody().focus();if(k)m.selectElement(k);else m.selectRanges(l);}}if(!j||!h){m.isLocked=false;m.reset();}},reset:function(){this._.cache={};},selectElement:function(h){var k=this;if(k.isLocked){var i=new CKEDITOR.dom.range(k.document);i.setStartBefore(h);i.setEndAfter(h);k._.cache.selectedElement=h;k._.cache.startElement=h;k._.cache.ranges=[i];k._.cache.type=CKEDITOR.SELECTION_ELEMENT;return;}if(CKEDITOR.env.ie){k.getNative().empty();try{i=k.document.$.body.createControlRange();i.addElement(h.$);i.select();}catch(l){i=k.document.$.body.createTextRange();i.moveToElementText(h.$);i.select();}k.reset();}else{i=k.document.$.createRange();i.selectNode(h.$);var j=k.getNative();j.removeAllRanges();j.addRange(i);k.reset();}},selectRanges:function(h){var n=this;if(n.isLocked){n._.cache.selectedElement=null;n._.cache.startElement=h[0].getTouchedStartNode();n._.cache.ranges=h;n._.cache.type=CKEDITOR.SELECTION_TEXT; return;}if(CKEDITOR.env.ie){if(h[0])h[0].select();n.reset();}else{var i=n.getNative();i.removeAllRanges();for(var j=0;j<h.length;j++){var k=h[j],l=n.document.$.createRange(),m=k.startContainer;if(k.collapsed&&CKEDITOR.env.gecko&&CKEDITOR.env.version<10900&&m.type==CKEDITOR.NODE_ELEMENT&&!m.getChildCount())m.appendText('');l.setStart(m.$,k.startOffset);l.setEnd(k.endContainer.$,k.endOffset);i.addRange(l);}n.reset();}},createBookmarks:function(h){var i=[],j=this.getRanges(),k=j.length,l;for(var m=0;m<k;m++){i.push(l=j[m].createBookmark(h,true));h=l.serializable;var n=h?this.document.getById(l.startNode):l.startNode,o=h?this.document.getById(l.endNode):l.endNode;for(var p=m+1;p<k;p++){var q=j[p],r=q.startContainer,s=q.endContainer;r.equals(n.getParent())&&q.startOffset++;r.equals(o.getParent())&&q.startOffset++;s.equals(n.getParent())&&q.endOffset++;s.equals(o.getParent())&&q.endOffset++;}}return i;},createBookmarks2:function(h){var i=[],j=this.getRanges();for(var k=0;k<j.length;k++)i.push(j[k].createBookmark2(h));return i;},selectBookmarks:function(h){var i=[];for(var j=0;j<h.length;j++){var k=new CKEDITOR.dom.range(this.document);k.moveToBookmark(h[j]);i.push(k);}this.selectRanges(i);return this;}};})();CKEDITOR.dom.range.prototype.select=CKEDITOR.env.ie?function(a){var j=this;var b=j.collapsed,c,d,e=j.createBookmark(),f=e.startNode,g;if(!b)g=e.endNode;var h=j.document.$.body.createTextRange();h.moveToElementText(f.$);h.moveStart('character',1);if(g){var i=j.document.$.body.createTextRange();i.moveToElementText(g.$);h.setEndPoint('EndToEnd',i);h.moveEnd('character',-1);}else{c=a||!f.hasPrevious()||f.getPrevious().is&&f.getPrevious().is('br');d=j.document.createElement('span');d.setHtml('&#65279;');d.insertBefore(f);if(c)j.document.createText('').insertBefore(f);}j.setStartBefore(f);f.remove();if(b){if(c){h.moveStart('character',-1);h.select();j.document.$.selection.clear();}else h.select();d.remove();}else{j.setEndBefore(g);g.remove();h.select();}}:function(){var d=this;var a=d.startContainer;if(d.collapsed&&a.type==CKEDITOR.NODE_ELEMENT&&!a.getChildCount())a.append(new CKEDITOR.dom.text(''));var b=d.document.$.createRange();b.setStart(a.$,d.startOffset);try{b.setEnd(d.endContainer.$,d.endOffset);}catch(e){if(e.toString().indexOf('NS_ERROR_ILLEGAL_VALUE')>=0){d.collapse(true);b.setEnd(d.endContainer.$,d.endOffset);}else throw e;}var c=d.document.getSelection().getNative();c.removeAllRanges();c.addRange(b);};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/selection/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){CKEDITOR.plugins.add('undo',{requires:['selection','wysiwygarea'],init:function(c){var d=new b(c),e=c.addCommand('undo',{exec:function(){if(d.undo()){c.selectionChange();this.fire('afterUndo');}},state:CKEDITOR.TRISTATE_DISABLED,canUndo:false}),f=c.addCommand('redo',{exec:function(){if(d.redo()){c.selectionChange();this.fire('afterRedo');}},state:CKEDITOR.TRISTATE_DISABLED,canUndo:false});d.onChange=function(){e.setState(d.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);f.setState(d.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);};function g(h){if(d.enabled&&h.data.command.canUndo!==false)d.save();};c.on('beforeCommandExec',g);c.on('afterCommandExec',g);c.on('saveSnapshot',function(){d.save();});c.on('contentDom',function(){c.document.on('keydown',function(h){if(!h.data.$.ctrlKey&&!h.data.$.metaKey)d.type(h);});});c.on('beforeModeUnload',function(){c.mode=='wysiwyg'&&d.save(true);});c.on('mode',function(){d.enabled=c.mode=='wysiwyg';d.onChange();});c.ui.addButton('Undo',{label:c.lang.undo,command:'undo'});c.ui.addButton('Redo',{label:c.lang.redo,command:'redo'});c.resetUndo=function(){d.reset();c.fire('saveSnapshot');};}});function a(c){var e=this;var d=c.getSelection();e.contents=c.getSnapshot();e.bookmarks=d&&d.createBookmarks2(true);if(CKEDITOR.env.ie)e.contents=e.contents.replace(/\s+_cke_expando=".*?"/g,'');};a.prototype={equals:function(c,d){if(this.contents!=c.contents)return false;if(d)return true;var e=this.bookmarks,f=c.bookmarks;if(e||f){if(!e||!f||e.length!=f.length)return false;for(var g=0;g<e.length;g++){var h=e[g],i=f[g];if(h.startOffset!=i.startOffset||h.endOffset!=i.endOffset||!CKEDITOR.tools.arrayCompare(h.start,i.start)||!CKEDITOR.tools.arrayCompare(h.end,i.end))return false;}}return true;}};function b(c){this.editor=c;this.reset();};b.prototype={type:function(c){var d=c&&c.data.getKeystroke(),e={8:1,46:1},f=d in e,g=this.lastKeystroke in e,h=f&&d==this.lastKeystroke,i={37:1,38:1,39:1,40:1},j=d in i,k=this.lastKeystroke in i,l=!f&&!j,m=f&&!h,n=!this.typing||l&&(g||k);if(n||m){var o=new a(this.editor);CKEDITOR.tools.setTimeout(function(){var q=this;var p=q.editor.getSnapshot();if(CKEDITOR.env.ie)p=p.replace(/\s+_cke_expando=".*?"/g,'');if(o.contents!=p){if(!q.save(false,o,false))q.snapshots.splice(q.index+1,q.snapshots.length-q.index-1);q.hasUndo=true;q.hasRedo=false;q.typesCount=1;q.modifiersCount=1;q.onChange();}},0,this);}this.lastKeystroke=d;if(f){this.typesCount=0;this.modifiersCount++;if(this.modifiersCount>25){this.save(); this.modifiersCount=1;}}else if(!j){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save();this.typesCount=1;}}this.typing=true;},reset:function(){var c=this;c.lastKeystroke=0;c.snapshots=[];c.index=-1;c.limit=c.editor.config.undoStackSize;c.currentImage=null;c.hasUndo=false;c.hasRedo=false;c.resetType();},resetType:function(){var c=this;c.typing=false;delete c.lastKeystroke;c.typesCount=0;c.modifiersCount=0;},fireChange:function(){var c=this;c.hasUndo=!!c.getNextImage(true);c.hasRedo=!!c.getNextImage(false);c.resetType();c.onChange();},save:function(c,d,e){var g=this;var f=g.snapshots;if(!d)d=new a(g.editor);if(g.currentImage&&d.equals(g.currentImage,c))return false;f.splice(g.index+1,f.length-g.index-1);if(f.length==g.limit)f.shift();g.index=f.push(d)-1;g.currentImage=d;if(e!==false)g.fireChange();return true;},restoreImage:function(c){var e=this;e.editor.loadSnapshot(c.contents);if(c.bookmarks)e.editor.getSelection().selectBookmarks(c.bookmarks);else if(CKEDITOR.env.ie){var d=e.editor.document.getBody().$.createTextRange();d.collapse(true);d.select();}e.index=c.index;e.currentImage=c;e.fireChange();},getNextImage:function(c){var h=this;var d=h.snapshots,e=h.currentImage,f,g;if(e)if(c)for(g=h.index-1;g>=0;g--){f=d[g];if(!e.equals(f,true)){f.index=g;return f;}}else for(g=h.index+1;g<d.length;g++){f=d[g];if(!e.equals(f,true)){f.index=g;return f;}}return null;},redoable:function(){return this.enabled&&this.hasRedo;},undoable:function(){return this.enabled&&this.hasUndo;},undo:function(){var d=this;if(d.undoable()){d.save(true);var c=d.getNextImage(true);if(c)return d.restoreImage(c),true;}return false;},redo:function(){var d=this;if(d.redoable()){d.save(true);if(d.redoable()){var c=d.getNextImage(false);if(c)return d.restoreImage(c),true;}}return false;}};})();CKEDITOR.config.undoStackSize=20;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/undo/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(j){var k,l;if(j.data)k=j.data.getTarget();else k=new CKEDITOR.dom.element(j);if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){k.removeClass('cke_light_background');b.hide();a.insertHtml(l);}},e=CKEDITOR.tools.addFunction(d),f,g=function(j,k){var l;k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){if(f)h(null,f);var m=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(l);m.setHtml(CKEDITOR.tools.htmlEncode(l));k.getParent().addClass('cke_light_background');f=k;}},h=function(j,k){k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml('&nbsp;');b.getContentElement('info','htmlPreview').getElement().setHtml('&nbsp;');k.getParent().removeClass('cke_light_background');f=undefined;}},i=CKEDITOR.tools.addFunction(function(j){j=new CKEDITOR.dom.event(j);var k=j.getTarget(),l,m,n=j.getKeystroke(),o=a.lang.dir=='rtl';switch(n){case 38:if(l=k.getParent().getParent().getPrevious()){m=l.getChild([k.getParent().getIndex(),0]);m.focus();h(null,k);g(null,m);}j.preventDefault();break;case 40:if(l=k.getParent().getParent().getNext()){m=l.getChild([k.getParent().getIndex(),0]);if(m&&m.type==1){m.focus();h(null,k);g(null,m);}}j.preventDefault();break;case 32:d({data:j});j.preventDefault();break;case o?37:39:case 9:if(l=k.getParent().getNext()){m=l.getChild(0);if(m.type==1){m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);}else if(l=k.getParent().getParent().getNext()){m=l.getChild([0,0]);if(m&&m.type==1){m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);}break;case o?39:37:case CKEDITOR.SHIFT+9:if(l=k.getParent().getPrevious()){m=l.getChild(0);m.focus();h(null,k);g(null,m);j.preventDefault(true);}else if(l=k.getParent().getParent().getPrevious()){m=l.getLast().getChild(0);m.focus();h(null,k);g(null,m);j.preventDefault(true);}else h(null,k);break;default:return;}});return{title:c.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){var j=this.definition.charColumns,k=a.config.extraSpecialChars,l=a.config.specialChars,m=CKEDITOR.tools.getNextId()+'_specialchar_table_label',n=['<table role="listbox" aria-labelledby="'+m+'"'+' style="width: 320px; height: 100%; border-collapse: separate;"'+' align="center" cellspacing="2" cellpadding="2" border="0">'],o=0,p=l.length,q,r; while(o<p){n.push('<tr>');for(var s=0;s<j;s++,o++){if(q=l[o]){r='';if(q instanceof Array){r=q[1];q=q[0];}else{var t=q.toLowerCase().replace('&','').replace(';','').replace('#','');r=c[t]||q;}var u='cke_specialchar_label_'+o+'_'+CKEDITOR.tools.getNextNumber();n.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(o+1)+'"',' aria-setsize="'+p+'"',' aria-labelledby="'+u+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(r),'" onkeydown="CKEDITOR.tools.callFunction( '+i+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+e+', this); return false;"'+' tabindex="-1">'+'<span style="margin: 0 auto;cursor: inherit">'+q+'</span>'+'<span class="cke_voice_label" id="'+u+'">'+r+'</span></a>');}else n.push('<td class="cke_dark_background">&nbsp;');n.push('</td>');}n.push('</tr>');}n.push('</tbody></table>','<span id="'+m+'" class="cke_voice_label">'+c.options+'</span>');this.getContentElement('info','charContainer').getElement().setHtml(n.join(''));},contents:[{id:'info',label:a.lang.common.generalTab,title:a.lang.common.generalTab,padding:0,align:'top',elements:[{type:'hbox',align:'top',widths:['320px','90px'],children:[{type:'html',id:'charContainer',html:'',onMouseover:g,onMouseout:h,focus:function(){var j=this.getElement().getElementsByTag('a').getItem(0);setTimeout(function(){j.focus();g(null,j);},0);},onShow:function(){var j=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){j.focus();g(null,j);},0);},onLoad:function(j){b=j.sender;}},{type:'hbox',align:'top',widths:['100%'],children:[{type:'vbox',align:'top',children:[{type:'html',html:'<div></div>'},{type:'html',id:'charPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div>&nbsp;</div>'},{type:'html',id:'htmlPreview',className:'cke_dark_background',style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:'<div>&nbsp;</div>'}]}]}]}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/specialchar/dialogs/specialchar.js
specialchar.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('specialchar','en',{euro:'EURO SIGN',lsquo:'LEFT SINGLE QUOTATION MARK',rsquo:'RIGHT SINGLE QUOTATION MARK',ldquo:'LEFT DOUBLE QUOTATION MARK',rdquo:'RIGHT DOUBLE QUOTATION MARK',ndash:'EN DASH',mdash:'EM DASH',iexcl:'INVERTED EXCLAMATION MARK',cent:'CENT SIGN',pound:'POUND SIGN',curren:'CURRENCY SIGN',yen:'YEN SIGN',brvbar:'BROKEN BAR',sect:'SECTION SIGN',uml:'DIAERESIS',copy:'COPYRIGHT SIGN',ordf:'FEMININE ORDINAL INDICATOR',laquo:'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK',not:'NOT SIGN',reg:'REGISTERED SIGN',macr:'MACRON',deg:'DEGREE SIGN',sup2:'SUPERSCRIPT TWO',sup3:'SUPERSCRIPT THREE',acute:'ACUTE ACCENT',micro:'MICRO SIGN',para:'PILCROW SIGN',middot:'MIDDLE DOT',cedil:'CEDILLA',sup1:'SUPERSCRIPT ONE',ordm:'MASCULINE ORDINAL INDICATOR',frac14:'VULGAR FRACTION ONE QUARTER',frac12:'VULGAR FRACTION ONE HALF',frac34:'VULGAR FRACTION THREE QUARTERS',iquest:'INVERTED QUESTION MARK',agrave:'LATIN SMALL LETTER A WITH GRAVE',aacute:'LATIN SMALL LETTER A WITH ACUTE',acirc:'LATIN SMALL LETTER A WITH CIRCUMFLEX',atilde:'LATIN SMALL LETTER A WITH TILDE',auml:'LATIN SMALL LETTER A WITH DIAERESIS',aring:'LATIN SMALL LETTER A WITH RING ABOVE',aelig:'LATIN SMALL LETTER AE',ccedil:'LATIN SMALL LETTER C WITH CEDILLA',egrave:'LATIN SMALL LETTER E WITH GRAVE',eacute:'LATIN SMALL LETTER E WITH ACUTE',ecirc:'LATIN SMALL LETTER E WITH CIRCUMFLEX',euml:'LATIN SMALL LETTER E WITH DIAERESIS',igrave:'LATIN SMALL LETTER I WITH GRAVE',iacute:'LATIN SMALL LETTER I WITH ACUTE',icirc:'LATIN SMALL LETTER I WITH CIRCUMFLEX',iuml:'LATIN SMALL LETTER I WITH DIAERESIS',eth:'LATIN SMALL LETTER ETH',ntilde:'LATIN SMALL LETTER N WITH TILDE',ograve:'LATIN SMALL LETTER O WITH GRAVE',oacute:'LATIN SMALL LETTER O WITH ACUTE',ocirc:'LATIN SMALL LETTER O WITH CIRCUMFLEX',otilde:'LATIN SMALL LETTER O WITH TILDE',ouml:'LATIN SMALL LETTER O WITH DIAERESIS',times:'MULTIPLICATION SIGN',oslash:'LATIN SMALL LETTER O WITH STROKE',ugrave:'LATIN SMALL LETTER U WITH GRAVE',uacute:'LATIN SMALL LETTER U WITH ACUTE',ucirc:'LATIN SMALL LETTER U WITH CIRCUMFLEX',uuml:'LATIN SMALL LETTER U WITH DIAERESIS',yacute:'LATIN SMALL LETTER Y WITH ACUTE',thorn:'LATIN SMALL LETTER THORN',szlig:'LATIN SMALL LETTER SHARP S',divide:'DIVISION SIGN',yuml:'LATIN SMALL LETTER Y WITH DIAERESIS',oelig:'LATIN SMALL LIGATURE OE',372:'LATIN CAPITAL LETTER W WITH CIRCUMFLEX',374:'LATIN CAPITAL LETTER Y WITH CIRCUMFLEX',373:'LATIN SMALL LETTER W WITH CIRCUMFLEX',375:'LATIN SMALL LETTER Y WITH CIRCUMFLEX',8219:'SINGLE HIGH-REVERSED-9 QUOTATION MARK',bdquo:'DOUBLE LOW-9 QUOTATION MARK',hellip:'HORIZONTAL ELLIPSIS',trade:'TRADE MARK SIGN',9658:'BLACK RIGHT-POINTING POINTER',bull:'BULLET',rarr:'RIGHTWARDS DOUBLE ARROW',harr:'LEFT RIGHT DOUBLE ARROW',diams:'BLACK DIAMOND SUIT',asymp:'ALMOST EQUAL TO',sbquo:'SINGLE LOW-9 QUOTATION MARK'});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/specialchar/lang/en.js
en.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=function(b,c){var d=1,e=2,f=4,g=8,h=/^\s*(\d+)((px)|\%)?\s*$/i,i=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,j=/^\d+px$/,k=function(){var C=this.getValue(),D=this.getDialog(),E=C.match(h);if(E){if(E[2]=='%')p(D,false);C=E[1];}if(D.lockRatio){var F=D.originalElement;if(F.getCustomData('isReady')=='true')if(this.id=='txtHeight'){if(C&&C!='0')C=Math.round(F.$.width*(C/F.$.height));if(!isNaN(C))D.setValueOf('info','txtWidth',C);}else{if(C&&C!='0')C=Math.round(F.$.height*(C/F.$.width));if(!isNaN(C))D.setValueOf('info','txtHeight',C);}}l(D);},l=function(C){if(!C.originalElement||!C.preview)return 1;C.commitContent(f,C.preview);return 0;};function m(){var C=arguments,D=this.getContentElement('advanced','txtdlgGenStyle');D&&D.commit.apply(D,C);this.foreach(function(E){if(E.commit&&E.id!='txtdlgGenStyle')E.commit.apply(E,C);});};var n;function o(C){if(n)return;n=1;var D=this.getDialog(),E=D.imageElement;if(E){this.commit(d,E);C=[].concat(C);var F=C.length,G;for(var H=0;H<F;H++){G=D.getContentElement.apply(D,C[H].split(':'));G&&G.setup(d,E);}}n=0;};var p=function(C,D){var E=C.originalElement;if(!E)return null;var F=CKEDITOR.document.getById(w);if(E.getCustomData('isReady')=='true'){if(D=='check'){var G=C.getValueOf('info','txtWidth'),H=C.getValueOf('info','txtHeight'),I=E.$.width*1000/E.$.height,J=G*1000/H;C.lockRatio=false;if(!G&&!H)C.lockRatio=true;else if(!isNaN(I)&&!isNaN(J))if(Math.round(I)==Math.round(J))C.lockRatio=true;}else if(D!=undefined)C.lockRatio=D;else C.lockRatio=!C.lockRatio;}else if(D!='check')C.lockRatio=false;if(C.lockRatio)F.removeClass('cke_btn_unlocked');else F.addClass('cke_btn_unlocked');var K=C._.editor.lang.image,L=K[C.lockRatio?'unlockRatio':'lockRatio'];F.setAttribute('title',L);F.getFirst().setText(L);return C.lockRatio;},q=function(C){var D=C.originalElement;if(D.getCustomData('isReady')=='true'){C.setValueOf('info','txtWidth',D.$.width);C.setValueOf('info','txtHeight',D.$.height);}l(C);},r=function(C,D){if(C!=d)return;function E(J,K){var L=J.match(h);if(L){if(L[2]=='%'){L[1]+='%';p(F,false);}return L[1];}return K;};var F=this.getDialog(),G='',H=this.id=='txtWidth'?'width':'height',I=D.getAttribute(H);if(I)G=E(I,G);G=E(D.getStyle(H),G);this.setValue(G);},s,t=function(){var C=this.originalElement;C.setCustomData('isReady','true');C.removeListener('load',t);C.removeListener('error',u);C.removeListener('abort',u);CKEDITOR.document.getById(y).setStyle('display','none');if(!this.dontResetSize)q(this);if(this.firstLoad)CKEDITOR.tools.setTimeout(function(){p(this,'check'); },0,this);this.firstLoad=false;this.dontResetSize=false;},u=function(){var E=this;var C=E.originalElement;C.removeListener('load',t);C.removeListener('error',u);C.removeListener('abort',u);var D=CKEDITOR.getUrl(b.skinPath+'images/noimage.png');if(E.preview)E.preview.setAttribute('src',D);CKEDITOR.document.getById(y).setStyle('display','none');p(E,false);},v=function(C){return CKEDITOR.tools.getNextId()+'_'+C;},w=v('btnLockSizes'),x=v('btnResetSize'),y=v('ImagePreviewLoader'),z=v('ImagePreviewBox'),A=v('previewLink'),B=v('previewImage');return{title:b.lang.image[c=='image'?'title':'titleButton'],minWidth:420,minHeight:360,onShow:function(){var I=this;I.imageElement=false;I.linkElement=false;I.imageEditMode=false;I.linkEditMode=false;I.lockRatio=true;I.dontResetSize=false;I.firstLoad=true;I.addLink=false;var C=I.getParentEditor(),D=I.getParentEditor().getSelection(),E=D.getSelectedElement(),F=E&&E.getAscendant('a');CKEDITOR.document.getById(y).setStyle('display','none');s=new CKEDITOR.dom.element('img',C.document);I.preview=CKEDITOR.document.getById(B);I.originalElement=C.document.createElement('img');I.originalElement.setAttribute('alt','');I.originalElement.setCustomData('isReady','false');if(F){I.linkElement=F;I.linkEditMode=true;var G=F.getChildren();if(G.count()==1){var H=G.getItem(0).getName();if(H=='img'||H=='input'){I.imageElement=G.getItem(0);if(I.imageElement.getName()=='img')I.imageEditMode='img';else if(I.imageElement.getName()=='input')I.imageEditMode='input';}}if(c=='image')I.setupContent(e,F);}if(E&&E.getName()=='img'&&!E.data('cke-realelement')||E&&E.getName()=='input'&&E.getAttribute('type')=='image'){I.imageEditMode=E.getName();I.imageElement=E;}if(I.imageEditMode){I.cleanImageElement=I.imageElement;I.imageElement=I.cleanImageElement.clone(true,true);I.setupContent(d,I.imageElement);p(I,true);}else I.imageElement=C.document.createElement('img');if(!CKEDITOR.tools.trim(I.getValueOf('info','txtUrl'))){I.preview.removeAttribute('src');I.preview.setStyle('display','none');}},onOk:function(){var D=this;if(D.imageEditMode){var C=D.imageEditMode;if(c=='image'&&C=='input'&&confirm(b.lang.image.button2Img)){C='img';D.imageElement=b.document.createElement('img');D.imageElement.setAttribute('alt','');b.insertElement(D.imageElement);}else if(c!='image'&&C=='img'&&confirm(b.lang.image.img2Button)){C='input';D.imageElement=b.document.createElement('input');D.imageElement.setAttributes({type:'image',alt:''});b.insertElement(D.imageElement);}else{D.imageElement=D.cleanImageElement; delete D.cleanImageElement;}}else{if(c=='image')D.imageElement=b.document.createElement('img');else{D.imageElement=b.document.createElement('input');D.imageElement.setAttribute('type','image');}D.imageElement.setAttribute('alt','');}if(!D.linkEditMode)D.linkElement=b.document.createElement('a');D.commitContent(d,D.imageElement);D.commitContent(e,D.linkElement);if(!D.imageElement.getAttribute('style'))D.imageElement.removeAttribute('style');if(!D.imageEditMode){if(D.addLink){if(!D.linkEditMode){b.insertElement(D.linkElement);D.linkElement.append(D.imageElement,false);}else b.insertElement(D.imageElement);}else b.insertElement(D.imageElement);}else if(!D.linkEditMode&&D.addLink){b.insertElement(D.linkElement);D.imageElement.appendTo(D.linkElement);}else if(D.linkEditMode&&!D.addLink){b.getSelection().selectElement(D.linkElement);b.insertElement(D.imageElement);}},onLoad:function(){var D=this;if(c!='image')D.hidePage('Link');var C=D._.element.getDocument();D.addFocusable(C.getById(x),5);D.addFocusable(C.getById(w),5);D.commitContent=m;},onHide:function(){var C=this;if(C.preview)C.commitContent(g,C.preview);if(C.originalElement){C.originalElement.removeListener('load',t);C.originalElement.removeListener('error',u);C.originalElement.removeListener('abort',u);C.originalElement.remove();C.originalElement=false;}delete C.imageElement;},contents:[{id:'info',label:b.lang.image.infoTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['280px','110px'],align:'right',children:[{id:'txtUrl',type:'text',label:b.lang.common.url,required:true,onChange:function(){var C=this.getDialog(),D=this.getValue();if(D.length>0){C=this.getDialog();var E=C.originalElement;C.preview.removeStyle('display');E.setCustomData('isReady','false');var F=CKEDITOR.document.getById(y);if(F)F.setStyle('display','');E.on('load',t,C);E.on('error',u,C);E.on('abort',u,C);E.setAttribute('src',D);s.setAttribute('src',D);C.preview.setAttribute('src',s.$.src);l(C);}else if(C.preview){C.preview.removeAttribute('src');C.preview.setStyle('display','none');}},setup:function(C,D){if(C==d){var E=D.data('cke-saved-src')||D.getAttribute('src'),F=this;this.getDialog().dontResetSize=true;F.setValue(E);F.setInitValue();}},commit:function(C,D){var E=this;if(C==d&&(E.getValue()||E.isChanged())){D.data('cke-saved-src',E.getValue());D.setAttribute('src',E.getValue());}else if(C==g){D.setAttribute('src','');D.removeAttribute('src');}},validate:CKEDITOR.dialog.validate.notEmpty(b.lang.image.urlMissing)},{type:'button',id:'browse',style:'display:inline-block;margin-top:10px;',align:'center',label:b.lang.common.browseServer,hidden:true,filebrowser:'info:txtUrl'}]}]},{id:'txtAlt',type:'text',label:b.lang.image.alt,accessKey:'T','default':'',onChange:function(){l(this.getDialog()); },setup:function(C,D){if(C==d)this.setValue(D.getAttribute('alt'));},commit:function(C,D){var E=this;if(C==d){if(E.getValue()||E.isChanged())D.setAttribute('alt',E.getValue());}else if(C==f)D.setAttribute('alt',E.getValue());else if(C==g)D.removeAttribute('alt');}},{type:'hbox',children:[{type:'vbox',children:[{type:'hbox',widths:['50%','50%'],children:[{type:'vbox',padding:1,children:[{type:'text',width:'40px',id:'txtWidth',label:b.lang.common.width,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var C=this.getValue().match(i);if(!C)alert(b.lang.common.invalidWidth);return!!C;},setup:r,commit:function(C,D,E){var F=this.getValue();if(C==d){if(F)D.setStyle('width',CKEDITOR.tools.cssLength(F));else if(!F&&this.isChanged())D.removeStyle('width');!E&&D.removeAttribute('width');}else if(C==f){var G=F.match(h);if(!G){var H=this.getDialog().originalElement;if(H.getCustomData('isReady')=='true')D.setStyle('width',H.$.width+'px');}else D.setStyle('width',CKEDITOR.tools.cssLength(F));}else if(C==g){D.removeAttribute('width');D.removeStyle('width');}}},{type:'text',id:'txtHeight',width:'40px',label:b.lang.common.height,onKeyUp:k,onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:function(){var C=this.getValue().match(i);if(!C)alert(b.lang.common.invalidHeight);return!!C;},setup:r,commit:function(C,D,E){var F=this.getValue();if(C==d){if(F)D.setStyle('height',CKEDITOR.tools.cssLength(F));else if(!F&&this.isChanged())D.removeStyle('height');if(!E&&C==d)D.removeAttribute('height');}else if(C==f){var G=F.match(h);if(!G){var H=this.getDialog().originalElement;if(H.getCustomData('isReady')=='true')D.setStyle('height',H.$.height+'px');}else D.setStyle('height',CKEDITOR.tools.cssLength(F));}else if(C==g){D.removeAttribute('height');D.removeStyle('height');}}}]},{type:'html',style:'margin-top:30px;width:40px;height:40px;',onLoad:function(){var C=CKEDITOR.document.getById(x),D=CKEDITOR.document.getById(w);if(C){C.on('click',function(E){q(this);E.data.preventDefault();},this.getDialog());C.on('mouseover',function(){this.addClass('cke_btn_over');},C);C.on('mouseout',function(){this.removeClass('cke_btn_over');},C);}if(D){D.on('click',function(E){var J=this;var F=p(J),G=J.originalElement,H=J.getValueOf('info','txtWidth');if(G.getCustomData('isReady')=='true'&&H){var I=G.$.height/G.$.width*H;if(!isNaN(I)){J.setValueOf('info','txtHeight',Math.round(I));l(J);}}E.data.preventDefault();},this.getDialog());D.on('mouseover',function(){this.addClass('cke_btn_over'); },D);D.on('mouseout',function(){this.removeClass('cke_btn_over');},D);}},html:'<div><a href="javascript:void(0)" tabindex="-1" title="'+b.lang.image.unlockRatio+'" class="cke_btn_locked" id="'+w+'" role="button"><span class="cke_label">'+b.lang.image.unlockRatio+'</span></a>'+'<a href="javascript:void(0)" tabindex="-1" title="'+b.lang.image.resetSize+'" class="cke_btn_reset" id="'+x+'" role="button"><span class="cke_label">'+b.lang.image.resetSize+'</span></a>'+'</div>'}]},{type:'vbox',padding:1,children:[{type:'text',id:'txtBorder',width:'60px',label:b.lang.image.border,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateBorder),setup:function(C,D){if(C==d){var E,F=D.getStyle('border-width');F=F&&F.match(/^(\d+px)(?: \1 \1 \1)?$/);E=F&&parseInt(F[1],10);isNaN(parseInt(E,10))&&(E=D.getAttribute('border'));this.setValue(E);}},commit:function(C,D,E){var F=parseInt(this.getValue(),10);if(C==d||C==f){if(!isNaN(F)){D.setStyle('border-width',CKEDITOR.tools.cssLength(F));D.setStyle('border-style','solid');}else if(!F&&this.isChanged()){D.removeStyle('border-width');D.removeStyle('border-style');D.removeStyle('border-color');}if(!E&&C==d)D.removeAttribute('border');}else if(C==g){D.removeAttribute('border');D.removeStyle('border-width');D.removeStyle('border-style');D.removeStyle('border-color');}}},{type:'text',id:'txtHSpace',width:'60px',label:b.lang.image.hSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle');},validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateHSpace),setup:function(C,D){if(C==d){var E,F,G,H=D.getStyle('margin-left'),I=D.getStyle('margin-right');H=H&&H.match(j);I=I&&I.match(j);F=parseInt(H,10);G=parseInt(I,10);E=F==G&&F;isNaN(parseInt(E,10))&&(E=D.getAttribute('hspace'));this.setValue(E);}},commit:function(C,D,E){var F=parseInt(this.getValue(),10);if(C==d||C==f){if(!isNaN(F)){D.setStyle('margin-left',CKEDITOR.tools.cssLength(F));D.setStyle('margin-right',CKEDITOR.tools.cssLength(F));}else if(!F&&this.isChanged()){D.removeStyle('margin-left');D.removeStyle('margin-right');}if(!E&&C==d)D.removeAttribute('hspace');}else if(C==g){D.removeAttribute('hspace');D.removeStyle('margin-left');D.removeStyle('margin-right');}}},{type:'text',id:'txtVSpace',width:'60px',label:b.lang.image.vSpace,'default':'',onKeyUp:function(){l(this.getDialog());},onChange:function(){o.call(this,'advanced:txtdlgGenStyle'); },validate:CKEDITOR.dialog.validate.integer(b.lang.image.validateVSpace),setup:function(C,D){if(C==d){var E,F,G,H=D.getStyle('margin-top'),I=D.getStyle('margin-bottom');H=H&&H.match(j);I=I&&I.match(j);F=parseInt(H,10);G=parseInt(I,10);E=F==G&&F;isNaN(parseInt(E,10))&&(E=D.getAttribute('vspace'));this.setValue(E);}},commit:function(C,D,E){var F=parseInt(this.getValue(),10);if(C==d||C==f){if(!isNaN(F)){D.setStyle('margin-top',CKEDITOR.tools.cssLength(F));D.setStyle('margin-bottom',CKEDITOR.tools.cssLength(F));}else if(!F&&this.isChanged()){D.removeStyle('margin-top');D.removeStyle('margin-bottom');}if(!E&&C==d)D.removeAttribute('vspace');}else if(C==g){D.removeAttribute('vspace');D.removeStyle('margin-top');D.removeStyle('margin-bottom');}}},{id:'cmbAlign',type:'select',widths:['35%','65%'],style:'width:90px',label:b.lang.common.align,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.alignLeft,'left'],[b.lang.common.alignRight,'right']],onChange:function(){l(this.getDialog());o.call(this,'advanced:txtdlgGenStyle');},setup:function(C,D){if(C==d){var E=D.getStyle('float');switch(E){case 'inherit':case 'none':E='';}!E&&(E=(D.getAttribute('align')||'').toLowerCase());this.setValue(E);}},commit:function(C,D,E){var F=this.getValue();if(C==d||C==f){if(F)D.setStyle('float',F);else D.removeStyle('float');if(!E&&C==d){F=(D.getAttribute('align')||'').toLowerCase();switch(F){case 'left':case 'right':D.removeAttribute('align');}}}else if(C==g)D.removeStyle('float');}}]}]},{type:'vbox',height:'250px',children:[{type:'html',style:'width:95%;',html:'<div>'+CKEDITOR.tools.htmlEncode(b.lang.common.preview)+'<br>'+'<div id="'+y+'" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+'<div id="'+z+'" class="ImagePreviewBox"><table><tr><td>'+'<a href="javascript:void(0)" target="_blank" onclick="return false;" id="'+A+'">'+'<img id="'+B+'" alt="" /></a>'+(b.config.image_previewText||'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.')+'</td></tr></table></div></div>'}]}]}]},{id:'Link',label:b.lang.link.title,padding:0,elements:[{id:'txtUrl',type:'text',label:b.lang.common.url,style:'width: 100%','default':'',setup:function(C,D){if(C==e){var E=D.data('cke-saved-href'); if(!E)E=D.getAttribute('href');this.setValue(E);}},commit:function(C,D){var F=this;if(C==e)if(F.getValue()||F.isChanged()){var E=decodeURI(F.getValue());D.data('cke-saved-href',E);D.setAttribute('href',E);if(F.getValue()||!b.config.image_removeLinkByEmptyURL)F.getDialog().addLink=true;}}},{type:'button',id:'browse',filebrowser:{action:'Browse',target:'Link:txtUrl',url:b.config.filebrowserImageBrowseLinkUrl},style:'float:right',hidden:true,label:b.lang.common.browseServer},{id:'cmbTarget',type:'select',label:b.lang.common.target,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.targetNew,'_blank'],[b.lang.common.targetTop,'_top'],[b.lang.common.targetSelf,'_self'],[b.lang.common.targetParent,'_parent']],setup:function(C,D){if(C==e)this.setValue(D.getAttribute('target')||'');},commit:function(C,D){if(C==e)if(this.getValue()||this.isChanged())D.setAttribute('target',this.getValue());}}]},{id:'Upload',hidden:true,filebrowser:'uploadButton',label:b.lang.image.upload,elements:[{type:'file',id:'upload',label:b.lang.image.btnUpload,style:'height:40px',size:38},{type:'fileButton',id:'uploadButton',filebrowser:'info:txtUrl',label:b.lang.image.btnUpload,'for':['Upload','upload']}]},{id:'advanced',label:b.lang.common.advancedTab,elements:[{type:'hbox',widths:['50%','25%','25%'],children:[{type:'text',id:'linkId',label:b.lang.common.id,setup:function(C,D){if(C==d)this.setValue(D.getAttribute('id'));},commit:function(C,D){if(C==d)if(this.getValue()||this.isChanged())D.setAttribute('id',this.getValue());}},{id:'cmbLangDir',type:'select',style:'width : 100px;',label:b.lang.common.langDir,'default':'',items:[[b.lang.common.notSet,''],[b.lang.common.langDirLtr,'ltr'],[b.lang.common.langDirRtl,'rtl']],setup:function(C,D){if(C==d)this.setValue(D.getAttribute('dir'));},commit:function(C,D){if(C==d)if(this.getValue()||this.isChanged())D.setAttribute('dir',this.getValue());}},{type:'text',id:'txtLangCode',label:b.lang.common.langCode,'default':'',setup:function(C,D){if(C==d)this.setValue(D.getAttribute('lang'));},commit:function(C,D){if(C==d)if(this.getValue()||this.isChanged())D.setAttribute('lang',this.getValue());}}]},{type:'text',id:'txtGenLongDescr',label:b.lang.common.longDescr,setup:function(C,D){if(C==d)this.setValue(D.getAttribute('longDesc'));},commit:function(C,D){if(C==d)if(this.getValue()||this.isChanged())D.setAttribute('longDesc',this.getValue());}},{type:'hbox',widths:['50%','50%'],children:[{type:'text',id:'txtGenClass',label:b.lang.common.cssClass,'default':'',setup:function(C,D){if(C==d)this.setValue(D.getAttribute('class')); },commit:function(C,D){if(C==d)if(this.getValue()||this.isChanged())D.setAttribute('class',this.getValue());}},{type:'text',id:'txtGenTitle',label:b.lang.common.advisoryTitle,'default':'',onChange:function(){l(this.getDialog());},setup:function(C,D){if(C==d)this.setValue(D.getAttribute('title'));},commit:function(C,D){var E=this;if(C==d){if(E.getValue()||E.isChanged())D.setAttribute('title',E.getValue());}else if(C==f)D.setAttribute('title',E.getValue());else if(C==g)D.removeAttribute('title');}}]},{type:'text',id:'txtdlgGenStyle',label:b.lang.common.cssStyle,'default':'',setup:function(C,D){if(C==d){var E=D.getAttribute('style');if(!E&&D.$.style.cssText)E=D.$.style.cssText;this.setValue(E);var F=D.$.style.height,G=D.$.style.width,H=(F?F:'').match(h),I=(G?G:'').match(h);this.attributesInStyle={height:!!H,width:!!I};}},onChange:function(){o.call(this,['info:cmbFloat','info:cmbAlign','info:txtVSpace','info:txtHSpace','info:txtBorder','info:txtWidth','info:txtHeight']);l(this);},commit:function(C,D){if(C==d&&(this.getValue()||this.isChanged()))D.setAttribute('style',this.getValue());}}]}]};};CKEDITOR.dialog.add('image',function(b){return a(b,'image');});CKEDITOR.dialog.add('imagebutton',function(b){return a(b,'imagebutton');});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/image/dialogs/image.js
image.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(j,k){var l=[];if(!k)return j;else for(var m in k)l.push(m+'='+encodeURIComponent(k[m]));return j+(j.indexOf('?')!=-1?'&':'?')+l.join('&');};function b(j){j+='';var k=j.charAt(0).toUpperCase();return k+j.substr(1);};function c(j){var q=this;var k=q.getDialog(),l=k.getParentEditor();l._.filebrowserSe=q;var m=l.config['filebrowser'+b(k.getName())+'WindowWidth']||l.config.filebrowserWindowWidth||'80%',n=l.config['filebrowser'+b(k.getName())+'WindowHeight']||l.config.filebrowserWindowHeight||'70%',o=q.filebrowser.params||{};o.CKEditor=l.name;o.CKEditorFuncNum=l._.filebrowserFn;if(!o.langCode)o.langCode=l.langCode;var p=a(q.filebrowser.url,o);l.popup(p,m,n);};function d(j){var m=this;var k=m.getDialog(),l=k.getParentEditor();l._.filebrowserSe=m;if(!k.getContentElement(m['for'][0],m['for'][1]).getInputElement().$.value)return false;if(!k.getContentElement(m['for'][0],m['for'][1]).getAction())return false;return true;};function e(j,k,l){var m=l.params||{};m.CKEditor=j.name;m.CKEditorFuncNum=j._.filebrowserFn;if(!m.langCode)m.langCode=j.langCode;k.action=a(l.url,m);k.filebrowser=l;};function f(j,k,l,m){var n,o;for(var p in m){n=m[p];if(n.type=='hbox'||n.type=='vbox')f(j,k,l,n.children);if(!n.filebrowser)continue;if(typeof n.filebrowser=='string'){var q={action:n.type=='fileButton'?'QuickUpload':'Browse',target:n.filebrowser};n.filebrowser=q;}if(n.filebrowser.action=='Browse'){var r=n.filebrowser.url||j.config['filebrowser'+b(k)+'BrowseUrl']||j.config.filebrowserBrowseUrl;if(r){n.onClick=c;n.filebrowser.url=r;n.hidden=false;}}else if(n.filebrowser.action=='QuickUpload'&&n['for']){r=n.filebrowser.url||j.config['filebrowser'+b(k)+'UploadUrl']||j.config.filebrowserUploadUrl;if(r){n.onClick=d;n.filebrowser.url=r;n.hidden=false;e(j,l.getContents(n['for'][0]).get(n['for'][1]),n.filebrowser);}}}};function g(j,k){var l=k.getDialog(),m=k.filebrowser.target||null;j=j.replace(/#/g,'%23');if(m){var n=m.split(':'),o=l.getContentElement(n[0],n[1]);if(o){o.setValue(j);l.selectPage(n[0]);}}};function h(j,k,l){if(l.indexOf(';')!==-1){var m=l.split(';');for(var n=0;n<m.length;n++)if(h(j,k,m[n]))return true;return false;}return j.getContents(k).get(l).filebrowser&&j.getContents(k).get(l).filebrowser.url;};function i(j,k){var o=this;var l=o._.filebrowserSe.getDialog(),m=o._.filebrowserSe['for'],n=o._.filebrowserSe.filebrowser.onSelect;if(m)l.getContentElement(m[0],m[1]).reset();if(n&&n.call(o._.filebrowserSe,j,k)===false)return;if(typeof k=='string'&&k)alert(k);if(j)g(j,o._.filebrowserSe); };CKEDITOR.plugins.add('filebrowser',{init:function(j,k){j._.filebrowserFn=CKEDITOR.tools.addFunction(i,j);CKEDITOR.on('dialogDefinition',function(l){for(var m in l.data.definition.contents){f(l.editor,l.data.name,l.data.definition,l.data.definition.contents[m].elements);if(l.data.definition.contents[m].hidden&&l.data.definition.contents[m].filebrowser)l.data.definition.contents[m].hidden=!h(l.data.definition,l.data.definition.contents[m].id,l.data.definition.contents[m].filebrowser);}});}});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/filebrowser/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=1,b=2,c=4,d={id:[{type:a,name:'id'}],classid:[{type:a,name:'classid'}],codebase:[{type:a,name:'codebase'}],pluginspage:[{type:c,name:'pluginspage'}],src:[{type:b,name:'movie'},{type:c,name:'src'}],name:[{type:c,name:'name'}],align:[{type:a,name:'align'}],title:[{type:a,name:'title'},{type:c,name:'title'}],'class':[{type:a,name:'class'},{type:c,name:'class'}],width:[{type:a,name:'width'},{type:c,name:'width'}],height:[{type:a,name:'height'},{type:c,name:'height'}],hSpace:[{type:a,name:'hSpace'},{type:c,name:'hSpace'}],vSpace:[{type:a,name:'vSpace'},{type:c,name:'vSpace'}],style:[{type:a,name:'style'},{type:c,name:'style'}],type:[{type:c,name:'type'}]},e=['play','loop','menu','quality','scale','salign','wmode','bgcolor','base','flashvars','allowScriptAccess','allowFullScreen'];for(var f=0;f<e.length;f++)d[e[f]]=[{type:c,name:e[f]},{type:b,name:e[f]}];e=['allowFullScreen','play','loop','menu'];for(f=0;f<e.length;f++)d[e[f]][0]['default']=d[e[f]][1]['default']=true;function g(i,j,k){var q=this;var l=d[q.id];if(!l)return;var m=q instanceof CKEDITOR.ui.dialog.checkbox;for(var n=0;n<l.length;n++){var o=l[n];switch(o.type){case a:if(!i)continue;if(i.getAttribute(o.name)!==null){var p=i.getAttribute(o.name);if(m)q.setValue(p.toLowerCase()=='true');else q.setValue(p);return;}else if(m)q.setValue(!!o['default']);break;case b:if(!i)continue;if(o.name in k){p=k[o.name];if(m)q.setValue(p.toLowerCase()=='true');else q.setValue(p);return;}else if(m)q.setValue(!!o['default']);break;case c:if(!j)continue;if(j.getAttribute(o.name)){p=j.getAttribute(o.name);if(m)q.setValue(p.toLowerCase()=='true');else q.setValue(p);return;}else if(m)q.setValue(!!o['default']);}}};function h(i,j,k){var s=this;var l=d[s.id];if(!l)return;var m=s.getValue()==='',n=s instanceof CKEDITOR.ui.dialog.checkbox;for(var o=0;o<l.length;o++){var p=l[o];switch(p.type){case a:if(!i)continue;var q=s.getValue();if(m||n&&q===p['default'])i.removeAttribute(p.name);else i.setAttribute(p.name,q);break;case b:if(!i)continue;q=s.getValue();if(m||n&&q===p['default']){if(p.name in k)k[p.name].remove();}else if(p.name in k)k[p.name].setAttribute('value',q);else{var r=CKEDITOR.dom.element.createFromHtml('<cke:param></cke:param>',i.getDocument());r.setAttributes({name:p.name,value:q});if(i.getChildCount()<1)r.appendTo(i);else r.insertBefore(i.getFirst());}break;case c:if(!j)continue;q=s.getValue();if(m||n&&q===p['default'])j.removeAttribute(p.name);else j.setAttribute(p.name,q);}}};CKEDITOR.dialog.add('flash',function(i){var j=!i.config.flashEmbedTagOnly,k=i.config.flashAddEmbedTag||i.config.flashEmbedTagOnly,l,m='<div>'+CKEDITOR.tools.htmlEncode(i.lang.common.preview)+'<br>'+'<div id="cke_FlashPreviewLoader'+CKEDITOR.tools.getNextNumber()+'" style="display:none"><div class="loading">&nbsp;</div></div>'+'<div id="cke_FlashPreviewBox'+CKEDITOR.tools.getNextNumber()+'" class="FlashPreviewBox"></div></div>'; return{title:i.lang.flash.title,minWidth:420,minHeight:310,onShow:function(){var z=this;z.fakeImage=z.objectNode=z.embedNode=null;l=new CKEDITOR.dom.element('embed',i.document);var n=z.getSelectedElement();if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='flash'){z.fakeImage=n;var o=i.restoreRealElement(n),p=null,q=null,r={};if(o.getName()=='cke:object'){p=o;var s=p.getElementsByTag('embed','cke');if(s.count()>0)q=s.getItem(0);var t=p.getElementsByTag('param','cke');for(var u=0,v=t.count();u<v;u++){var w=t.getItem(u),x=w.getAttribute('name'),y=w.getAttribute('value');r[x]=y;}}else if(o.getName()=='cke:embed')q=o;z.objectNode=p;z.embedNode=q;z.setupContent(p,q,r,n);}},onOk:function(){var x=this;var n=null,o=null,p=null;if(!x.fakeImage){if(j){n=CKEDITOR.dom.element.createFromHtml('<cke:object></cke:object>',i.document);var q={classid:'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',codebase:'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'};n.setAttributes(q);}if(k){o=CKEDITOR.dom.element.createFromHtml('<cke:embed></cke:embed>',i.document);o.setAttributes({type:'application/x-shockwave-flash',pluginspage:'http://www.macromedia.com/go/getflashplayer'});if(n)o.appendTo(n);}}else{n=x.objectNode;o=x.embedNode;}if(n){p={};var r=n.getElementsByTag('param','cke');for(var s=0,t=r.count();s<t;s++)p[r.getItem(s).getAttribute('name')]=r.getItem(s);}var u={},v={};x.commitContent(n,o,p,u,v);var w=i.createFakeElement(n||o,'cke_flash','flash',true);w.setAttributes(v);w.setStyles(u);if(x.fakeImage){w.replace(x.fakeImage);i.getSelection().selectElement(w);}else i.insertElement(w);},onHide:function(){if(this.preview)this.preview.setHtml('');},contents:[{id:'info',label:i.lang.common.generalTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['280px','110px'],align:'right',children:[{id:'src',type:'text',label:i.lang.common.url,required:true,validate:CKEDITOR.dialog.validate.notEmpty(i.lang.flash.validateSrc),setup:g,commit:h,onLoad:function(){var n=this.getDialog(),o=function(p){l.setAttribute('src',p);n.preview.setHtml('<embed height="100%" width="100%" src="'+CKEDITOR.tools.htmlEncode(l.getAttribute('src'))+'" type="application/x-shockwave-flash"></embed>');};n.preview=n.getContentElement('info','preview').getElement().getChild(3);this.on('change',function(p){if(p.data&&p.data.value)o(p.data.value);});this.getInputElement().on('change',function(p){o(this.getValue());},this);}},{type:'button',id:'browse',filebrowser:'info:src',hidden:true,style:'display:inline-block;margin-top:10px;',label:i.lang.common.browseServer}]}]},{type:'hbox',widths:['25%','25%','25%','25%','25%'],children:[{type:'text',id:'width',style:'width:95px',label:i.lang.common.width,validate:CKEDITOR.dialog.validate.integer(i.lang.common.invalidWidth),setup:function(n,o,p,q){g.apply(this,arguments); if(q){var r=parseInt(q.$.style.width,10);if(!isNaN(r))this.setValue(r);}},commit:function(n,o,p,q){h.apply(this,arguments);if(this.getValue())q.width=this.getValue()+'px';}},{type:'text',id:'height',style:'width:95px',label:i.lang.common.height,validate:CKEDITOR.dialog.validate.integer(i.lang.common.invalidHeight),setup:function(n,o,p,q){g.apply(this,arguments);if(q){var r=parseInt(q.$.style.height,10);if(!isNaN(r))this.setValue(r);}},commit:function(n,o,p,q){h.apply(this,arguments);if(this.getValue())q.height=this.getValue()+'px';}},{type:'text',id:'hSpace',style:'width:95px',label:i.lang.flash.hSpace,validate:CKEDITOR.dialog.validate.integer(i.lang.flash.validateHSpace),setup:g,commit:h},{type:'text',id:'vSpace',style:'width:95px',label:i.lang.flash.vSpace,validate:CKEDITOR.dialog.validate.integer(i.lang.flash.validateVSpace),setup:g,commit:h}]},{type:'vbox',children:[{type:'html',id:'preview',style:'width:95%;',html:m}]}]},{id:'Upload',hidden:true,filebrowser:'uploadButton',label:i.lang.common.upload,elements:[{type:'file',id:'upload',label:i.lang.common.upload,size:38},{type:'fileButton',id:'uploadButton',label:i.lang.common.uploadSubmit,filebrowser:'info:src','for':['Upload','upload']}]},{id:'properties',label:i.lang.flash.propertiesTab,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'scale',type:'select',label:i.lang.flash.scale,'default':'',style:'width : 100%;',items:[[i.lang.common.notSet,''],[i.lang.flash.scaleAll,'showall'],[i.lang.flash.scaleNoBorder,'noborder'],[i.lang.flash.scaleFit,'exactfit']],setup:g,commit:h},{id:'allowScriptAccess',type:'select',label:i.lang.flash.access,'default':'',style:'width : 100%;',items:[[i.lang.common.notSet,''],[i.lang.flash.accessAlways,'always'],[i.lang.flash.accessSameDomain,'samedomain'],[i.lang.flash.accessNever,'never']],setup:g,commit:h}]},{type:'hbox',widths:['50%','50%'],children:[{id:'wmode',type:'select',label:i.lang.flash.windowMode,'default':'',style:'width : 100%;',items:[[i.lang.common.notSet,''],[i.lang.flash.windowModeWindow,'window'],[i.lang.flash.windowModeOpaque,'opaque'],[i.lang.flash.windowModeTransparent,'transparent']],setup:g,commit:h},{id:'quality',type:'select',label:i.lang.flash.quality,'default':'high',style:'width : 100%;',items:[[i.lang.common.notSet,''],[i.lang.flash.qualityBest,'best'],[i.lang.flash.qualityHigh,'high'],[i.lang.flash.qualityAutoHigh,'autohigh'],[i.lang.flash.qualityMedium,'medium'],[i.lang.flash.qualityAutoLow,'autolow'],[i.lang.flash.qualityLow,'low']],setup:g,commit:h}]},{type:'hbox',widths:['50%','50%'],children:[{id:'align',type:'select',label:i.lang.common.align,'default':'',style:'width : 100%;',items:[[i.lang.common.notSet,''],[i.lang.common.alignLeft,'left'],[i.lang.flash.alignAbsBottom,'absBottom'],[i.lang.flash.alignAbsMiddle,'absMiddle'],[i.lang.flash.alignBaseline,'baseline'],[i.lang.common.alignBottom,'bottom'],[i.lang.common.alignMiddle,'middle'],[i.lang.common.alignRight,'right'],[i.lang.flash.alignTextTop,'textTop'],[i.lang.common.alignTop,'top']],setup:g,commit:function(n,o,p,q,r){var s=this.getValue(); h.apply(this,arguments);s&&(r.align=s);}},{type:'html',html:'<div></div>'}]},{type:'fieldset',label:CKEDITOR.tools.htmlEncode(i.lang.flash.flashvars),children:[{type:'vbox',padding:0,children:[{type:'checkbox',id:'menu',label:i.lang.flash.chkMenu,'default':true,setup:g,commit:h},{type:'checkbox',id:'play',label:i.lang.flash.chkPlay,'default':true,setup:g,commit:h},{type:'checkbox',id:'loop',label:i.lang.flash.chkLoop,'default':true,setup:g,commit:h},{type:'checkbox',id:'allowFullScreen',label:i.lang.flash.chkFull,'default':true,setup:g,commit:h}]}]}]},{id:'advanced',label:i.lang.common.advancedTab,elements:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',id:'id',label:i.lang.common.id,setup:g,commit:h},{type:'text',id:'title',label:i.lang.common.advisoryTitle,setup:g,commit:h}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',id:'bgcolor',label:i.lang.flash.bgcolor,setup:g,commit:h},{type:'text',id:'class',label:i.lang.common.cssClass,setup:g,commit:h}]},{type:'text',id:'style',label:i.lang.common.cssStyle,setup:g,commit:h}]}]};});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/flash/dialogs/flash.js
flash.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=/^(\d+(?:\.\d+)?)(px|%)$/,b=/^(\d+(?:\.\d+)?)px$/,c=function(e){var f=this.id;if(!e.info)e.info={};e.info[f]=this.getValue();};function d(e,f){var g=function(i){return new CKEDITOR.dom.element(i,e.document);},h=e.plugins.dialogadvtab;return{title:e.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?310:280,onLoad:function(){var i=this,j=i.getContentElement('advanced','advStyles');if(j)j.on('change',function(k){var l=this.getStyle('width',''),m=i.getContentElement('info','txtWidth'),n=i.getContentElement('info','cmbWidthType'),o=1;if(l){o=l.length<3||l.substr(l.length-1)!='%';l=parseInt(l,10);}m&&m.setValue(l,true);n&&n.setValue(o?'pixels':'percents',true);var p=this.getStyle('height',''),q=i.getContentElement('info','txtHeight');p&&(p=parseInt(p,10));q&&q.setValue(p,true);});},onShow:function(){var q=this;var i=e.getSelection(),j=i.getRanges(),k=null,l=q.getContentElement('info','txtRows'),m=q.getContentElement('info','txtCols'),n=q.getContentElement('info','txtWidth'),o=q.getContentElement('info','txtHeight');if(f=='tableProperties'){if(k=i.getSelectedElement())k=k.getAscendant('table',true);else if(j.length>0){if(CKEDITOR.env.webkit)j[0].shrink(CKEDITOR.NODE_ELEMENT);var p=j[0].getCommonAncestor(true);k=p.getAscendant('table',true);}q._.selectedElement=k;}if(k){q.setupContent(k);l&&l.disable();m&&m.disable();}else{l&&l.enable();m&&m.enable();}n&&n.onChange();o&&o.onChange();},onOk:function(){var D=this;if(D._.selectedElement)var i=e.getSelection(),j=i.createBookmarks();var k=D._.selectedElement||g('table'),l=D,m={};D.commitContent(m,k);if(m.info){var n=m.info;if(!D._.selectedElement){var o=k.append(g('tbody')),p=parseInt(n.txtRows,10)||0,q=parseInt(n.txtCols,10)||0;for(var r=0;r<p;r++){var s=o.append(g('tr'));for(var t=0;t<q;t++){var u=s.append(g('td'));if(!CKEDITOR.env.ie)u.append(g('br'));}}}var v=n.selHeaders;if(!k.$.tHead&&(v=='row'||v=='both')){var w=new CKEDITOR.dom.element(k.$.createTHead());o=k.getElementsByTag('tbody').getItem(0);var x=o.getElementsByTag('tr').getItem(0);for(r=0;r<x.getChildCount();r++){var y=x.getChild(r);if(y.type==CKEDITOR.NODE_ELEMENT&&!y.data('cke-bookmark')){y.renameNode('th');y.setAttribute('scope','col');}}w.append(x.remove());}if(k.$.tHead!==null&&!(v=='row'||v=='both')){w=new CKEDITOR.dom.element(k.$.tHead);o=k.getElementsByTag('tbody').getItem(0);var z=o.getFirst();while(w.getChildCount()>0){x=w.getFirst();for(r=0;r<x.getChildCount();r++){var A=x.getChild(r);if(A.type==CKEDITOR.NODE_ELEMENT){A.renameNode('td'); A.removeAttribute('scope');}}x.insertBefore(z);}w.remove();}if(!D.hasColumnHeaders&&(v=='col'||v=='both'))for(s=0;s<k.$.rows.length;s++){A=new CKEDITOR.dom.element(k.$.rows[s].cells[0]);A.renameNode('th');A.setAttribute('scope','row');}if(D.hasColumnHeaders&&!(v=='col'||v=='both'))for(r=0;r<k.$.rows.length;r++){s=new CKEDITOR.dom.element(k.$.rows[r]);if(s.getParent().getName()=='tbody'){A=new CKEDITOR.dom.element(s.$.cells[0]);A.renameNode('td');A.removeAttribute('scope');}}var B=[];if(n.txtHeight)k.setStyle('height',CKEDITOR.tools.cssLength(n.txtHeight));else k.removeStyle('height');if(n.txtWidth){var C=n.cmbWidthType||'pixels';k.setStyle('width',n.txtWidth+(C=='pixels'?'px':'%'));}else k.removeStyle('width');if(!k.getAttribute('style'))k.removeAttribute('style');}if(!D._.selectedElement)e.insertElement(k);else i.selectBookmarks(j);return true;},contents:[{id:'info',label:e.lang.table.title,elements:[{type:'hbox',widths:[null,null],styles:['vertical-align:top'],children:[{type:'vbox',padding:0,children:[{type:'text',id:'txtRows','default':3,label:e.lang.table.rows,required:true,style:'width:5em',validate:function(){var i=true,j=this.getValue();i=i&&CKEDITOR.dialog.validate.integer()(j)&&j>0;if(!i){alert(e.lang.table.invalidRows);this.select();}return i;},setup:function(i){this.setValue(i.$.rows.length);},commit:c},{type:'text',id:'txtCols','default':2,label:e.lang.table.columns,required:true,style:'width:5em',validate:function(){var i=true,j=this.getValue();i=i&&CKEDITOR.dialog.validate.integer()(j)&&j>0;if(!i){alert(e.lang.table.invalidCols);this.select();}return i;},setup:function(i){this.setValue(i.$.rows[0].cells.length);},commit:c},{type:'html',html:'&nbsp;'},{type:'select',id:'selHeaders','default':'',label:e.lang.table.headers,items:[[e.lang.table.headersNone,''],[e.lang.table.headersRow,'row'],[e.lang.table.headersColumn,'col'],[e.lang.table.headersBoth,'both']],setup:function(i){var j=this.getDialog();j.hasColumnHeaders=true;for(var k=0;k<i.$.rows.length;k++){if(i.$.rows[k].cells[0].nodeName.toLowerCase()!='th'){j.hasColumnHeaders=false;break;}}if(i.$.tHead!==null)this.setValue(j.hasColumnHeaders?'both':'row');else this.setValue(j.hasColumnHeaders?'col':'');},commit:c},{type:'text',id:'txtBorder','default':1,label:e.lang.table.border,style:'width:3em',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidBorder),setup:function(i){this.setValue(i.getAttribute('border')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('border',this.getValue()); else j.removeAttribute('border');}},{id:'cmbAlign',type:'select','default':'',label:e.lang.common.align,items:[[e.lang.common.notSet,''],[e.lang.common.alignLeft,'left'],[e.lang.common.alignCenter,'center'],[e.lang.common.alignRight,'right']],setup:function(i){this.setValue(i.getAttribute('align')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('align',this.getValue());else j.removeAttribute('align');}}]},{type:'vbox',padding:0,children:[{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtWidth',style:'width:5em',label:e.lang.common.width,'default':500,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidWidth),onLoad:function(){var i=this.getDialog().getContentElement('info','cmbWidthType'),j=i.getElement(),k=this.getInputElement(),l=k.getAttribute('aria-labelledby');k.setAttribute('aria-labelledby',[l,j.$.id].join(' '));},onChange:function(){var i=this.getDialog().getContentElement('advanced','advStyles');if(i){var j=this.getValue();if(j)j+=this.getDialog().getContentElement('info','cmbWidthType').getValue()=='percents'?'%':'px';i.updateStyle('width',j);}},setup:function(i){var j=a.exec(i.$.style.width);if(j)this.setValue(j[1]);else this.setValue('');},commit:c},{id:'cmbWidthType',type:'select',label:e.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'pixels',items:[[e.lang.table.widthPx,'pixels'],[e.lang.table.widthPc,'percents']],setup:function(i){var j=a.exec(i.$.style.width);if(j)this.setValue(j[2]=='px'?'pixels':'percents');},onChange:function(){this.getDialog().getContentElement('info','txtWidth').onChange();},commit:c}]},{type:'hbox',widths:['5em'],children:[{type:'text',id:'txtHeight',style:'width:5em',label:e.lang.common.height,'default':'',validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidHeight),onLoad:function(){var i=this.getDialog().getContentElement('info','htmlHeightType'),j=i.getElement(),k=this.getInputElement(),l=k.getAttribute('aria-labelledby');k.setAttribute('aria-labelledby',[l,j.$.id].join(' '));},onChange:function(){var i=this.getDialog().getContentElement('advanced','advStyles');if(i){var j=this.getValue();i.updateStyle('height',j&&j+'px');}},setup:function(i){var j=b.exec(i.$.style.height);if(j)this.setValue(j[1]);},commit:c},{id:'htmlHeightType',type:'html',html:'<div><br />'+e.lang.table.widthPx+'</div>'}]},{type:'html',html:'&nbsp;'},{type:'text',id:'txtCellSpace',style:'width:3em',label:e.lang.table.cellSpace,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellSpacing),setup:function(i){this.setValue(i.getAttribute('cellSpacing')||''); },commit:function(i,j){if(this.getValue())j.setAttribute('cellSpacing',this.getValue());else j.removeAttribute('cellSpacing');}},{type:'text',id:'txtCellPad',style:'width:3em',label:e.lang.table.cellPad,'default':1,validate:CKEDITOR.dialog.validate.number(e.lang.table.invalidCellPadding),setup:function(i){this.setValue(i.getAttribute('cellPadding')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('cellPadding',this.getValue());else j.removeAttribute('cellPadding');}}]}]},{type:'html',align:'right',html:''},{type:'vbox',padding:0,children:[{type:'text',id:'txtCaption',label:e.lang.table.caption,setup:function(i){var j=i.getElementsByTag('caption');if(j.count()>0){var k=j.getItem(0);k=CKEDITOR.tools.trim(k.getText());this.setValue(k);}},commit:function(i,j){var k=this.getValue(),l=j.getElementsByTag('caption');if(k){if(l.count()>0){l=l.getItem(0);l.setHtml('');}else{l=new CKEDITOR.dom.element('caption',e.document);if(j.getChildCount())l.insertBefore(j.getFirst());else l.appendTo(j);}l.append(new CKEDITOR.dom.text(k,e.document));}else if(l.count()>0)for(var m=l.count()-1;m>=0;m--)l.getItem(m).remove();}},{type:'text',id:'txtSummary',label:e.lang.table.summary,setup:function(i){this.setValue(i.getAttribute('summary')||'');},commit:function(i,j){if(this.getValue())j.setAttribute('summary',this.getValue());else j.removeAttribute('summary');}}]}]},h&&h.createAdvancedTab(e)]};};CKEDITOR.dialog.add('table',function(e){return d(e,'table');});CKEDITOR.dialog.add('tableProperties',function(e){return d(e,'tableProperties');});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/table/dialogs/table.js
table.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a='scaytcheck',b='',c=function(){var g=this,h=function(){var k={};k.srcNodeRef=g.document.getWindow().$.frameElement;k.assocApp='CKEDITOR.'+CKEDITOR.version+'@'+CKEDITOR.revision;k.customerid=g.config.scayt_customerid||'1:11111111111111111111111111111111111111';k.customDictionaryName=g.config.scayt_customDictionaryName;k.userDictionaryName=g.config.scayt_userDictionaryName;k.defLang=g.scayt_defLang;if(CKEDITOR._scaytParams)for(var l in CKEDITOR._scaytParams)k[l]=CKEDITOR._scaytParams[l];var m=new window.scayt(k),n=d.instances[g.name];if(n){m.sLang=n.sLang;m.option(n.option());m.paused=n.paused;}d.instances[g.name]=m;try{m.setDisabled(m.paused===false);}catch(o){}g.fire('showScaytState');};g.on('contentDom',h);g.on('contentDomUnload',function(){var k=CKEDITOR.document.getElementsByTag('script'),l=/^dojoIoScript(\d+)$/i,m=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var n=0;n<k.count();n++){var o=k.getItem(n),p=o.getId(),q=o.getAttribute('src');if(p&&q&&p.match(l)&&q.match(m))o.remove();}});g.on('beforeCommandExec',function(k){if((k.data.name=='source'||k.data.name=='newpage')&&(g.mode=='wysiwyg')){var l=d.getScayt(g);if(l){l.paused=!l.disabled;l.destroy();delete d.instances[g.name];}}});g.on('afterSetData',function(){if(d.isScaytEnabled(g))d.getScayt(g).refresh();});g.on('insertElement',function(){var k=d.getScayt(g);if(d.isScaytEnabled(g)){if(CKEDITOR.env.ie)g.getSelection().unlock(true);try{k.refresh();}catch(l){}}},this,null,50);g.on('scaytDialog',function(k){k.data.djConfig=window.djConfig;k.data.scayt_control=d.getScayt(g);k.data.tab=b;k.data.scayt=window.scayt;});var i=g.dataProcessor,j=i&&i.htmlFilter;if(j)j.addRules({elements:{span:function(k){if(k.attributes.scayt_word&&k.attributes.scaytid){delete k.name;return k;}}}});if(g.document)h();};CKEDITOR.plugins.scayt={engineLoaded:false,instances:{},getScayt:function(g){return this.instances[g.name];},isScaytReady:function(g){return this.engineLoaded===true&&'undefined'!==typeof window.scayt&&this.getScayt(g);},isScaytEnabled:function(g){var h=this.getScayt(g);return h?h.disabled===false:false;},loadEngine:function(g){if(this.engineLoaded===true)return c.apply(g);else if(this.engineLoaded==-1)return CKEDITOR.on('scaytReady',function(){c.apply(g);});CKEDITOR.on('scaytReady',c,g);CKEDITOR.on('scaytReady',function(){this.engineLoaded=true;},this,null,0);this.engineLoaded=-1;var h=document.location.protocol;h=h.search(/https?:/)!=-1?h:'http:';var i='svc.spellchecker.net/spellcheck/lf/scayt/scayt1.js',j=g.config.scayt_srcUrl||h+'//'+i,k=d.parseUrl(j).path+'/'; CKEDITOR._djScaytConfig={baseUrl:k,addOnLoad:[function(){CKEDITOR.fireOnce('scaytReady');}],isDebug:false};CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));return null;},parseUrl:function(g){var h;if(g.match&&(h=g.match(/(.*)[\/\\](.*?\.\w+)$/)))return{path:h[1],file:h[2]};else return g;}};var d=CKEDITOR.plugins.scayt,e=function(g,h,i,j,k,l,m){g.addCommand(j,k);g.addMenuItem(j,{label:i,command:j,group:l,order:m});},f={preserveState:true,editorFocus:false,exec:function(g){if(d.isScaytReady(g)){var h=d.isScaytEnabled(g);this.setState(h?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_ON);var i=d.getScayt(g);i.setDisabled(h);}else if(!g.config.scayt_autoStartup&&d.engineLoaded>=0){this.setState(CKEDITOR.TRISTATE_DISABLED);g.on('showScaytState',function(){this.removeListener();this.setState(d.isScaytEnabled(g)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);},this);d.loadEngine(g);}}};CKEDITOR.plugins.add('scayt',{requires:['menubutton'],beforeInit:function(g){g.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+g.config.menu_groups;},init:function(g){var h={},i={},j=g.addCommand(a,f);CKEDITOR.dialog.add(a,CKEDITOR.getUrl(this.path+'dialogs/options.js'));var k='scaytButton';g.addMenuGroup(k);g.addMenuItems({scaytToggle:{label:g.lang.scayt.enable,command:a,group:k},scaytOptions:{label:g.lang.scayt.options,group:k,onClick:function(){b='options';g.openDialog(a);}},scaytLangs:{label:g.lang.scayt.langs,group:k,onClick:function(){b='langs';g.openDialog(a);}},scaytAbout:{label:g.lang.scayt.about,group:k,onClick:function(){b='about';g.openDialog(a);}}});g.ui.add('Scayt',CKEDITOR.UI_MENUBUTTON,{label:g.lang.scayt.title,title:g.lang.scayt.title,className:'cke_button_scayt',onRender:function(){j.on('state',function(){this.setState(j.state);},this);},onMenu:function(){var m=d.isScaytEnabled(g);g.getMenuItem('scaytToggle').label=g.lang.scayt[m?'disable':'enable'];return{scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:m?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:m?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:m?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};}});if(g.contextMenu&&g.addMenuItems)g.contextMenu.addListener(function(m){if(!(d.isScaytEnabled(g)&&m))return null;var n=d.getScayt(g),o=n.getWord(m.$);if(!o)return null;var p=n.getLang(),q={},r=window.scayt.getSuggestion(o,p);if(!r||!r.length)return null;for(i in h){delete g._.menuItems[i];delete g._.commands[i]; }for(i in i){delete g._.menuItems[i];delete g._.commands[i];}h={};i={};var s=false;for(var t=0,u=r.length;t<u;t+=1){var v='scayt_suggestion_'+r[t].replace(' ','_'),w=(function(A,B){return{exec:function(){n.replace(A,B);}};})(m.$,r[t]);if(t<g.config.scayt_maxSuggestions){e(g,'button_'+v,r[t],v,w,'scayt_suggest',t+1);q[v]=CKEDITOR.TRISTATE_OFF;i[v]=CKEDITOR.TRISTATE_OFF;}else{e(g,'button_'+v,r[t],v,w,'scayt_moresuggest',t+1);h[v]=CKEDITOR.TRISTATE_OFF;s=true;}}if(s)g.addMenuItem('scayt_moresuggest',{label:g.lang.scayt.moreSuggestions,group:'scayt_moresuggest',order:10,getItems:function(){return h;}});var x={exec:function(){n.ignore(m.$);}},y={exec:function(){n.ignoreAll(m.$);}},z={exec:function(){window.scayt.addWordToUserDictionary(m.$);}};e(g,'ignore',g.lang.scayt.ignore,'scayt_ignore',x,'scayt_control',1);e(g,'ignore_all',g.lang.scayt.ignoreAll,'scayt_ignore_all',y,'scayt_control',2);e(g,'add_word',g.lang.scayt.addWord,'scayt_add_word',z,'scayt_control',3);i.scayt_moresuggest=CKEDITOR.TRISTATE_OFF;i.scayt_ignore=CKEDITOR.TRISTATE_OFF;i.scayt_ignore_all=CKEDITOR.TRISTATE_OFF;i.scayt_add_word=CKEDITOR.TRISTATE_OFF;if(n.fireOnContextMenu)n.fireOnContextMenu(g);return i;});if(g.config.scayt_autoStartup){var l=function(){g.removeListener('showScaytState',l);j.setState(d.isScaytEnabled(g)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);};g.on('showScaytState',l);d.loadEngine(g);}}});})();CKEDITOR.config.scayt_maxSuggestions=5;CKEDITOR.config.scayt_autoStartup=false;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/scayt/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('scaytcheck',function(a){var b=true,c,d=CKEDITOR.document,e=[],f,g=[],h=0,i=['dic_create,dic_restore','dic_rename,dic_delete'],j=['mixedCase','mixedWithDigits','allCaps','ignoreDomainNames'];function k(){return document.forms.optionsbar.options;};function l(){return document.forms.languagesbar.scayt_lang;};function m(y,z){if(!y)return;var A=y.length;if(A==undefined){y.checked=y.value==z.toString();return;}for(var B=0;B<A;B++){y[B].checked=false;if(y[B].value==z.toString())y[B].checked=true;}};var n=a.lang.scayt,o=[{id:'options',label:n.optionsTab,elements:[{type:'html',id:'options',html:'<form name="optionsbar"><div class="inner_options">\t<div class="messagebox"></div>\t<div style="display:none;">\t\t<input type="checkbox" name="options" id="allCaps" />\t\t<label for="allCaps" id="label_allCaps"></label>\t</div>\t<div style="display:none;">\t\t<input name="options" type="checkbox" id="ignoreDomainNames" />\t\t<label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>\t</div>\t<div style="display:none;">\t<input name="options" type="checkbox" id="mixedCase" />\t\t<label for="mixedCase" id="label_mixedCase"></label>\t</div>\t<div style="display:none;">\t\t<input name="options" type="checkbox" id="mixedWithDigits" />\t\t<label for="mixedWithDigits" id="label_mixedWithDigits"></label>\t</div></div></form>'}]},{id:'langs',label:n.languagesTab,elements:[{type:'html',id:'langs',html:'<form name="languagesbar"><div class="inner_langs">\t<div class="messagebox"></div>\t <div style="float:left;width:45%;margin-left:5px;" id="scayt_lcol" ></div> <div style="float:left;width:45%;margin-left:15px;" id="scayt_rcol"></div></div></form>'}]},{id:'dictionaries',label:n.dictionariesTab,elements:[{type:'html',style:'',id:'dictionaries',html:'<form name="dictionarybar"><div class="inner_dictionary" style="text-align:left; white-space:normal; width:320px; overflow: hidden;">\t<div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message"> </div>\t<div style="margin:5px auto; width:80%;white-space:normal;"> <span class="cke_dialog_ui_labeled_label" >Dictionary name</span><br>\t\t<span class="cke_dialog_ui_labeled_content" >\t\t\t<div class="cke_dialog_ui_input_text">\t\t\t\t<input id="dic_name" type="text" class="cke_dialog_ui_input_text"/>\t\t</div></span></div>\t\t<div style="margin:5px auto; width:80%;white-space:normal;">\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename">\t\t\t\t</a>\t\t\t<a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore">\t\t\t\t</a>\t\t</div>\t<div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info"></div></div></form>'}]},{id:'about',label:n.aboutTab,elements:[{type:'html',id:'about',style:'margin: 5px 5px;',html:'<div id="scayt_about"></div>'}]}],p={title:n.title,minWidth:360,minHeight:220,onShow:function(){var y=this; y.data=a.fire('scaytDialog',{});y.options=y.data.scayt_control.option();y.sLang=y.data.scayt_control.sLang;if(!y.data||!y.data.scayt||!y.data.scayt_control){alert('Error loading application service');y.hide();return;}var z=0;if(b)y.data.scayt.getCaption(a.langCode||'en',function(A){if(z++>0)return;c=A;r.apply(y);s.apply(y);b=false;});else s.apply(y);y.selectPage(y.data.tab);},onOk:function(){var y=this.data.scayt_control;y.option(this.options);var z=this.chosed_lang;y.setLang(z);y.refresh();},onCancel:function(){var y=k();for(var z in y)y[z].checked=false;m(l(),'');},contents:g},q=CKEDITOR.plugins.scayt.getScayt(a);e=CKEDITOR.plugins.scayt.uiTabs;for(f in e){if(e[f]==1)g[g.length]=o[f];}if(e[2]==1)h=1;var r=function(){var y=this,z=y.data.scayt.getLangList(),A=['dic_create','dic_delete','dic_rename','dic_restore'],B=j,C;if(h){for(C=0;C<A.length;C++){var D=A[C];d.getById(D).setHtml('<span class="cke_dialog_ui_button">'+c['button_'+D]+'</span>');}d.getById('dic_info').setHtml(c.dic_info);}if(e[0]==1)for(C in B){var E='label_'+B[C],F=d.getById(E);if('undefined'!=typeof F&&'undefined'!=typeof c[E]&&'undefined'!=typeof y.options[B[C]]){F.setHtml(c[E]);var G=F.getParent();G.$.style.display='block';}}var H='<p><img src="'+window.scayt.getAboutInfo().logoURL+'" /></p>'+'<p>'+c.version+window.scayt.getAboutInfo().version.toString()+'</p>'+'<p>'+c.about_throwt_copy+'</p>';d.getById('scayt_about').setHtml(H);var I=function(S,T){var U=d.createElement('label');U.setAttribute('for','cke_option'+S);U.setHtml(T[S]);if(y.sLang==S)y.chosed_lang=S;var V=d.createElement('div'),W=CKEDITOR.dom.element.createFromHtml('<input id="cke_option'+S+'" type="radio" '+(y.sLang==S?'checked="checked"':'')+' value="'+S+'" name="scayt_lang" />');W.on('click',function(){this.$.checked=true;y.chosed_lang=S;});V.append(W);V.append(U);return{lang:T[S],code:S,radio:V};},J=[];if(e[1]==1){for(C in z.rtl)J[J.length]=I(C,z.ltr);for(C in z.ltr)J[J.length]=I(C,z.ltr);J.sort(function(S,T){return T.lang>S.lang?-1:1;});var K=d.getById('scayt_lcol'),L=d.getById('scayt_rcol');for(C=0;C<J.length;C++){var M=C<J.length/2?K:L;M.append(J[C].radio);}}var N={};N.dic_create=function(S,T,U){var V=U[0]+','+U[1],W=c.err_dic_create,X=c.succ_dic_create;window.scayt.createUserDictionary(T,function(Y){w(V);v(U[1]);X=X.replace('%s',Y.dname);u(X);},function(Y){W=W.replace('%s',Y.dname);t(W+'( '+(Y.message||'')+')');});};N.dic_rename=function(S,T){var U=c.err_dic_rename||'',V=c.succ_dic_rename||'';window.scayt.renameUserDictionary(T,function(W){V=V.replace('%s',W.dname); x(T);u(V);},function(W){U=U.replace('%s',W.dname);x(T);t(U+'( '+(W.message||'')+' )');});};N.dic_delete=function(S,T,U){var V=U[0]+','+U[1],W=c.err_dic_delete,X=c.succ_dic_delete;window.scayt.deleteUserDictionary(function(Y){X=X.replace('%s',Y.dname);w(V);v(U[0]);x('');u(X);},function(Y){W=W.replace('%s',Y.dname);t(W);});};N.dic_restore=y.dic_restore||(function(S,T,U){var V=U[0]+','+U[1],W=c.err_dic_restore,X=c.succ_dic_restore;window.scayt.restoreUserDictionary(T,function(Y){X=X.replace('%s',Y.dname);w(V);v(U[1]);u(X);},function(Y){W=W.replace('%s',Y.dname);t(W);});});function O(S){var T=d.getById('dic_name').getValue();if(!T){t(' Dictionary name should not be empty. ');return false;}try{var U=id=S.data.getTarget().getParent(),V=U.getId();N[V].apply(null,[U,T,i]);}catch(W){t(' Dictionary error. ');}return true;};var P=(i[0]+','+i[1]).split(','),Q;for(C=0,Q=P.length;C<Q;C+=1){var R=d.getById(P[C]);if(R)R.on('click',O,this);}},s=function(){var y=this;if(e[0]==1){var z=k();for(var A=0,B=z.length;A<B;A++){var C=z[A].id,D=d.getById(C);if(D){z[A].checked=false;if(y.options[C]==1)z[A].checked=true;if(b)D.on('click',function(){y.options[this.getId()]=this.$.checked?1:0;});}}}if(e[1]==1){var E=d.getById('cke_option'+y.sLang);m(E.$,y.sLang);}if(h){window.scayt.getNameUserDictionary(function(F){var G=F.dname;w(i[0]+','+i[1]);if(G){d.getById('dic_name').setValue(G);v(i[1]);}else v(i[0]);},function(){d.getById('dic_name').setValue('');});u('');}};function t(y){d.getById('dic_message').setHtml('<span style="color:red;">'+y+'</span>');};function u(y){d.getById('dic_message').setHtml('<span style="color:blue;">'+y+'</span>');};function v(y){y=String(y);var z=y.split(',');for(var A=0,B=z.length;A<B;A+=1)d.getById(z[A]).$.style.display='inline';};function w(y){y=String(y);var z=y.split(',');for(var A=0,B=z.length;A<B;A+=1)d.getById(z[A]).$.style.display='none';};function x(y){d.getById('dic_name').$.value=y;};return p;});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/scayt/dialogs/options.js
options.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('floatpanel',{requires:['panel']});(function(){var a={},b=false;function c(d,e,f,g,h){var i=e.getUniqueId()+'-'+f.getUniqueId()+'-'+d.skinName+'-'+d.lang.dir+(d.uiColor&&'-'+d.uiColor||'')+(g.css&&'-'+g.css||'')+(h&&'-'+h||''),j=a[i];if(!j){j=a[i]=new CKEDITOR.ui.panel(e,g);j.element=f.append(CKEDITOR.dom.element.createFromHtml(j.renderHtml(d),e));j.element.setStyles({display:'none',position:'absolute'});}return j;};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(d,e,f,g){f.forceIFrame=true;var h=e.getDocument(),i=c(d,h,e,f,g||0),j=i.element,k=j.getFirst().getFirst();this.element=j;d.panels?d.panels.push(j):d.panels=[j];this._={panel:i,parentElement:e,definition:f,document:h,iframe:k,children:[],dir:d.lang.dir};},proto:{addBlock:function(d,e){return this._.panel.addBlock(d,e);},addListBlock:function(d,e){return this._.panel.addListBlock(d,e);},getBlock:function(d){return this._.panel.getBlock(d);},showBlock:function(d,e,f,g,h){var i=this._.panel,j=i.showBlock(d);this.allowBlur(false);b=true;var k=this.element,l=this._.iframe,m=this._.definition,n=e.getDocumentPosition(k.getDocument()),o=this._.dir=='rtl',p=n.x+(g||0),q=n.y+(h||0);if(o&&(f==1||f==4))p+=e.$.offsetWidth;else if(!o&&(f==2||f==3))p+=e.$.offsetWidth-1;if(f==3||f==4)q+=e.$.offsetHeight-1;this._.panel._.offsetParentId=e.getId();k.setStyles({top:q+'px',left:'-3000px',visibility:'hidden',opacity:'0',display:''});if(!this._.blurSet){var r=CKEDITOR.env.ie?l:new CKEDITOR.dom.window(l.$.contentWindow);CKEDITOR.event.useCapture=true;r.on('blur',function(s){var v=this;if(CKEDITOR.env.ie&&!v.allowBlur())return;var t=s.data.getTarget(),u=t.getWindow&&t.getWindow();if(u&&u.equals(r))return;if(v.visible&&!v._.activeChild&&!b)v.hide();},this);r.on('focus',function(){this._.focused=true;this.hideChild();this.allowBlur(true);},this);CKEDITOR.event.useCapture=false;this._.blurSet=1;}i.onEscape=CKEDITOR.tools.bind(function(){this.onEscape&&this.onEscape();},this);CKEDITOR.tools.setTimeout(function(){if(o)p-=k.$.offsetWidth;k.setStyles({left:p+'px',visibility:'',opacity:'1'});if(j.autoSize){function s(){var t=k.getFirst(),u=j.element.$.scrollHeight;if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&u>0)u+=(t.$.offsetHeight||0)-(t.$.clientHeight||0);t.setStyle('height',u+'px');i._.currentBlock.element.setStyle('display','none').removeStyle('display');};if(i.isLoaded)s();else i.onLoad=s;}else k.getFirst().removeStyle('height');CKEDITOR.tools.setTimeout(function(){if(m.voiceLabel)if(CKEDITOR.env.gecko){var t=l.getParent(); t.setAttribute('role','region');t.setAttribute('title',m.voiceLabel);l.setAttribute('role','region');l.setAttribute('title',' ');}if(CKEDITOR.env.ie&&CKEDITOR.env.quirks)l.focus();else l.$.contentWindow.focus();if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks)this.allowBlur(true);},0,this);},0,this);this.visible=1;if(this.onShow)this.onShow.call(this);b=false;},hide:function(){var d=this;if(d.visible&&(!d.onHide||d.onHide.call(d)!==true)){d.hideChild();d.element.setStyle('display','none');d.visible=0;}},allowBlur:function(d){var e=this._.panel;if(d!=undefined)e.allowBlur=d;return e.allowBlur;},showAsChild:function(d,e,f,g,h,i){if(this._.activeChild==d&&d._.panel._.offsetParentId==f.getId())return;this.hideChild();d.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=d;this._.focused=false;d.showBlock(e,f,g,h,i);if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie8&&CKEDITOR.env.ie6Compat)setTimeout(function(){d.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var d=this._.activeChild;if(d){delete d.onHide;delete this._.activeChild;d.hide();}}}});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/floatpanel/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=/\[\[[^\]]+\]\]/g;CKEDITOR.plugins.add('placeholder',{requires:['dialog'],lang:['en'],init:function(b){var c=b.lang.placeholder;b.addCommand('createplaceholder',new CKEDITOR.dialogCommand('createplaceholder'));b.addCommand('editplaceholder',new CKEDITOR.dialogCommand('editplaceholder'));b.ui.addButton('CreatePlaceholder',{label:c.toolbar,command:'createplaceholder',icon:this.path+'placeholder.gif'});if(b.addMenuItems){b.addMenuGroup('placeholder',20);b.addMenuItems({editplaceholder:{label:c.edit,command:'editplaceholder',group:'placeholder',order:1,icon:this.path+'placeholder.gif'}});if(b.contextMenu)b.contextMenu.addListener(function(d,e){if(!d||!d.data('cke-placeholder'))return null;return{editplaceholder:CKEDITOR.TRISTATE_OFF};});}b.on('doubleclick',function(d){if(CKEDITOR.plugins.placeholder.getSelectedPlaceHoder(b))d.data.dialog='editplaceholder';});b.addCss('.cke_placeholder{background-color: #ffff00;'+(CKEDITOR.env.gecko?'cursor: default;':'')+'}');b.on('contentDom',function(){b.document.getBody().on('resizestart',function(d){if(b.getSelection().getSelectedElement().data('cke-placeholder'))d.data.preventDefault();});});CKEDITOR.dialog.add('createplaceholder',this.path+'dialogs/placeholder.js');CKEDITOR.dialog.add('editplaceholder',this.path+'dialogs/placeholder.js');},afterInit:function(b){var c=b.dataProcessor,d=c&&c.dataFilter,e=c&&c.htmlFilter;if(d)d.addRules({text:function(f){return f.replace(a,function(g){return CKEDITOR.plugins.placeholder.createPlaceholder(b,null,g,1);});}});if(e)e.addRules({elements:{span:function(f){if(f.attributes&&f.attributes['data-cke-placeholder'])delete f.name;}}});}});})();CKEDITOR.plugins.placeholder={createPlaceholder:function(a,b,c,d){var e=new CKEDITOR.dom.element('span',a.document);e.setAttributes({contentEditable:'false','data-cke-placeholder':1,'class':'cke_placeholder'});c&&e.setText(c);if(d)return e.getOuterHtml();if(b){if(CKEDITOR.env.ie){e.insertAfter(b);setTimeout(function(){b.remove();e.focus();},10);}else e.replace(b);}else a.insertElement(e);return null;},getSelectedPlaceHoder:function(a){var b=a.getSelection().getRanges()[0];b.shrink(CKEDITOR.SHRINK_TEXT);var c=b.startContainer;while(c&&!(c.type==CKEDITOR.NODE_ELEMENT&&c.data('cke-placeholder')))c=c.getParent();return c;}};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/placeholder/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(n,o){if(CKEDITOR.env.ie)n.removeAttribute(o);else delete n[o];};var b=/^(?:td|th)$/;function c(n){var o=n.createBookmarks(),p=n.getRanges(),q=[],r={};function s(A){if(q.length>0)return;if(A.type==CKEDITOR.NODE_ELEMENT&&b.test(A.getName())&&!A.getCustomData('selected_cell')){CKEDITOR.dom.element.setMarker(r,A,'selected_cell',true);q.push(A);}};for(var t=0;t<p.length;t++){var u=p[t];if(u.collapsed){var v=u.getCommonAncestor(),w=v.getAscendant('td',true)||v.getAscendant('th',true);if(w)q.push(w);}else{var x=new CKEDITOR.dom.walker(u),y;x.guard=s;while(y=x.next()){var z=y.getParent();if(z&&b.test(z.getName())&&!z.getCustomData('selected_cell')){CKEDITOR.dom.element.setMarker(r,z,'selected_cell',true);q.push(z);}}}}CKEDITOR.dom.element.clearAllMarkers(r);n.selectBookmarks(o);return q;};function d(n){var o=new CKEDITOR.dom.element(n),p=(o.getName()=='table'?n:o.getAscendant('table')).$,q=p.rows,r=-1,s=[];for(var t=0;t<q.length;t++){r++;if(!s[r])s[r]=[];var u=-1;for(var v=0;v<q[t].cells.length;v++){var w=q[t].cells[v];u++;while(s[r][u])u++;var x=isNaN(w.colSpan)?1:w.colSpan,y=isNaN(w.rowSpan)?1:w.rowSpan;for(var z=0;z<y;z++){if(!s[r+z])s[r+z]=[];for(var A=0;A<x;A++)s[r+z][u+A]=q[t].cells[v];}u+=x-1;}}return s;};function e(n,o){var p=CKEDITOR.env.ie?'_cke_rowspan':'rowSpan';for(var q=0;q<n.length;q++)for(var r=0;r<n[q].length;r++){var s=n[q][r];if(s.parentNode)s.parentNode.removeChild(s);s.colSpan=s[p]=1;}var t=0;for(q=0;q<n.length;q++)for(r=0;r<n[q].length;r++){s=n[q][r];if(!s)continue;if(r>t)t=r;if(s._cke_colScanned)continue;if(n[q][r-1]==s)s.colSpan++;if(n[q][r+1]!=s)s._cke_colScanned=1;}for(q=0;q<=t;q++)for(r=0;r<n.length;r++){if(!n[r])continue;s=n[r][q];if(!s||s._cke_rowScanned)continue;if(n[r-1]&&n[r-1][q]==s)s[p]++;if(!n[r+1]||n[r+1][q]!=s)s._cke_rowScanned=1;}for(q=0;q<n.length;q++)for(r=0;r<n[q].length;r++){s=n[q][r];a(s,'_cke_colScanned');a(s,'_cke_rowScanned');}for(q=0;q<n.length;q++){var u=o.ownerDocument.createElement('tr');for(r=0;r<n[q].length;){s=n[q][r];if(n[q-1]&&n[q-1][r]==s){r+=s.colSpan;continue;}u.appendChild(s);if(p!='rowSpan'){s.rowSpan=s[p];s.removeAttribute(p);}r+=s.colSpan;if(s.colSpan==1)s.removeAttribute('colSpan');if(s.rowSpan==1)s.removeAttribute('rowSpan');}if(CKEDITOR.env.ie)o.rows[q].replaceNode(u);else{var v=new CKEDITOR.dom.element(o.rows[q]),w=new CKEDITOR.dom.element(u);v.setHtml('');w.moveChildren(v);}}};function f(n){var o=n.cells;for(var p=0;p<o.length;p++){o[p].innerHTML='';if(!CKEDITOR.env.ie)new CKEDITOR.dom.element(o[p]).appendBogus(); }};function g(n,o){var p=n.getStartElement().getAscendant('tr');if(!p)return;var q=p.clone(true);q.insertBefore(p);f(o?q.$:p.$);};function h(n){if(n instanceof CKEDITOR.dom.selection){var o=c(n),p=[];for(var q=0;q<o.length;q++){var r=o[q].getParent();p[r.$.rowIndex]=r;}for(q=p.length;q>=0;q--)if(p[q])h(p[q]);}else if(n instanceof CKEDITOR.dom.element){var s=n.getAscendant('table');if(s.$.rows.length==1)s.remove();else n.remove();}};function i(n,o){var p=n.getStartElement(),q=p.getAscendant('td',true)||p.getAscendant('th',true);if(!q)return;var r=q.getAscendant('table'),s=q.$.cellIndex;for(var t=0;t<r.$.rows.length;t++){var u=r.$.rows[t];if(u.cells.length<s+1)continue;q=new CKEDITOR.dom.element(u.cells[s].cloneNode(false));if(!CKEDITOR.env.ie)q.appendBogus();var v=new CKEDITOR.dom.element(u.cells[s]);if(o)q.insertBefore(v);else q.insertAfter(v);}};function j(n){if(n instanceof CKEDITOR.dom.selection){var o=c(n);for(var p=o.length;p>=0;p--)if(o[p])j(o[p]);}else if(n instanceof CKEDITOR.dom.element){var q=n.getAscendant('table'),r=n.$.cellIndex;for(p=q.$.rows.length-1;p>=0;p--){var s=new CKEDITOR.dom.element(q.$.rows[p]);if(!r&&s.$.cells.length==1){h(s);continue;}if(s.$.cells[r])s.$.removeChild(s.$.cells[r]);}}};function k(n,o){var p=n.getStartElement(),q=p.getAscendant('td',true)||p.getAscendant('th',true);if(!q)return;var r=q.clone();if(!CKEDITOR.env.ie)r.appendBogus();if(o)r.insertBefore(q);else r.insertAfter(q);};function l(n){if(n instanceof CKEDITOR.dom.selection){var o=c(n);for(var p=o.length-1;p>=0;p--)l(o[p]);}else if(n instanceof CKEDITOR.dom.element)if(n.getParent().getChildCount()==1)n.getParent().remove();else n.remove();};var m={thead:1,tbody:1,tfoot:1,td:1,tr:1,th:1};CKEDITOR.plugins.tabletools={init:function(n){var o=n.lang.table;n.addCommand('cellProperties',new CKEDITOR.dialogCommand('cellProperties'));CKEDITOR.dialog.add('cellProperties',this.path+'dialogs/tableCell.js');n.addCommand('tableDelete',{exec:function(p){var q=p.getSelection(),r=q&&q.getStartElement(),s=r&&r.getAscendant('table',true);if(!s)return;q.selectElement(s);var t=q.getRanges()[0];t.collapse();q.selectRanges([t]);if(s.getParent().getChildCount()==1)s.getParent().remove();else s.remove();}});n.addCommand('rowDelete',{exec:function(p){var q=p.getSelection();h(q);}});n.addCommand('rowInsertBefore',{exec:function(p){var q=p.getSelection();g(q,true);}});n.addCommand('rowInsertAfter',{exec:function(p){var q=p.getSelection();g(q);}});n.addCommand('columnDelete',{exec:function(p){var q=p.getSelection(); j(q);}});n.addCommand('columnInsertBefore',{exec:function(p){var q=p.getSelection();i(q,true);}});n.addCommand('columnInsertAfter',{exec:function(p){var q=p.getSelection();i(q);}});n.addCommand('cellDelete',{exec:function(p){var q=p.getSelection();l(q);}});n.addCommand('cellInsertBefore',{exec:function(p){var q=p.getSelection();k(q,true);}});n.addCommand('cellInsertAfter',{exec:function(p){var q=p.getSelection();k(q);}});if(n.addMenuItems)n.addMenuItems({tablecell:{label:o.cell.menu,group:'tablecell',order:1,getItems:function(){var p=c(n.getSelection());return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_properties:p.length>0?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};}},tablecell_insertBefore:{label:o.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:o.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:o.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_properties:{label:o.cell.title,group:'tablecellproperties',command:'cellProperties',order:20},tablerow:{label:o.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF};}},tablerow_insertBefore:{label:o.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:o.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:o.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:o.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF};}},tablecolumn_insertBefore:{label:o.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:o.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:o.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(n.contextMenu)n.contextMenu.addListener(function(p,q){if(!p)return null;while(p){if(p.getName() in m)return{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF};p=p.getParent();}return null;});},getSelectedCells:c};CKEDITOR.plugins.add('tabletools',CKEDITOR.plugins.tabletools); })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/tabletools/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('cellProperties',function(a){var b=a.lang.table,c=b.cell,d=a.lang.common,e=CKEDITOR.dialog.validate,f=/^(\d+(?:\.\d+)?)(px|%)$/,g=/^(\d+(?:\.\d+)?)px$/,h=CKEDITOR.tools.bind,i={type:'html',html:'&nbsp;'},j=a.lang.dir=='rtl';function k(l,m){var n=function(){var r=this;p(r);m(r,r._.parentDialog);r._.parentDialog.changeFocus(true);},o=function(){p(this);this._.parentDialog.changeFocus();},p=function(r){r.removeListener('ok',n);r.removeListener('cancel',o);},q=function(r){r.on('ok',n);r.on('cancel',o);};a.execCommand(l);if(a._.storedDialogs.colordialog)q(a._.storedDialogs.colordialog);else CKEDITOR.on('dialogDefinition',function(r){if(r.data.name!=l)return;var s=r.data.definition;r.removeListener();s.onLoad=CKEDITOR.tools.override(s.onLoad,function(t){return function(){q(this);s.onLoad=t;if(typeof t=='function')t.call(this);};});});};return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&CKEDITOR.env.quirks?230:200,contents:[{id:'info',label:c.title,accessKey:'I',elements:[{type:'hbox',widths:['40%','5%','40%'],children:[{type:'vbox',padding:0,children:[{type:'hbox',widths:['70%','30%'],children:[{type:'text',id:'width',width:'100px',label:d.width,validate:e.number(c.invalidWidth),onLoad:function(){var l=this.getDialog().getContentElement('info','widthType'),m=l.getElement(),n=this.getInputElement(),o=n.getAttribute('aria-labelledby');n.setAttribute('aria-labelledby',[o,m.$.id].join(' '));},setup:function(l){var m=parseInt(l.getAttribute('width'),10),n=parseInt(l.getStyle('width'),10);!isNaN(m)&&this.setValue(m);!isNaN(n)&&this.setValue(n);},commit:function(l){var m=parseInt(this.getValue(),10),n=this.getDialog().getValueOf('info','widthType');if(!isNaN(m))l.setStyle('width',m+n);else l.removeStyle('width');l.removeAttribute('width');},'default':''},{type:'select',id:'widthType',label:a.lang.table.widthUnit,labelStyle:'visibility:hidden','default':'px',items:[[b.widthPx,'px'],[b.widthPc,'%']],setup:function(l){var m=f.exec(l.getStyle('width')||l.getAttribute('width'));if(m)this.setValue(m[2]);}}]},{type:'hbox',widths:['70%','30%'],children:[{type:'text',id:'height',label:d.height,width:'100px','default':'',validate:e.number(c.invalidHeight),onLoad:function(){var l=this.getDialog().getContentElement('info','htmlHeightType'),m=l.getElement(),n=this.getInputElement(),o=n.getAttribute('aria-labelledby');n.setAttribute('aria-labelledby',[o,m.$.id].join(' '));},setup:function(l){var m=parseInt(l.getAttribute('height'),10),n=parseInt(l.getStyle('height'),10); !isNaN(m)&&this.setValue(m);!isNaN(n)&&this.setValue(n);},commit:function(l){var m=parseInt(this.getValue(),10);if(!isNaN(m))l.setStyle('height',CKEDITOR.tools.cssLength(m));else l.removeStyle('height');l.removeAttribute('height');}},{id:'htmlHeightType',type:'html',html:'<br />'+b.widthPx}]},i,{type:'select',id:'wordWrap',label:c.wordWrap,'default':'yes',items:[[c.yes,'yes'],[c.no,'no']],setup:function(l){var m=l.getAttribute('noWrap'),n=l.getStyle('white-space');if(n=='nowrap'||m)this.setValue('no');},commit:function(l){if(this.getValue()=='no')l.setStyle('white-space','nowrap');else l.removeStyle('white-space');l.removeAttribute('noWrap');}},i,{type:'select',id:'hAlign',label:c.hAlign,'default':'',items:[[d.notSet,''],[d.alignLeft,'left'],[d.alignCenter,'center'],[d.alignRight,'right']],setup:function(l){var m=l.getAttribute('align'),n=l.getStyle('text-align');this.setValue(n||m||'');},commit:function(l){var m=this.getValue();if(m)l.setStyle('text-align',m);else l.removeStyle('text-align');l.removeAttribute('align');}},{type:'select',id:'vAlign',label:c.vAlign,'default':'',items:[[d.notSet,''],[d.alignTop,'top'],[d.alignMiddle,'middle'],[d.alignBottom,'bottom'],[c.alignBaseline,'baseline']],setup:function(l){var m=l.getAttribute('vAlign'),n=l.getStyle('vertical-align');switch(n){case 'top':case 'middle':case 'bottom':case 'baseline':break;default:n='';}this.setValue(n||m||'');},commit:function(l){var m=this.getValue();if(m)l.setStyle('vertical-align',m);else l.removeStyle('vertical-align');l.removeAttribute('vAlign');}}]},i,{type:'vbox',padding:0,children:[{type:'select',id:'cellType',label:c.cellType,'default':'td',items:[[c.data,'td'],[c.header,'th']],setup:function(l){this.setValue(l.getName());},commit:function(l){l.renameNode(this.getValue());}},i,{type:'text',id:'rowSpan',label:c.rowSpan,'default':'',validate:e.integer(c.invalidRowSpan),setup:function(l){var m=parseInt(l.getAttribute('rowSpan'),10);if(m&&m!=1)this.setValue(m);},commit:function(l){var m=parseInt(this.getValue(),10);if(m&&m!=1)l.setAttribute('rowSpan',this.getValue());else l.removeAttribute('rowSpan');}},{type:'text',id:'colSpan',label:c.colSpan,'default':'',validate:e.integer(c.invalidColSpan),setup:function(l){var m=parseInt(l.getAttribute('colSpan'),10);if(m&&m!=1)this.setValue(m);},commit:function(l){var m=parseInt(this.getValue(),10);if(m&&m!=1)l.setAttribute('colSpan',this.getValue());else l.removeAttribute('colSpan');}},i,{type:'hbox',padding:0,widths:['60%','40%'],children:[{type:'text',id:'bgColor',label:c.bgColor,'default':'',setup:function(l){var m=l.getAttribute('bgColor'),n=l.getStyle('background-color'); this.setValue(n||m);},commit:function(l){var m=this.getValue();if(m)l.setStyle('background-color',this.getValue());else l.removeStyle('background-color');l.removeAttribute('bgColor');}},{type:'button',id:'bgColorChoose','class':'colorChooser',label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle('vertical-align','bottom');},onClick:function(){var l=this;k('colordialog',function(m){l.getDialog().getContentElement('info','bgColor').setValue(m.getContentElement('picker','selectedColor').getValue());});}}]},i,{type:'hbox',padding:0,widths:['60%','40%'],children:[{type:'text',id:'borderColor',label:c.borderColor,'default':'',setup:function(l){var m=l.getAttribute('borderColor'),n=l.getStyle('border-color');this.setValue(n||m);},commit:function(l){var m=this.getValue();if(m)l.setStyle('border-color',this.getValue());else l.removeStyle('border-color');l.removeAttribute('borderColor');}},{type:'button',id:'borderColorChoose','class':'colorChooser',label:c.chooseColor,style:(j?'margin-right':'margin-left')+': 10px',onLoad:function(){this.getElement().getParent().setStyle('vertical-align','bottom');},onClick:function(){var l=this;k('colordialog',function(m){l.getDialog().getContentElement('info','borderColor').setValue(m.getContentElement('picker','selectedColor').getValue());});}}]}]}]}]}],onShow:function(){var l=this;l.cells=CKEDITOR.plugins.tabletools.getSelectedCells(l._.editor.getSelection());l.setupContent(l.cells[0]);},onOk:function(){var r=this;var l=r._.editor.getSelection(),m=l.createBookmarks(),n=r.cells;for(var o=0;o<n.length;o++)r.commitContent(n[o]);l.selectBookmarks(m);var p=l.getStartElement(),q=new CKEDITOR.dom.elementPath(p);r._.editor._.selectionPreviousPath=q;r._.editor.fire('selectionChange',{selection:l,path:q,element:p});}};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/tabletools/dialogs/tableCell.js
tableCell.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=function(c,d){return c._.modes&&c._.modes[d||c.mode];},b;CKEDITOR.plugins.add('editingblock',{init:function(c){if(!c.config.editingBlock)return;c.on('themeSpace',function(d){if(d.data.space=='contents')d.data.html+='<br>';});c.on('themeLoaded',function(){c.fireOnce('editingBlockReady');});c.on('uiReady',function(){c.setMode(c.config.startupMode);});c.on('afterSetData',function(){if(!b){function d(){b=true;a(c).loadData(c.getData());b=false;};if(c.mode)d();else c.on('mode',function(){d();c.removeListener('mode',arguments.callee);});}});c.on('beforeGetData',function(){if(!b&&c.mode){b=true;c.setData(a(c).getData());b=false;}});c.on('getSnapshot',function(d){if(c.mode)d.data=a(c).getSnapshotData();});c.on('loadSnapshot',function(d){if(c.mode)a(c).loadSnapshotData(d.data);});c.on('mode',function(d){d.removeListener();var e=c.container;if(CKEDITOR.env.webkit&&CKEDITOR.env.version<528){var f=c.config.tabIndex||c.element.getAttribute('tabindex')||0;e=e.append(CKEDITOR.dom.element.createFromHtml('<input tabindex="'+f+'"'+' style="position:absolute; left:-10000">'));}e.on('focus',function(){c.focus();});if(c.config.startupFocus)c.focus();setTimeout(function(){c.fireOnce('instanceReady');CKEDITOR.fire('instanceReady',null,c);});});}});CKEDITOR.editor.prototype.mode='';CKEDITOR.editor.prototype.addMode=function(c,d){d.name=c;(this._.modes||(this._.modes={}))[c]=d;};CKEDITOR.editor.prototype.setMode=function(c){var d,e=this.getThemeSpace('contents'),f=this.checkDirty();if(this.mode){if(c==this.mode)return;this.fire('beforeModeUnload');var g=a(this);d=g.getData();g.unload(e);this.mode='';}e.setHtml('');var h=a(this,c);if(!h)throw '[CKEDITOR.editor.setMode] Unknown mode "'+c+'".';if(!f)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});h.load(e,typeof d!='string'?this.getData():d);};CKEDITOR.editor.prototype.focus=function(){var c=a(this);if(c)c.focus();};})();CKEDITOR.config.startupMode='wysiwyg';CKEDITOR.config.startupFocus=false;CKEDITOR.config.editingBlock=true;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/editingblock/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(d,e){var f;try{f=d.getSelection().getRanges()[0];}catch(g){return null;}f.shrink(CKEDITOR.SHRINK_TEXT);return f.getCommonAncestor().getAscendant(e,1);};var b={a:'lower-alpha',A:'upper-alpha',i:'lower-roman',I:'upper-roman',1:'decimal',disc:'disc',circle:'circle',square:'square'};function c(d,e){var f=d.lang.list;if(e=='bulletedListStyle')return{title:f.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'select',label:f.type,id:'type',style:'width: 150px; margin: auto;',items:[[f.notset,''],[f.circle,'circle'],[f.disc,'disc'],[f.square,'square']],setup:function(h){var i=h.getStyle('list-style-type')||b[h.getAttribute('type')]||h.getAttribute('type')||'';this.setValue(i);},commit:function(h){var i=this.getValue();if(i)h.setStyle('list-style-type',i);else h.removeStyle('list-style-type');}}]}],onShow:function(){var h=this.getParentEditor(),i=a(h,'ul');i&&this.setupContent(i);},onOk:function(){var h=this.getParentEditor(),i=a(h,'ul');i&&this.commitContent(i);}};else if(e=='numberedListStyle'){var g=[[f.notset,''],[f.lowerRoman,'lower-roman'],[f.upperRoman,'upper-roman'],[f.lowerAlpha,'lower-alpha'],[f.upperAlpha,'upper-alpha'],[f.decimal,'decimal']];if(!CKEDITOR.env.ie||CKEDITOR.env.version>7)g.concat([[f.armenian,'armenian'],[f.decimalLeadingZero,'decimal-leading-zero'],[f.georgian,'georgian'],[f.lowerGreek,'lower-greek']]);return{title:f.numberedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'hbox',widths:['25%','75%'],children:[{label:f.start,type:'text',id:'start',validate:CKEDITOR.dialog.validate.integer(f.validateStartNumber),setup:function(h){var i=h.getAttribute('start')||1;i&&this.setValue(i);},commit:function(h){h.setAttribute('start',this.getValue());}},{type:'select',label:f.type,id:'type',style:'width: 100%;',items:g,setup:function(h){var i=h.getStyle('list-style-type')||b[h.getAttribute('type')]||h.getAttribute('type')||'';this.setValue(i);},commit:function(h){var i=this.getValue();if(i)h.setStyle('list-style-type',i);else h.removeStyle('list-style-type');}}]}]}],onShow:function(){var h=this.getParentEditor(),i=a(h,'ol');i&&this.setupContent(i);},onOk:function(){var h=this.getParentEditor(),i=a(h,'ol');i&&this.commitContent(i);}};}};CKEDITOR.dialog.add('numberedListStyle',function(d){return c(d,'numberedListStyle');});CKEDITOR.dialog.add('bulletedListStyle',function(d){return c(d,'bulletedListStyle');});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/liststyle/dialogs/liststyle.js
liststyle.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=function(){this.toolbars=[];this.focusCommandExecuted=false;};a.prototype.focus=function(){for(var c=0,d;d=this.toolbars[c++];)for(var e=0,f;f=d.items[e++];)if(f.focus){f.focus();return;}};var b={toolbarFocus:{modes:{wysiwyg:1,source:1},exec:function(c){if(c.toolbox){c.toolbox.focusCommandExecuted=true;if(CKEDITOR.env.ie)setTimeout(function(){c.toolbox.focus();},100);else c.toolbox.focus();}}}};CKEDITOR.plugins.add('toolbar',{init:function(c){var d=function(e,f){switch(f){case 39:case 9:while((e=e.next||e.toolbar.next&&e.toolbar.next.items[0])&&(!e.focus)){}if(e)e.focus();else c.toolbox.focus();return false;case 37:case CKEDITOR.SHIFT+9:while((e=e.previous||e.toolbar.previous&&e.toolbar.previous.items[e.toolbar.previous.items.length-1])&&(!e.focus)){}if(e)e.focus();else{var g=c.toolbox.toolbars[c.toolbox.toolbars.length-1].items;g[g.length-1].focus();}return false;case 27:c.focus();return false;case 13:case 32:e.execute();return false;}return true;};c.on('themeSpace',function(e){if(e.data.space==c.config.toolbarLocation){c.toolbox=new a();var f=['<div class="cke_toolbox"'],g=c.config.toolbarStartupExpanded,h;f.push(g?'>':' style="display:none">');var i=c.toolbox.toolbars,j=c.config.toolbar instanceof Array?c.config.toolbar:c.config['toolbar_'+c.config.toolbar];for(var k=0;k<j.length;k++){var l=j[k];if(!l)continue;var m='cke_'+CKEDITOR.tools.getNextNumber(),n={id:m,items:[]};if(h){f.push('</div>');h=0;}if(l==='/'){f.push('<div class="cke_break"></div>');continue;}f.push('<span id="',m,'" class="cke_toolbar"><span class="cke_toolbar_start"></span>');var o=i.push(n)-1;if(o>0){n.previous=i[o-1];n.previous.next=n;}for(var p=0;p<l.length;p++){var q,r=l[p];if(r=='-')q=CKEDITOR.ui.separator;else q=c.ui.create(r);if(q){if(q.canGroup){if(!h){f.push('<span class="cke_toolgroup">');h=1;}}else if(h){f.push('</span>');h=0;}var s=q.render(c,f);o=n.items.push(s)-1;if(o>0){s.previous=n.items[o-1];s.previous.next=s;}s.toolbar=n;s.onkey=d;s.onfocus=function(){if(!c.toolbox.focusCommandExecuted)c.focus();};}}if(h){f.push('</span>');h=0;}f.push('<span class="cke_toolbar_end"></span></span>');}f.push('</div>');if(c.config.toolbarCanCollapse){var t=CKEDITOR.tools.addFunction(function(){c.execCommand('toolbarCollapse');}),u='cke_'+CKEDITOR.tools.getNextNumber();c.addCommand('toolbarCollapse',{exec:function(v){var w=CKEDITOR.document.getById(u),x=w.getPrevious(),y=v.getThemeSpace('contents'),z=x.getParent(),A=parseInt(y.$.style.height,10),B=z.$.offsetHeight;if(x.isVisible()){x.hide(); w.addClass('cke_toolbox_collapser_min');}else{x.show();w.removeClass('cke_toolbox_collapser_min');}var C=z.$.offsetHeight-B;y.setStyle('height',A-C+'px');},modes:{wysiwyg:1,source:1}});f.push('<a id="'+u+'" class="cke_toolbox_collapser');if(!g)f.push(' cke_toolbox_collapser_min');f.push('" onclick="CKEDITOR.tools.callFunction('+t+')"></a>');}e.data.html+=f.join('');}});c.addCommand('toolbarFocus',b.toolbarFocus);}});})();CKEDITOR.ui.separator={render:function(a,b){b.push('<span class="cke_separator"></span>');return{};}};CKEDITOR.config.toolbarLocation='top';CKEDITOR.config.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];CKEDITOR.config.toolbar_Full=[['Source','-','Save','NewPage','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']];CKEDITOR.config.toolbar='Full';CKEDITOR.config.toolbarCanCollapse=true;CKEDITOR.config.toolbarStartupExpanded=true;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/toolbar/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('panel',{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler);}});CKEDITOR.UI_PANEL=2;CKEDITOR.ui.panel=function(a,b){var c=this;if(b)CKEDITOR.tools.extend(c,b);CKEDITOR.tools.extend(c,{className:'',css:[]});c.id=CKEDITOR.tools.getNextNumber();c.document=a;c._={blocks:{}};};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a);}};CKEDITOR.ui.panel.prototype={renderHtml:function(a){var b=[];this.render(a,b);return b.join('');},render:function(a,b){var d=this;var c='cke_'+d.id;b.push('<div class="',a.skinClass,'" lang="',a.langCode,'" style="display:none;z-index:'+(a.config.baseFloatZIndex+1)+'">'+'<div'+' id=',c,' dir=',a.lang.dir,' class="cke_panel cke_',a.lang.dir);if(d.className)b.push(' ',d.className);b.push('">');if(d.forceIFrame||d.css.length){b.push('<iframe id="',c,'_frame" frameborder="0" src="javascript:void(');b.push(CKEDITOR.env.isCustomDomain()?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');b.push(')"></iframe>');}b.push('</div></div>');return c;},getHolderElement:function(){var a=this._.holder;if(!a){if(this.forceIFrame||this.css.length){var b=this.document.getById('cke_'+this.id+'_frame'),c=b.getParent(),d=c.getAttribute('dir'),e=c.getParent().getAttribute('class'),f=c.getParent().getAttribute('lang'),g=b.getFrameDocument();g.$.open();if(CKEDITOR.env.isCustomDomain())g.$.domain=document.domain;var h=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(j){this.isLoaded=true;if(this.onLoad)this.onLoad();},this));g.$.write('<!DOCTYPE html><html dir="'+d+'" class="'+e+'_container" lang="'+f+'">'+'<head>'+'<style>.'+e+'_container{visibility:hidden}</style>'+'</head>'+'<body class="cke_'+d+' cke_panel_frame '+CKEDITOR.env.cssClass+'" style="margin:0;padding:0"'+' onload="( window.CKEDITOR || window.parent.CKEDITOR ).tools.callFunction('+h+');">'+'</body>'+'<link type="text/css" rel=stylesheet href="'+this.css.join('"><link type="text/css" rel="stylesheet" href="')+'">'+'</html>');g.$.close();var i=g.getWindow();i.$.CKEDITOR=CKEDITOR;g.on('keydown',function(j){var l=this;var k=j.data.getKeystroke();if(l._.onKeyDown&&l._.onKeyDown(k)===false){j.data.preventDefault();return;}if(k==27)l.onEscape&&l.onEscape();},this);a=g.getBody();}else a=this.document.getById('cke_'+this.id);this._.holder=a;}return a;},addBlock:function(a,b){var c=this;b=c._.blocks[a]=b||new CKEDITOR.ui.panel.block(c.getHolderElement());if(!c._.currentBlock)c.showBlock(a); return b;},getBlock:function(a){return this._.blocks[a];},showBlock:function(a){var e=this;var b=e._.blocks,c=b[a],d=e._.currentBlock;if(d)d.hide();e._.currentBlock=c;c._.focusIndex=-1;e._.onKeyDown=c.onKeyDown&&CKEDITOR.tools.bind(c.onKeyDown,c);c.show();return c;}};CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(a){var b=this;b.element=a.append(a.getDocument().createElement('div',{attributes:{'class':'cke_panel_block'},styles:{display:'none'}}));b.keys={};b._.focusIndex=-1;b.element.disableContextMenu();},_:{},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var a=this;if(!a.onHide||a.onHide.call(a)!==true)a.element.setStyle('display','none');},onKeyDown:function(a){var f=this;var b=f.keys[a];switch(b){case 'next':var c=f._.focusIndex,d=f.element.getElementsByTag('a'),e;while(e=d.getItem(++c))if(e.getAttribute('_cke_focus')&&e.$.offsetWidth){f._.focusIndex=c;e.focus();break;}return false;case 'prev':c=f._.focusIndex;d=f.element.getElementsByTag('a');while(c>0&&(e=d.getItem(--c)))if(e.getAttribute('_cke_focus')&&e.$.offsetWidth){f._.focusIndex=c;e.focus();break;}return false;case 'click':c=f._.focusIndex;e=c>=0&&f.element.getElementsByTag('a').getItem(c);if(e)e.$.click?e.$.click():e.$.onclick();return false;}return true;}}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/panel/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('checkspell',function(a){var b=CKEDITOR.tools.getNextNumber(),c='cke_frame_'+b,d='cke_data_'+b,e='cke_error_'+b,f,g=document.location.protocol||'http:',h=a.lang.spellCheck.notAvailable,i='<textarea style="display: none" id="'+d+'"'+' rows="10"'+' cols="40">'+' </textarea><div'+' id="'+e+'"'+' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">'+'</div><iframe'+' src=""'+' style="width:100%;background-color:#f1f1e3;"'+' frameborder="0"'+' name="'+c+'"'+' id="'+c+'"'+' allowtransparency="1">'+'</iframe>',j=a.config.wsc_customLoaderScript||g+'//loader.spellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">'+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'</p>';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px'); if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/wsc/dialogs/wsc.js
wsc.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('pastefromword',function(a){return{title:a.lang.pastefromword.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.ie&&CKEDITOR.env.quirks?270:260,htmlToLoad:'<!doctype html><script type="text/javascript">window.onload = function(){if ( '+CKEDITOR.env.ie+' ) '+'document.body.contentEditable = "true";'+'else '+'document.designMode = "on";'+'var iframe = new window.parent.CKEDITOR.dom.element( frameElement );'+'var dialog = iframe.getCustomData( "dialog" );'+''+'iframe.getFrameDocument().on( "keydown", function( e )\t\t\t\t\t\t{\t\t\t\t\t\t\tif ( e.data.getKeystroke() == 27 )\t\t\t\t\t\t\t\tdialog.hide();\t\t\t\t\t\t});'+'dialog.fire( "iframeAdded", { iframe : iframe } );'+'};'+'</script><style>body { margin: 3px; height: 95%; } </style><body></body>',cleanWord:function(b,c,d,e){c=c.replace(/<\!--[\s\S]*?-->/g,'');c=c.replace(/<o:p>\s*<\/o:p>/g,'');c=c.replace(/<o:p>[\s\S]*?<\/o:p>/g,'&nbsp;');c=c.replace(/\s*mso-[^:]+:[^;"]+;?/gi,'');c=c.replace(/\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*;/gi,'');c=c.replace(/\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*"/gi,'"');c=c.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,'');c=c.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,'"');c=c.replace(/\s*TEXT-ALIGN: [^\s;]+;?"/gi,'"');c=c.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,'"');c=c.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,'"');c=c.replace(/\s*tab-stops:[^;"]*;?/gi,'');c=c.replace(/\s*tab-stops:[^"]*/gi,'');if(d){c=c.replace(/\s*face="[^"]*"/gi,'');c=c.replace(/\s*face=[^ >]*/gi,'');c=c.replace(/\s*FONT-FAMILY:[^;"]*;?/gi,'');}c=c.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,'<$1$3');if(e)c=c.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi,'<$1$3');c=c.replace(/<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi,'');c=c.replace(/<(?:META|LINK)[^>]*>\s*/gi,'');c=c.replace(/\s*style="\s*"/gi,'');c=c.replace(/<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi,'&nbsp;');c=c.replace(/<SPAN\s*[^>]*><\/SPAN>/gi,'');c=c.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,'<$1$3');c=c.replace(/<SPAN\s*>([\s\S]*?)<\/SPAN>/gi,'$1');c=c.replace(/<FONT\s*>([\s\S]*?)<\/FONT>/gi,'$1');c=c.replace(/<\\?\?xml[^>]*>/gi,'');c=c.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,'');c=c.replace(/<\/?\w+:[^>]*>/gi,'');c=c.replace(/<(U|I|STRIKE)>&nbsp;<\/\1>/g,'&nbsp;');c=c.replace(/<H\d>\s*<\/H\d>/gi,'');c=c.replace(/<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig,'');c=c.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,'<$1$3');c=c.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,'<$1$3');c=c.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,'<$1$3'); if(b.config.pasteFromWordKeepsStructure){c=c.replace(/<H(\d)([^>]*)>/gi,'<h$1>');c=c.replace(/<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi,'<$1>$2</$1>');c=c.replace(/<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi,'<$1>$2</$1>');}else{c=c.replace(/<H1([^>]*)>/gi,'<div$1><b><font size="6">');c=c.replace(/<H2([^>]*)>/gi,'<div$1><b><font size="5">');c=c.replace(/<H3([^>]*)>/gi,'<div$1><b><font size="4">');c=c.replace(/<H4([^>]*)>/gi,'<div$1><b><font size="3">');c=c.replace(/<H5([^>]*)>/gi,'<div$1><b><font size="2">');c=c.replace(/<H6([^>]*)>/gi,'<div$1><b><font size="1">');c=c.replace(/<\/H\d>/gi,'</font></b></div>');var f=new RegExp('(<P)([^>]*>[\\s\\S]*?)(</P>)','gi');c=c.replace(f,'<div$2</div>');c=c.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');c=c.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');c=c.replace(/<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g,'');}return c;},onShow:function(){var g=this;if(CKEDITOR.env.ie)g.getParentEditor().document.getBody().$.contentEditable='false';g.parts.dialog.$.offsetHeight;var b=g.getContentElement('general','editing_area').getElement(),c=CKEDITOR.dom.element.createFromHtml('<iframe src="javascript:void(0)" frameborder="0" allowtransparency="1"></iframe>'),d=g.getParentEditor().lang;c.setStyles({width:'346px',height:'152px','background-color':'white',border:'1px solid black'});c.setCustomData('dialog',g);var e=d.editorTitle.replace('%1',d.pastefromword.title);if(CKEDITOR.env.ie)b.setHtml('<legend style="position:absolute;top:-1000000px;left:-1000000px;">'+CKEDITOR.tools.htmlEncode(e)+'</legend>');else{b.setHtml('');b.setAttributes({role:'region',title:e});c.setAttributes({role:'region',title:' '});}b.append(c);if(CKEDITOR.env.ie)b.setStyle('height',c.$.offsetHeight+2+'px');if(CKEDITOR.env.isCustomDomain()){CKEDITOR._cke_htmlToLoad=g.definition.htmlToLoad;c.setAttribute('src','javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.parent.CKEDITOR._cke_htmlToLoad );'+'delete window.parent.CKEDITOR._cke_htmlToLoad;'+'document.close();'+'})() )');}else{var f=c.$.contentWindow.document;f.open();f.write(g.definition.htmlToLoad);f.close();}},onOk:function(){var b=this.getContentElement('general','editing_area').getElement(),c=b.getElementsByTag('iframe').getItem(0),d=this.getParentEditor(),e=this.definition.cleanWord(d,c.$.contentWindow.document.body.innerHTML,this.getValueOf('general','ignoreFontFace'),this.getValueOf('general','removeStyle'));setTimeout(function(){d.insertHtml(e);},0);},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true'; },onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&(a.lang.dir=='rtl'))this.parts.contents.setStyle('overflow','hidden');},contents:[{id:'general',label:a.lang.pastefromword.title,elements:[{type:'html',style:'white-space:normal;width:346px;display:block',onShow:function(){if(CKEDITOR.env.webkit)this.getElement().getAscendant('table').setStyle('table-layout','fixed');},html:a.lang.pastefromword.advice},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'<fieldset></fieldset>',focus:function(){var b=this.getElement(),c=b.getElementsByTag('iframe');if(c.count()<1)return;c=c.getItem(0);setTimeout(function(){c.$.contentWindow.focus();},500);}},{type:'vbox',padding:0,children:[{type:'checkbox',id:'ignoreFontFace',label:a.lang.pastefromword.ignoreFontFace,'default':a.config.pasteFromWordIgnoreFontFace},{type:'checkbox',id:'removeStyle',label:a.lang.pastefromword.removeStyle,'default':a.config.pasteFromWordRemoveStyle}]}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/pastefromword/dialogs/pastefromword.js
pastefromword.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=CKEDITOR.htmlParser.fragment.prototype,b=CKEDITOR.htmlParser.element.prototype;a.onlyChild=b.onlyChild=function(){var k=this.children,l=k.length,m=l==1&&k[0];return m||null;};b.removeAnyChildWithName=function(k){var l=this.children,m=[],n;for(var o=0;o<l.length;o++){n=l[o];if(!n.name)continue;if(n.name==k){m.push(n);l.splice(o--,1);}m=m.concat(n.removeAnyChildWithName(k));}return m;};b.getAncestor=function(k){var l=this.parent;while(l&&!(l.name&&l.name.match(k)))l=l.parent;return l;};a.firstChild=b.firstChild=function(k){var l;for(var m=0;m<this.children.length;m++){l=this.children[m];if(k(l))return l;else if(l.name){l=l.firstChild(k);if(l)return l;}}return null;};b.addStyle=function(k,l,m){var q=this;var n,o='';if(typeof l=='string')o+=k+':'+l+';';else{if(typeof k=='object')for(var p in k){if(k.hasOwnProperty(p))o+=p+':'+k[p]+';';}else o+=k;m=l;}if(!q.attributes)q.attributes={};n=q.attributes.style||'';n=(m?[o,n]:[n,o]).join(';');q.attributes.style=n.replace(/^;|;(?=;)/,'');};CKEDITOR.dtd.parentOf=function(k){var l={};for(var m in this){if(m.indexOf('$')==-1&&this[m][k])l[m]=1;}return l;};var c=/^([.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i,d=/^(?:\b0[^\s]*\s*){1,4}$/,e='^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$',f=new RegExp(e),g=new RegExp(e.toUpperCase()),h=0,i;CKEDITOR.plugins.pastefromword={utils:{createListBulletMarker:function(k,l){var m=new CKEDITOR.htmlParser.element('cke:listbullet'),n;if(!k){k='decimal';n='ol';}else if(k[2]){if(!isNaN(k[1]))k='decimal';else if(f.test(k[1]))k='lower-roman';else if(g.test(k[1]))k='upper-roman';else if(/^[a-z]+$/.test(k[1]))k='lower-alpha';else if(/^[A-Z]+$/.test(k[1]))k='upper-alpha';else k='decimal';n='ol';}else{if(/[l\u00B7\u2002]/.test(k[1]))k='disc';else if(/[\u006F\u00D8]/.test(k[1]))k='circle';else if(/[\u006E\u25C6]/.test(k[1]))k='square';else k='disc';n='ul';}m.attributes={'cke:listtype':n,style:'list-style-type:'+k+';'};m.add(new CKEDITOR.htmlParser.text(l));return m;},isListBulletIndicator:function(k){var l=k.attributes&&k.attributes.style;if(/mso-list\s*:\s*Ignore/i.test(l))return true;},isContainingOnlySpaces:function(k){var l;return(l=k.onlyChild())&&/^(:?\s|&nbsp;)+$/.test(l.value);},resolveList:function(k){var l=k.attributes,m;if((m=k.removeAnyChildWithName('cke:listbullet'))&&m.length&&(m=m[0])){k.name='cke:li';if(l.style)l.style=CKEDITOR.plugins.pastefromword.filters.stylesFilter([['text-indent'],['line-height'],[/^margin(:?-left)?$/,null,function(p){var q=p.split(' '); p=CKEDITOR.plugins.pastefromword.utils.convertToPx(q[3]||q[1]||q[0]);p=parseInt(p,10);if(!h&&i&&p>i)h=p-i;l['cke:margin']=i=p;}]])(l.style,k)||'';var n=m.attributes,o=n.style;k.addStyle(o);CKEDITOR.tools.extend(l,n);return true;}return false;},convertToPx:(function(){var k=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(k);return function(l){if(c.test(l)){k.setStyle('width',l);return k.$.clientWidth+'px';}return l;};})(),getStyleComponents:(function(){var k=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(k);return function(l,m,n){k.setStyle(l,m);var o={},p=n.length;for(var q=0;q<p;q++)o[n[q]]=k.getStyle(n[q]);return o;};})(),listDtdParents:CKEDITOR.dtd.parentOf('ol')},filters:{flattenList:function(k){var l=k.attributes,m=k.parent,n,o=1;while(m){m.attributes&&m.attributes['cke:list']&&o++;m=m.parent;}switch(l.type){case 'a':n='lower-alpha';break;}var p=k.children,q;for(var r=0;r<p.length;r++){q=p[r];var s=q.attributes;if(q.name in CKEDITOR.dtd.$listItem){var t=q.children,u=t.length,v=t[u-1];if(v.name in CKEDITOR.dtd.$list){p.splice(r+1,0,v);v.parent=k;if(!--t.length)p.splice(r,1);}q.name='cke:li';s['cke:indent']=o;i=0;s['cke:listtype']=k.name;n&&q.addStyle('list-style-type',n,true);}}delete k.name;l['cke:list']=1;},assembleList:function(k){var l=k.children,m,n,o,p,q,r,s,t,u;for(var v=0;v<l.length;v++){m=l[v];if('cke:li'==m.name){m.name='li';n=m;o=n.attributes;p=n.attributes['cke:listtype'];q=parseInt(o['cke:indent'],10)||h&&Math.ceil(o['cke:margin']/h)||1;o.style&&(o.style=CKEDITOR.plugins.pastefromword.filters.stylesFilter([['list-style-type',p=='ol'?'decimal':'disc']])(o.style)||'');if(!s){s=new CKEDITOR.htmlParser.element(p);s.add(n);l[v]=s;}else{if(q>u){s=new CKEDITOR.htmlParser.element(p);s.add(n);r.add(s);}else if(q<u){var w=u-q,x;while(w--&&(x=s.parent))s=x.parent;s.add(n);}else s.add(n);l.splice(v--,1);}r=n;u=q;}else s=null;}h=0;},falsyFilter:function(k){return false;},stylesFilter:function(k,l){return function(m,n){var o=[];m.replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(q,r,s){r=r.toLowerCase();r=='font-family'&&(s=s.replace(/["']/g,''));var t,u,v,w;for(var x=0;x<k.length;x++){if(k[x]){t=k[x][0];u=k[x][1];v=k[x][2];w=k[x][3];if(r.match(t)&&(!u||s.match(u))){r=w||r;l&&(v=v||s); if(typeof v=='function')v=v(s,n,r);if(v&&v.push)r=v[0],v=v[1];if(typeof v=='string')o.push([r,v]);return;}}}!l&&o.push([r,s]);});for(var p=0;p<o.length;p++)o[p]=o[p].join(':');return o.length?o.join(';')+';':false;};},elementMigrateFilter:function(k,l){return function(m){var n=l?new CKEDITOR.style(k,l)._.definition:k;m.name=n.element;CKEDITOR.tools.extend(m.attributes,CKEDITOR.tools.clone(n.attributes));m.addStyle(CKEDITOR.style.getStyleText(n));};},styleMigrateFilter:function(k,l){var m=this.elementMigrateFilter;return function(n,o){var p=new CKEDITOR.htmlParser.element(null),q={};q[l]=n;m(k,q)(p);p.children=o.children;o.children=[p];};},bogusAttrFilter:function(k,l){if(l.name.indexOf('cke:')==-1)return false;},applyStyleFilter:null},getRules:function(k){var l=CKEDITOR.dtd,m=CKEDITOR.tools.extend({},l.$block,l.$listItem,l.$tableContent),n=k.config,o=this.filters,p=o.falsyFilter,q=o.stylesFilter,r=o.elementMigrateFilter,s=CKEDITOR.tools.bind(this.filters.styleMigrateFilter,this.filters),t=this.utils.createListBulletMarker,u=o.flattenList,v=o.assembleList,w=this.utils.isListBulletIndicator,x=this.utils.isContainingOnlySpaces,y=this.utils.resolveList,z=this.utils.convertToPx,A=this.utils.getStyleComponents,B=this.utils.listDtdParents,C=n.pasteFromWordRemoveFontStyles!==false,D=n.pasteFromWordRemoveStyles!==false;return{elementNames:[[/meta|link|script/,'']],root:function(E){E.filterChildren();v(E);},elements:{'^':function(E){var F;if(CKEDITOR.env.gecko&&(F=o.applyStyleFilter))F(E);},$:function(E){var F=E.name||'',G=E.attributes;if(F in m&&G.style)G.style=q([[/^(:?width|height)$/,null,z]])(G.style)||'';if(F.match(/h\d/)){E.filterChildren();if(y(E))return;r(n['format_'+F])(E);}else if(F in l.$inline){E.filterChildren();if(x(E))delete E.name;}else if(F.indexOf(':')!=-1&&F.indexOf('cke')==-1){E.filterChildren();if(F=='v:imagedata'){var H=E.attributes['o:href'];if(H)E.attributes.src=H;E.name='img';return;}delete E.name;}if(F in B){E.filterChildren();v(E);}},style:function(E){if(CKEDITOR.env.gecko){var F=E.onlyChild().value.match(/\/\* Style Definitions \*\/([\s\S]*?)\/\*/),G=F&&F[1],H={};if(G){G.replace(/[\n\r]/g,'').replace(/(.+?)\{(.+?)\}/g,function(I,J,K){J=J.split(',');var L=J.length,M;for(var N=0;N<L;N++)CKEDITOR.tools.trim(J[N]).replace(/^(\w+)(\.[\w-]+)?$/g,function(O,P,Q){P=P||'*';Q=Q.substring(1,Q.length);if(Q.match(/MsoNormal/))return;if(!H[P])H[P]={};if(Q)H[P][Q]=K;else H[P]=K;});});o.applyStyleFilter=function(I){var J=H['*']?'*':I.name,K=I.attributes&&I.attributes['class'],L; if(J in H){L=H[J];if(typeof L=='object')L=L[K];L&&I.addStyle(L,true);}};}}return false;},p:function(E){E.filterChildren();if(y(E))return;if(n.enterMode==CKEDITOR.ENTER_BR){delete E.name;E.add(new CKEDITOR.htmlParser.element('br'));}else r(n['format_'+(n.enterMode==CKEDITOR.ENTER_P?'p':'div')])(E);},div:function(E){var F=E.onlyChild();if(F&&F.name=='table'){var G=E.attributes;F.attributes=CKEDITOR.tools.extend(F.attributes,G);G.style&&F.addStyle(G.style);var H=new CKEDITOR.htmlParser.element('div');H.addStyle('clear','both');E.add(H);delete E.name;}},td:function(E){if(E.getAncestor('thead'))E.name='th';},ol:u,ul:u,dl:u,font:function(E){if(!CKEDITOR.env.gecko&&w(E.parent)){delete E.name;return;}E.filterChildren();var F=E.attributes,G=F.style,H=E.parent;if('font'==H.name){CKEDITOR.tools.extend(H.attributes,E.attributes);G&&H.addStyle(G);delete E.name;}else{G=G||'';if(F.color){F.color!='#000000'&&(G+='color:'+F.color+';');delete F.color;}if(F.face){G+='font-family:'+F.face+';';delete F.face;}if(F.size){G+='font-size:'+(F.size>3?'large':F.size<3?'small':'medium')+';';delete F.size;}E.name='span';E.addStyle(G);}},span:function(E){if(!CKEDITOR.env.gecko&&w(E.parent))return false;E.filterChildren();if(x(E)){delete E.name;return null;}if(!CKEDITOR.env.gecko&&w(E)){var F=E.firstChild(function(M){return M.value||M.name=='img';}),G=F&&(F.value||'l.'),H=G.match(/^([^\s]+?)([.)]?)$/);return t(H,G);}var I=E.children,J=E.attributes,K=J&&J.style,L=I&&I[0];if(K)J.style=q([['line-height'],[/^font-family$/,null,!C?s(n.font_style,'family'):null],[/^font-size$/,null,!C?s(n.fontSize_style,'size'):null],[/^color$/,null,!C?s(n.colorButton_foreStyle,'color'):null],[/^background-color$/,null,!C?s(n.colorButton_backStyle,'color'):null]])(K,E)||'';return null;},b:r(n.coreStyles_bold),i:r(n.coreStyles_italic),u:r(n.coreStyles_underline),s:r(n.coreStyles_strike),sup:r(n.coreStyles_superscript),sub:r(n.coreStyles_subscript),a:function(E){var F=E.attributes;if(F&&!F.href&&F.name)delete E.name;},'cke:listbullet':function(E){if(E.getAncestor(/h\d/)&&!n.pasteFromWordNumberedHeadingToList)delete E.name;}},attributeNames:[[/^onmouse(:?out|over)/,''],[/^onload$/,''],[/(?:v|o):\w+/,''],[/^lang/,'']],attributes:{style:q(D?[[/^margin$|^margin-(?!bottom|top)/,null,function(E,F,G){if(F.name in {p:1,div:1}){var H=n.contentsLangDirection=='ltr'?'margin-left':'margin-right';if(G=='margin')E=A(G,E,[H])[H];else if(G!=H)return null;if(E&&!d.test(E))return[H,E];}return null;}],[/^clear$/],[/^border.*|margin.*|vertical-align|float$/,null,function(E,F){if(F.name=='img')return E; }],[/^width|height$/,null,function(E,F){if(F.name in {table:1,td:1,th:1,img:1})return E;}]]:[[/^mso-/],[/-color$/,null,function(E){if(E=='transparent')return false;if(CKEDITOR.env.gecko)return E.replace(/-moz-use-text-color/g,'transparent');}],[/^margin$/,d],['text-indent','0cm'],['page-break-before'],['tab-stops'],['display','none'],C?[/font-?/]:null],D),width:function(E,F){if(F.name in l.$tableContent)return false;},border:function(E,F){if(F.name in l.$tableContent)return false;},'class':p,bgcolor:p,valign:D?p:function(E,F){F.addStyle('vertical-align',E);return false;}},comment:!CKEDITOR.env.ie?function(E,F){var G=E.match(/<img.*?>/),H=E.match(/^\[if !supportLists\]([\s\S]*?)\[endif\]$/);if(H){var I=H[1]||G&&'l.',J=I&&I.match(/>([^\s]+?)([.)]?)</);return t(J,I);}if(CKEDITOR.env.gecko&&G){var K=CKEDITOR.htmlParser.fragment.fromHtml(G[0]).children[0],L=F.previous,M=L&&L.value.match(/<v:imagedata[^>]*o:href=['"](.*?)['"]/),N=M&&M[1];N&&(K.attributes.src=N);return K;}return false;}:p};}};var j=function(){this.dataFilter=new CKEDITOR.htmlParser.filter();};j.prototype={toHtml:function(k){var l=CKEDITOR.htmlParser.fragment.fromHtml(k,false),m=new CKEDITOR.htmlParser.basicWriter();l.writeHtml(m,this.dataFilter);return m.getHtml(true);}};CKEDITOR.cleanWord=function(k,l){if(CKEDITOR.env.gecko)k=k.replace(/(<!--\[if[^<]*?\])-->([\S\s]*?)<!--(\[endif\]-->)/gi,'$1$2$3');var m=new j(),n=m.dataFilter;n.addRules(CKEDITOR.plugins.pastefromword.getRules(l));l.fire('beforeCleanWord',{filter:n});try{k=m.toHtml(k,false);}catch(o){alert(l.lang.pastefromword.error);}k=k.replace(/cke:.*?".*?"/g,'');k=k.replace(/style=""/g,'');k=k.replace(/<span>/g,'');return k;};})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/pastefromword/filter/default.js
default.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a={toolbarFocus:{exec:function(c){var d=c._.elementsPath.idBase,e=CKEDITOR.document.getById(d+'0');if(e)e.focus();}}},b='<span class="cke_empty">&nbsp;</span>';CKEDITOR.plugins.add('elementspath',{requires:['selection'],init:function(c){var d='cke_path_'+c.name,e,f=function(){if(!e)e=CKEDITOR.document.getById(d);return e;},g='cke_elementspath_'+CKEDITOR.tools.getNextNumber()+'_';c._.elementsPath={idBase:g};c.on('themeSpace',function(h){if(h.data.space=='bottom')h.data.html+='<div id="'+d+'" class="cke_path">'+b+'</div>';});c.on('selectionChange',function(h){var i=CKEDITOR.env,j=h.data.selection,k=j.getStartElement(),l=[],m=this._.elementsPath.list=[];while(k){var n=m.push(k)-1,o;if(k.getAttribute('_cke_real_element_type'))o=k.getAttribute('_cke_real_element_type');else o=k.getName();var p='';if(i.opera||i.gecko&&i.mac)p+=' onkeypress="return false;"';if(i.gecko)p+=' onblur="this.style.cssText = this.style.cssText;"';l.unshift('<a id="',g,n,'" href="javascript:void(\'',o,'\')" tabindex="-1" title="',c.lang.elementsPath.eleTitle.replace(/%1/,o),'"'+(CKEDITOR.env.gecko&&CKEDITOR.env.version<10900?' onfocus="event.preventBubble();"':'')+' hidefocus="true" '+" onkeydown=\"return CKEDITOR._.elementsPath.keydown('",this.name,"',",n,', event);"'+p," onclick=\"return CKEDITOR._.elementsPath.click('",this.name,"',",n,');">',o,'</a>');if(o=='body')break;k=k.getParent();}f().setHtml(l.join('')+b);});c.on('contentDomUnload',function(){f().setHtml(b);});c.addCommand('elementsPathFocus',a.toolbarFocus);}});})();CKEDITOR._.elementsPath={click:function(a,b){var c=CKEDITOR.instances[a];c.focus();var d=c._.elementsPath.list[b];c.getSelection().selectElement(d);return false;},keydown:function(a,b,c){var d=CKEDITOR.ui.button._.instances[b],e=CKEDITOR.instances[a],f=e._.elementsPath.idBase,g;c=new CKEDITOR.dom.event(c);switch(c.getKeystroke()){case 37:case 9:g=CKEDITOR.document.getById(f+(b+1));if(!g)g=CKEDITOR.document.getById(f+'0');g.focus();return false;case 39:case CKEDITOR.SHIFT+9:g=CKEDITOR.document.getById(f+(b-1));if(!g)g=CKEDITOR.document.getById(f+(e._.elementsPath.list.length-1));g.focus();return false;case 27:e.focus();return false;case 13:case 32:this.click(a,b);return false;}return true;}};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/elementspath/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('dialogui');(function(){var a=function(h){var k=this;k._||(k._={});k._['default']=k._.initValue=h['default']||'';var i=[k._];for(var j=1;j<arguments.length;j++)i.push(arguments[j]);i.push(true);CKEDITOR.tools.extend.apply(CKEDITOR.tools,i);return k._;},b={build:function(h,i,j){return new CKEDITOR.ui.dialog.textInput(h,i,j);}},c={build:function(h,i,j){return new CKEDITOR.ui.dialog[i.type](h,i,j);}},d={isChanged:function(){return this.getValue()!=this.getInitValue();},reset:function(){this.setValue(this.getInitValue());},setInitValue:function(){this._.initValue=this.getValue();},resetInitValue:function(){this._.initValue=this._['default'];},getInitValue:function(){return this._.initValue;}},e=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(h,i){if(!this._.domOnChangeRegistered){h.on('load',function(){this.getInputElement().on('change',function(){this.fire('change',{value:this.getValue()});},this);},this);this._.domOnChangeRegistered=true;}this.on('change',i);}},true),f=/^on([A-Z]\w+)/,g=function(h){for(var i in h)if(f.test(i)||i=='title'||i=='type')delete h[i];return h;};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(h,i,j,k){if(arguments.length<4)return;var l=a.call(this,i);l.labelId=CKEDITOR.tools.getNextNumber()+'_label';var m=this._.children=[],n=function(){var o=[];if(i.labelLayout!='horizontal')o.push('<div class="cke_dialog_ui_labeled_label" id="',l.labelId,'" >',i.label,'</div>','<div class="cke_dialog_ui_labeled_content">',k(h,i),'</div>');else{var p={type:'hbox',widths:i.widths,padding:0,children:[{type:'html',html:'<span class="cke_dialog_ui_labeled_label" id="'+l.labelId+'">'+CKEDITOR.tools.htmlEncode(i.label)+'</span>'},{type:'html',html:'<span class="cke_dialog_ui_labeled_content">'+k(h,i)+'</span>'}]};CKEDITOR.dialog._.uiElementBuilders.hbox.build(h,p,o);}return o.join('');};CKEDITOR.ui.dialog.uiElement.call(this,h,i,j,'div',null,null,n);},textInput:function(h,i,j){if(arguments.length<3)return;a.call(this,i);var k=this._.inputId=CKEDITOR.tools.getNextNumber()+'_textInput',l={'class':'cke_dialog_ui_input_'+i.type,id:k,type:'text'},m;if(i.validate)this.validate=i.validate;if(i.maxLength)l.maxlength=i.maxLength;if(i.size)l.size=i.size;var n=this,o=false;h.on('load',function(){n.getInputElement().on('keydown',function(q){if(q.data.getKeystroke()==13)o=true;});n.getInputElement().on('keyup',function(q){if(q.data.getKeystroke()==13&&o){h.getButton('ok')&&h.getButton('ok').click(); o=false;}},null,null,1000);});var p=function(){var q=['<div class="cke_dialog_ui_input_',i.type,'"'];if(i.width)q.push('style="width:'+i.width+'" ');q.push('><input ');for(var r in l)q.push(r+'="'+l[r]+'" ');q.push(' /></div>');return q.join('');};CKEDITOR.ui.dialog.labeledElement.call(this,h,i,j,p);},textarea:function(h,i,j){if(arguments.length<3)return;a.call(this,i);var k=this,l=this._.inputId=CKEDITOR.tools.getNextNumber()+'_textarea',m={};if(i.validate)this.validate=i.validate;m.rows=i.rows||5;m.cols=i.cols||20;var n=function(){var o=['<div class="cke_dialog_ui_input_textarea"><textarea class="cke_dialog_ui_input_textarea" id="',l,'" '];for(var p in m)o.push(p+'="'+CKEDITOR.tools.htmlEncode(m[p])+'" ');o.push('>',CKEDITOR.tools.htmlEncode(k._['default']),'</textarea></div>');return o.join('');};CKEDITOR.ui.dialog.labeledElement.call(this,h,i,j,n);},checkbox:function(h,i,j){if(arguments.length<3)return;var k=a.call(this,i,{'default':!!i['default']});if(i.validate)this.validate=i.validate;var l=function(){var m=CKEDITOR.tools.extend({},i,{id:i.id?i.id+'_checkbox':CKEDITOR.tools.getNextNumber()+'_checkbox'},true),n=[],o={'class':'cke_dialog_ui_checkbox_input',type:'checkbox'};g(m);if(i['default'])o.checked='checked';k.checkbox=new CKEDITOR.ui.dialog.uiElement(h,m,n,'input',null,o);n.push(' <label for="',o.id,'">',CKEDITOR.tools.htmlEncode(i.label),'</label>');return n.join('');};CKEDITOR.ui.dialog.uiElement.call(this,h,i,j,'span',null,null,l);},radio:function(h,i,j){if(arguments.length<3)return;a.call(this,i);if(!this._['default'])this._['default']=this._.initValue=i.items[0][1];if(i.validate)this.validate=i.valdiate;var k=[],l=this,m=function(){var n=[],o=[],p={'class':'cke_dialog_ui_radio_item'},q=i.id?i.id+'_radio':CKEDITOR.tools.getNextNumber()+'_radio';for(var r=0;r<i.items.length;r++){var s=i.items[r],t=s[2]!==undefined?s[2]:s[0],u=s[1]!==undefined?s[1]:s[0],v=CKEDITOR.tools.extend({},i,{id:CKEDITOR.tools.getNextNumber()+'_radio_input',title:null,type:null},true),w=CKEDITOR.tools.extend({},v,{id:null,title:t},true),x={type:'radio','class':'cke_dialog_ui_radio_input',name:q,value:u},y=[];if(l._['default']==u)x.checked='checked';g(v);g(w);k.push(new CKEDITOR.ui.dialog.uiElement(h,v,y,'input',null,x));y.push(' ');new CKEDITOR.ui.dialog.uiElement(h,w,y,'label',null,{'for':x.id},s[0]);n.push(y.join(''));}new CKEDITOR.ui.dialog.hbox(h,[],n,o);return o.join('');};CKEDITOR.ui.dialog.labeledElement.call(this,h,i,j,m);this._.children=k;},button:function(h,i,j){if(!arguments.length)return; if(typeof i=='function')i=i(h.getParentEditor());a.call(this,i,{disabled:i.disabled||false});CKEDITOR.event.implementOn(this);var k=this;h.on('load',function(m){var n=this.getElement();(function(){n.on('click',function(o){k.fire('click',{dialog:k.getDialog()});o.data.preventDefault();});})();n.unselectable();},this);var l=CKEDITOR.tools.extend({},i);delete l.style;CKEDITOR.ui.dialog.uiElement.call(this,h,l,j,'a',null,{style:i.style,href:'javascript:void(0)',title:i.label,hidefocus:'true','class':i['class']},'<span class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(i.label)+'</span>');},select:function(h,i,j){if(arguments.length<3)return;var k=a.call(this,i);if(i.validate)this.validate=i.validate;var l=function(){var m=CKEDITOR.tools.extend({},i,{id:i.id?i.id+'_select':CKEDITOR.tools.getNextNumber()+'_select'},true),n=[],o=[],p={'class':'cke_dialog_ui_input_select'};if(i.size!=undefined)p.size=i.size;if(i.multiple!=undefined)p.multiple=i.multiple;g(m);for(var q=0,r;q<i.items.length&&(r=i.items[q]);q++)o.push('<option value="',CKEDITOR.tools.htmlEncode(r[1]!==undefined?r[1]:r[0]),'" /> ',CKEDITOR.tools.htmlEncode(r[0]));k.select=new CKEDITOR.ui.dialog.uiElement(h,m,n,'select',null,p,o.join(''));return n.join('');};CKEDITOR.ui.dialog.labeledElement.call(this,h,i,j,l);},file:function(h,i,j){if(arguments.length<3)return;if(i['default']===undefined)i['default']='';var k=CKEDITOR.tools.extend(a.call(this,i),{definition:i,buttons:[]});if(i.validate)this.validate=i.validate;var l=function(){k.frameId=CKEDITOR.tools.getNextNumber()+'_fileInput';var m=CKEDITOR.env.isCustomDomain(),n=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',k.frameId,'" title="',i.label,'" src="javascript:void('];n.push(m?"(function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})()':'0');n.push(')"></iframe>');return n.join('');};h.on('load',function(){var m=CKEDITOR.document.getById(k.frameId),n=m.getParent();n.addClass('cke_dialog_ui_input_file');});CKEDITOR.ui.dialog.labeledElement.call(this,h,i,j,l);},fileButton:function(h,i,j){if(arguments.length<3)return;var k=a.call(this,i),l=this;if(i.validate)this.validate=i.validate;var m=CKEDITOR.tools.extend({},i),n=m.onClick;m.className=(m.className?m.className+' ':'')+('cke_dialog_ui_button');m.onClick=function(o){var p=i['for'];if(!n||n.call(this,o)!==false){h.getContentElement(p[0],p[1]).submit();this.disable();}};h.on('load',function(){h.getContentElement(i['for'][0],i['for'][1])._.buttons.push(l); });CKEDITOR.ui.dialog.button.call(this,h,m,j);},html:(function(){var h=/^\s*<[\w:]+\s+([^>]*)?>/,i=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,j=/\/$/;return function(k,l,m){if(arguments.length<3)return;var n=[],o,p=l.html,q,r;if(p.charAt(0)!='<')p='<span>'+p+'</span>';if(l.focus){var s=this.focus;this.focus=function(){s.call(this);l.focus.call(this);this.fire('focus');};if(l.isFocusable){var t=this.isFocusable;this.isFocusable=t;}this.keyboardFocusable=true;}CKEDITOR.ui.dialog.uiElement.call(this,k,l,n,'span',null,null,'');o=n.join('');q=o.match(h);r=p.match(i)||['','',''];if(j.test(r[1])){r[1]=r[1].slice(0,-1);r[2]='/'+r[2];}m.push([r[1],' ',q[1]||'',r[2]].join(''));};})()},true);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement();CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{setLabel:function(h){var i=CKEDITOR.document.getById(this._.labelId);if(i.getChildCount()<1)new CKEDITOR.dom.text(h,CKEDITOR.document).appendTo(i);else i.getChild(0).$.nodeValue=h;return this;},getLabel:function(){var h=CKEDITOR.document.getById(this._.labelId);if(!h||h.getChildCount()<1)return '';else return h.getChild(0).getText();},eventProcessors:e},true);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{click:function(){var h=this;if(!h._.disabled)return h.fire('click',{dialog:h._.dialog});h.getElement().$.blur();return false;},enable:function(){this._.disabled=false;var h=this.getElement();h&&h.removeClass('disabled');},disable:function(){this._.disabled=true;this.getElement().addClass('disabled');},isVisible:function(){return!!this.getElement().$.firstChild.offsetHeight;},isEnabled:function(){return!this._.disabled;},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(h,i){this.on('click',i);}},true),accessKeyUp:function(){this.click();},accessKeyDown:function(){this.focus();},keyboardFocusable:true},true);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(),{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId);},focus:function(){var h=this.selectParentTab();setTimeout(function(){var i=h.getInputElement();i&&i.$.focus();},0);},select:function(){var h=this.selectParentTab();setTimeout(function(){var i=h.getInputElement();if(i){i.$.focus();i.$.select();}},0);},accessKeyUp:function(){this.select();},setValue:function(h){h=h||'';return CKEDITOR.ui.dialog.uiElement.prototype.setValue.call(this,h); },keyboardFocusable:true},d,true);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput();CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(),{getInputElement:function(){return this._.select.getElement();},add:function(h,i,j){var k=new CKEDITOR.dom.element('option',this.getDialog().getParentEditor().document),l=this.getInputElement().$;k.$.text=h;k.$.value=i===undefined||i===null?h:i;if(j===undefined||j===null){if(CKEDITOR.env.ie)l.add(k.$);else l.add(k.$,null);}else l.add(k.$,j);return this;},remove:function(h){var i=this.getInputElement().$;i.remove(h);return this;},clear:function(){var h=this.getInputElement().$;while(h.length>0)h.remove(0);return this;},keyboardFocusable:true},d,true);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement();},setValue:function(h){this.getInputElement().$.checked=h;this.fire('change',{value:h});},getValue:function(){return this.getInputElement().$.checked;},accessKeyUp:function(){this.setValue(!this.getValue());},eventProcessors:{onChange:function(h,i){if(!CKEDITOR.env.ie)return e.onChange.apply(this,arguments);else{h.on('load',function(){var j=this._.checkbox.getElement();j.on('propertychange',function(k){k=k.data.$;if(k.propertyName=='checked')this.fire('change',{value:j.$.checked});},this);},this);this.on('change',i);}return null;}},keyboardFocusable:true},d,true);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{setValue:function(h){var i=this._.children,j;for(var k=0;k<i.length&&(j=i[k]);k++)j.getElement().$.checked=j.getValue()==h;this.fire('change',{value:h});},getValue:function(){var h=this._.children;for(var i=0;i<h.length;i++)if(h[i].getElement().$.checked)return h[i].getValue();return null;},accessKeyUp:function(){var h=this._.children,i;for(i=0;i<h.length;i++)if(h[i].getElement().$.checked){h[i].getElement().focus();return;}h[0].getElement().focus();},eventProcessors:{onChange:function(h,i){if(!CKEDITOR.env.ie)return e.onChange.apply(this,arguments);else{h.on('load',function(){var j=this._.children,k=this;for(var l=0;l<j.length;l++){var m=j[l].getElement();m.on('propertychange',function(n){n=n.data.$;if(n.propertyName=='checked'&&this.$.checked)k.fire('change',{value:this.getAttribute('value')});});}},this);this.on('change',i);}return null;}},keyboardFocusable:true},d,true);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(),d,{getInputElement:function(){var h=CKEDITOR.document.getById(this._.frameId).getFrameDocument(); return h.$.forms.length>0?new CKEDITOR.dom.element(h.$.forms[0].elements[0]):this.getElement();},submit:function(){this.getInputElement().getParent().$.submit();return this;},getAction:function(h){return this.getInputElement().getParent().$.action;},reset:function(){var h=CKEDITOR.document.getById(this._.frameId),i=h.getFrameDocument(),j=this._.definition,k=this._.buttons;function l(){i.$.open();if(CKEDITOR.env.isCustomDomain())i.$.domain=document.domain;var m='';if(j.size)m=j.size-(CKEDITOR.env.ie?7:0);i.$.write(['<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" action="',CKEDITOR.tools.htmlEncode(j.action),'">','<input type="file" name="',CKEDITOR.tools.htmlEncode(j.id||'cke_upload'),'" size="',CKEDITOR.tools.htmlEncode(m>0?m:''),'" />','</form>','</body></html>'].join(''));i.$.close();for(var n=0;n<k.length;n++)k[n].enable();};if(CKEDITOR.env.gecko)setTimeout(l,500);else l();},getValue:function(){return '';},eventProcessors:e,keyboardFocusable:true},true);CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button();CKEDITOR.dialog.addUIElement('text',b);CKEDITOR.dialog.addUIElement('password',b);CKEDITOR.dialog.addUIElement('textarea',c);CKEDITOR.dialog.addUIElement('checkbox',c);CKEDITOR.dialog.addUIElement('radio',c);CKEDITOR.dialog.addUIElement('button',c);CKEDITOR.dialog.addUIElement('select',c);CKEDITOR.dialog.addUIElement('file',c);CKEDITOR.dialog.addUIElement('fileButton',c);CKEDITOR.dialog.addUIElement('html',c);})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/dialogui/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,b='{cke_protected}';function c(B){var C=B.children.length,D=B.children[C-1];while(D&&D.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(D.value))D=B.children[--C];return D;};function d(B,C){var D=B.children,E=c(B);if(E){if((C||!CKEDITOR.env.ie)&&(E.type==CKEDITOR.NODE_ELEMENT&&E.name=='br'))D.pop();if(E.type==CKEDITOR.NODE_TEXT&&a.test(E.value))D.pop();}};function e(B){var C=c(B);return!C||C.type==CKEDITOR.NODE_ELEMENT&&C.name=='br';};function f(B){d(B,true);if(e(B))if(CKEDITOR.env.ie)B.add(new CKEDITOR.htmlParser.text('\xa0'));else B.add(new CKEDITOR.htmlParser.element('br',{}));};function g(B){d(B);if(e(B))B.add(new CKEDITOR.htmlParser.text('\xa0'));};var h=CKEDITOR.dtd,i=CKEDITOR.tools.extend({},h.$block,h.$listItem,h.$tableContent);for(var j in i)if(!('br' in h[j]))delete i[j];delete i.pre;var k={attributeNames:[[/^on/,'_cke_pa_on']]},l={elements:{}};for(j in i)l.elements[j]=f;var m={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^_cke_(saved|pa)_/,''],[/^_cke.*/,'']],elements:{$:function(B){var C=B.attributes;if(C){var D=['name','href','src'],E;for(var F=0;F<D.length;F++){E='_cke_saved_'+D[F];E in C&&delete C[D[F]];}}},embed:function(B){var C=B.parent;if(C&&C.name=='object'){var D=C.attributes.width,E=C.attributes.height;D&&(B.attributes.width=D);E&&(B.attributes.height=E);}},param:function(B){B.children=[];B.isEmpty=true;return B;},a:function(B){if(!(B.children.length||B.attributes.name||B.attributes._cke_saved_name))return false;}},attributes:{'class':function(B,C){return CKEDITOR.tools.ltrim(B.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}},comment:function(B){if(B.substr(0,b.length)==b)return new CKEDITOR.htmlParser.cdata(decodeURIComponent(B.substr(b.length)));return B;}},n={elements:{}};for(j in i)n.elements[j]=g;if(CKEDITOR.env.ie)m.attributes.style=function(B,C){return B.toLowerCase();};var o=/<(?:a|area|img|input).*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;function p(B){return B.replace(o,'$& _cke_saved_$1');};var q=/<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi,r=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,s=/(<\/?)((?:object|embed|param).*?>)/gi,t=/<cke:param(.*?)\/>/gi;function u(B){return '<cke:encoded>'+encodeURIComponent(B)+'</cke:encoded>';};function v(B){return B.replace(q,u);};function w(B){return B.replace(s,'$1cke:$2');};function x(B){return B.replace(t,'<cke:param$1></cke:param>');};function y(B,C){return decodeURIComponent(C);};function z(B){return B.replace(r,y); };function A(B,C){var D=[],E=/<\!--\{cke_temp\}(\d*?)-->/g,F=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(C);for(var G=0;G<F.length;G++)B=B.replace(F[G],function(H){H=H.replace(E,function(I,J){return D[J];});return '<!--{cke_temp}'+(D.push(H)-1)+'-->';});B=B.replace(E,function(H,I){return '<!--'+b+encodeURIComponent(D[I]).replace(/--/g,'%2D%2D')+'-->';});return B;};CKEDITOR.plugins.add('htmldataprocessor',{requires:['htmlwriter'],init:function(B){var C=B.dataProcessor=new CKEDITOR.htmlDataProcessor(B);C.writer.forceSimpleAmpersand=B.config.forceSimpleAmpersand;C.dataFilter.addRules(k);C.dataFilter.addRules(l);C.htmlFilter.addRules(m);C.htmlFilter.addRules(n);}});CKEDITOR.htmlDataProcessor=function(B){var C=this;C.editor=B;C.writer=new CKEDITOR.htmlWriter();C.dataFilter=new CKEDITOR.htmlParser.filter();C.htmlFilter=new CKEDITOR.htmlParser.filter();};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(B,C){B=A(B,this.editor.config.protectedSource);B=p(B);if(CKEDITOR.env.ie)B=v(B);B=w(B);B=x(B);var D=document.createElement('div');D.innerHTML='a'+B;B=D.innerHTML.substr(1);if(CKEDITOR.env.ie)B=z(B);var E=CKEDITOR.htmlParser.fragment.fromHtml(B,C),F=new CKEDITOR.htmlParser.basicWriter();E.writeHtml(F,this.dataFilter);return F.getHtml(true);},toDataFormat:function(B,C){var D=this.writer,E=CKEDITOR.htmlParser.fragment.fromHtml(B,C);D.reset();E.writeHtml(D,this.htmlFilter);return D.getHtml(true);}};})();CKEDITOR.config.forceSimpleAmpersand=false;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/htmldataprocessor/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('menu',{beforeInit:function(a){var b=a.config.menu_groups.split(','),c={};for(var d=0;d<b.length;d++)c[b[d]]=d+1;a._.menuGroups=c;a._.menuItems={};},requires:['floatpanel']});CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addMenuGroup:function(a,b){this._.menuGroups[a]=b||100;},addMenuItem:function(a,b){if(this._.menuGroups[b.group])this._.menuItems[a]=new CKEDITOR.menuItem(this,a,b);},addMenuItems:function(a){for(var b in a)this.addMenuItem(b,a[b]);},getMenuItem:function(a){return this._.menuItems[a];}});(function(){CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(b,c){var d=this;d.id='cke_'+CKEDITOR.tools.getNextNumber();d.editor=b;d.items=[];d._.level=c||1;},_:{showSubMenu:function(b){var h=this;var c=h._.subMenu,d=h.items[b],e=d.getItems&&d.getItems();if(!e){h._.panel.hideChild();return;}if(c)c.removeAll();else{c=h._.subMenu=new CKEDITOR.menu(h.editor,h._.level+1);c.parent=h;c.onClick=CKEDITOR.tools.bind(h.onClick,h);}for(var f in e)c.add(h.editor.getMenuItem(f));var g=h._.panel.getBlock(h.id).element.getDocument().getById(h.id+String(b));c.show(g,2);}},proto:{add:function(b){if(!b.order)b.order=this.items.length;this.items.push(b);},removeAll:function(){this.items=[];},show:function(b,c,d,e){var f=this.items,g=this.editor,h=this._.panel,i=this._.element;if(!h){h=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),{css:[CKEDITOR.getUrl(g.skinPath+'editor.css')],level:this._.level-1,className:g.skinClass+' cke_contextmenu'},this._.level);h.onEscape=CKEDITOR.tools.bind(function(){this.onEscape&&this.onEscape();this.hide();},this);h.onHide=CKEDITOR.tools.bind(function(){this.onHide&&this.onHide();},this);var j=h.addBlock(this.id);j.autoSize=true;var k=j.keys;k[40]='next';k[9]='next';k[38]='prev';k[CKEDITOR.SHIFT+9]='prev';k[32]='click';k[39]='click';i=this._.element=j.element;i.addClass(g.skinClass);var l=i.getDocument();l.getBody().setStyle('overflow','hidden');l.getElementsByTag('html').getItem(0).setStyle('overflow','hidden');this._.itemOverFn=CKEDITOR.tools.addFunction(function(r){var s=this;clearTimeout(s._.showSubTimeout);s._.showSubTimeout=CKEDITOR.tools.setTimeout(s._.showSubMenu,g.config.menu_subMenuDelay,s,[r]);},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(r){clearTimeout(this._.showSubTimeout);},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(r){var t=this;var s=t.items[r];if(s.state==CKEDITOR.TRISTATE_DISABLED){t.hide();return;}if(s.getItems)t._.showSubMenu(r);else t.onClick&&t.onClick(s); },this);}a(f);var m=['<div class="cke_menu">'],n=f.length,o=n&&f[0].group;for(var p=0;p<n;p++){var q=f[p];if(o!=q.group){m.push('<div class="cke_menuseparator"></div>');o=q.group;}q.render(this,p,m);}m.push('</div>');i.setHtml(m.join(''));if(this.parent)this.parent._.panel.showAsChild(h,this.id,b,c,d,e);else h.showBlock(this.id,b,c,d,e);g.fire('menuShow',[h]);},hide:function(){this._.panel&&this._.panel.hide();}}});function a(b){b.sort(function(c,d){if(c.group<d.group)return-1;else if(c.group>d.group)return 1;return c.order<d.order?-1:c.order>d.order?1:0;});};})();CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,b,c){var d=this;CKEDITOR.tools.extend(d,c,{order:0,className:'cke_button_'+b});d.group=a._.menuGroups[d.group];d.editor=a;d.name=b;},proto:{render:function(a,b,c){var i=this;var d=a.id+String(b),e=typeof i.state=='undefined'?CKEDITOR.TRISTATE_OFF:i.state,f=' cke_'+(e==CKEDITOR.TRISTATE_ON?'on':e==CKEDITOR.TRISTATE_DISABLED?'disabled':'off'),g=i.label;if(e==CKEDITOR.TRISTATE_DISABLED)g=i.editor.lang.common.unavailable.replace('%1',g);if(i.className)f+=' '+i.className;c.push('<span class="cke_menuitem"><a id="',d,'" class="',f,'" href="javascript:void(\'',(i.label||'').replace("'",''),'\')" title="',i.label,'" tabindex="-1"_cke_focus=1 hidefocus="true"');if(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)c.push(' onkeypress="return false;"');if(CKEDITOR.env.gecko)c.push(' onblur="this.style.cssText = this.style.cssText;"');var h=(i.iconOffset||0)*(-16);c.push(' onmouseover="CKEDITOR.tools.callFunction(',a._.itemOverFn,',',b,');" onmouseout="CKEDITOR.tools.callFunction(',a._.itemOutFn,',',b,');" onclick="CKEDITOR.tools.callFunction(',a._.itemClickFn,',',b,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(i.icon?' style="background-image:url('+CKEDITOR.getUrl(i.icon)+');background-position:0 '+h+'px;"':'')+'></span></span>'+'<span class="cke_label">');if(i.getItems)c.push('<span class="cke_menuarrow"></span>');c.push(g,'</span></a></span>');}}});CKEDITOR.config.menu_subMenuDelay=400;CKEDITOR.config.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea';
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/menu/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('dialog',{requires:['dialogui']});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;(function(){function a(A){return!!this._.tabs[A][0].$.offsetHeight;};function b(){var E=this;var A=E._.currentTabId,B=E._.tabIdList.length,C=CKEDITOR.tools.indexOf(E._.tabIdList,A)+B;for(var D=C-1;D>C-B;D--)if(a.call(E,E._.tabIdList[D%B]))return E._.tabIdList[D%B];return null;};function c(){var E=this;var A=E._.currentTabId,B=E._.tabIdList.length,C=CKEDITOR.tools.indexOf(E._.tabIdList,A);for(var D=C+1;D<C+B;D++)if(a.call(E,E._.tabIdList[D%B]))return E._.tabIdList[D%B];return null;};var d={};CKEDITOR.dialog=function(A,B){var C=CKEDITOR.dialog._.dialogDefinitions[B];if(!C){console.log('Error: The dialog "'+B+'" is not defined.');return;}C=CKEDITOR.tools.extend(C(A),f);C=CKEDITOR.tools.clone(C);C=new j(this,C);this.definition=C=CKEDITOR.fire('dialogDefinition',{name:B,definition:C},A).definition;var D=CKEDITOR.document,E=A.theme.buildDialog(A);this._={editor:A,element:E.element,name:B,contentSize:{width:0,height:0},size:{width:0,height:0},updateSize:false,contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=E.parts;this.parts.dialog.setStyles({position:CKEDITOR.env.ie6Compat?'absolute':'fixed',top:0,left:0,visibility:'hidden'});CKEDITOR.event.call(this);if(C.onLoad)this.on('load',C.onLoad);if(C.onShow)this.on('show',C.onShow);if(C.onHide)this.on('hide',C.onHide);if(C.onOk)this.on('ok',function(O){if(C.onOk.call(this,O)===false)O.data.hide=false;});if(C.onCancel)this.on('cancel',function(O){if(C.onCancel.call(this,O)===false)O.data.hide=false;});var F=this,G=function(O){var P=F._.contents,Q=false;for(var R in P)for(var S in P[R]){Q=O.call(this,P[R][S]);if(Q)return;}};this.on('ok',function(O){G(function(P){if(P.validate){var Q=P.validate(this);if(typeof Q=='string'){alert(Q);Q=false;}if(Q===false){if(P.select)P.select();else P.focus();O.data.hide=false;O.stop();return true;}}});},this,null,0);this.on('cancel',function(O){G(function(P){if(P.isChanged()){if(!confirm(A.lang.common.confirmCancel))O.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(O){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();},this);function H(O){var P=F._.focusList,Q=O?1:-1;if(P.length<1)return;var R=(F._.currentFocusIndex+Q+P.length)%(P.length); while(!P[R].isFocusable()){R=(R+Q+P.length)%(P.length);if(R==F._.currentFocusIndex)break;}P[R].focus();if(P[R].type=='text')P[R].select();};function I(O){if(F!=CKEDITOR.dialog._.currentTop)return;var P=O.data.getKeystroke(),Q=false;if(P==9||P==CKEDITOR.SHIFT+9){var R=P==CKEDITOR.SHIFT+9;if(F._.tabBarMode){var S=R?b.call(F):c.call(F);F.selectPage(S);F._.tabs[S][0].focus();}else H(!R);Q=true;}else if(P==CKEDITOR.ALT+121&&!F._.tabBarMode){F._.tabBarMode=true;F._.tabs[F._.currentTabId][0].focus();Q=true;}else if((P==37||P==39)&&(F._.tabBarMode)){S=P==37?b.call(F):c.call(F);F.selectPage(S);F._.tabs[S][0].focus();Q=true;}if(Q){O.stop();O.data.preventDefault();}};this.on('show',function(){CKEDITOR.document.on('keydown',I,this,null,0);if(CKEDITOR.env.ie6Compat){var O=o.getChild(0).getFrameDocument();O.on('keydown',I,this,null,0);}});this.on('hide',function(){CKEDITOR.document.removeListener('keydown',I);});this.on('iframeAdded',function(O){var P=new CKEDITOR.dom.document(O.data.iframe.$.contentWindow.document);P.on('keydown',I,this,null,0);});this.on('show',function(){var R=this;if(!R._.hasFocus){R._.currentFocusIndex=-1;H(true);if(R._.editor.mode=='wysiwyg'&&CKEDITOR.env.ie){var O=A.document.$.selection,P=O.createRange();if(P)if(P.parentElement&&P.parentElement().ownerDocument==A.document.$||P.item&&P.item(0).ownerDocument==A.document.$){var Q=document.body.createTextRange();Q.moveToElementText(R.getElement().getFirst().$);Q.collapse(true);Q.select();}}}},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on('load',function(O){var P=this.getElement(),Q=P.getFirst();Q.remove();Q.appendTo(P);},this);l(this);m(this);new CKEDITOR.dom.text(C.title,CKEDITOR.document).appendTo(this.parts.title);for(var J=0;J<C.contents.length;J++)this.addPage(C.contents[J]);var K=/cke_dialog_tab(\s|$|_)/,L=/cke_dialog_tab(\s|$)/;this.parts.tabs.on('click',function(O){var T=this;var P=O.data.getTarget(),Q=P,R,S;if(!(K.test(P.$.className)||P.getName()=='a'))return;R=P.$.id.substr(0,P.$.id.lastIndexOf('_'));T.selectPage(R);if(T._.tabBarMode){T._.tabBarMode=false;T._.currentFocusIndex=-1;H(true);}O.data.preventDefault();},this);var M=[],N=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:'hbox',className:'cke_dialog_footer_buttons',widths:[],children:C.buttons},M).getChild();this.parts.footer.setHtml(M.join(''));for(J=0;J<N.length;J++)this._.buttons[N[J].id]=N[J];CKEDITOR.skins.load(A,'dialog');};function e(A,B,C){this.element=B;this.focusIndex=C;this.isFocusable=function(){return true; };this.focus=function(){A._.currentFocusIndex=this.focusIndex;this.element.focus();};B.on('keydown',function(D){if(D.data.getKeystroke() in {32:1,13:1})this.fire('click');});B.on('focus',function(){this.fire('mouseover');});B.on('blur',function(){this.fire('mouseout');});};CKEDITOR.dialog.prototype={resize:(function(){return function(A,B){var C=this;if(C._.contentSize&&C._.contentSize.width==A&&C._.contentSize.height==B)return;CKEDITOR.dialog.fire('resize',{dialog:C,skin:C._.editor.skinName,width:A,height:B},C._.editor);C._.contentSize={width:A,height:B};C._.updateSize=true;};})(),getSize:function(){var C=this;if(!C._.updateSize)return C._.size;var A=C._.element.getFirst(),B=C._.size={width:A.$.offsetWidth||0,height:A.$.offsetHeight||0};C._.updateSize=!B.width||!B.height;return B;},move:(function(){var A;return function(B,C){var F=this;var D=F._.element.getFirst();if(A===undefined)A=D.getComputedStyle('position')=='fixed';if(A&&F._.position&&F._.position.x==B&&F._.position.y==C)return;F._.position={x:B,y:C};if(!A){var E=CKEDITOR.document.getWindow().getScrollPosition();B+=E.x;C+=E.y;}D.setStyles({left:(B>0?B:0)+('px'),top:(C>0?C:0)+('px')});};})(),getPosition:function(){return CKEDITOR.tools.extend({},this._.position);},show:function(){if(this._.editor.mode=='wysiwyg'&&CKEDITOR.env.ie)this._.editor.getSelection().lock();var A=this._.element,B=this.definition;if(!(A.getParent()&&A.getParent().equals(CKEDITOR.document.getBody())))A.appendTo(CKEDITOR.document.getBody());else return;if(CKEDITOR.env.gecko&&CKEDITOR.env.version<10900){var C=this.parts.dialog;C.setStyle('position','absolute');setTimeout(function(){C.setStyle('position','fixed');},0);}this.resize(B.minWidth,B.minHeight);this.selectPage(this.definition.contents[0].id);this.reset();if(CKEDITOR.dialog._.currentZIndex===null)CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',CKEDITOR.dialog._.currentZIndex+=10);if(CKEDITOR.dialog._.currentTop===null){CKEDITOR.dialog._.currentTop=this;this._.parentDialog=null;p(this._.editor);CKEDITOR.document.on('keydown',s);CKEDITOR.document.on('keyup',t);for(var D in {keyup:1,keydown:1,keypress:1})CKEDITOR.document.on(D,z);}else{this._.parentDialog=CKEDITOR.dialog._.currentTop;var E=this._.parentDialog.getElement().getFirst();E.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);CKEDITOR.dialog._.currentTop=this;}u(this,this,'\x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click(); });this._.hasFocus=false;CKEDITOR.tools.setTimeout(function(){var F=CKEDITOR.document.getWindow().getViewPaneSize(),G=this.getSize();this.move((F.width-B.minWidth)/(2),(F.height-G.height)/(2));this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this.foreach(function(H){H.setInitValue&&H.setInitValue();});},100,this);},foreach:function(A){var D=this;for(var B in D._.contents)for(var C in D._.contents[B])A(D._.contents[B][C]);return D;},reset:(function(){var A=function(B){if(B.reset)B.reset();};return function(){this.foreach(A);return this;};})(),setupContent:function(){var A=arguments;this.foreach(function(B){if(B.setup)B.setup.apply(B,A);});},commitContent:function(){var A=arguments;this.foreach(function(B){if(B.commit)B.commit.apply(B,A);});},hide:function(){this.fire('hide',{});var A=this._.element;if(!A.getParent())return;A.remove();this.parts.dialog.setStyle('visibility','hidden');v(this);if(!this._.parentDialog)q();else{var B=this._.parentDialog.getElement().getFirst();B.setStyle('z-index',parseInt(B.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}CKEDITOR.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){CKEDITOR.dialog._.currentZIndex=null;CKEDITOR.document.removeListener('keydown',s);CKEDITOR.document.removeListener('keyup',t);CKEDITOR.document.removeListener('keypress',t);for(var C in {keyup:1,keydown:1,keypress:1})CKEDITOR.document.removeListener(C,z);var D=this._.editor;D.focus();if(D.mode=='wysiwyg'&&CKEDITOR.env.ie)D.getSelection().unlock(true);}else CKEDITOR.dialog._.currentZIndex-=10;this.foreach(function(E){E.resetInitValue&&E.resetInitValue();});},addPage:function(A){var K=this;var B=[],C=A.label?' title="'+CKEDITOR.tools.htmlEncode(A.label)+'"':'',D=A.elements,E=CKEDITOR.dialog._.uiElementBuilders.vbox.build(K,{type:'vbox',className:'cke_dialog_page_contents',children:A.elements,expand:!!A.expand,padding:A.padding,style:A.style||'width: 100%; height: 100%;'},B),F=CKEDITOR.dom.element.createFromHtml(B.join('')),G=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',K._.pageCount>0?' cke_last':'cke_first',C,!!A.hidden?' style="display:none"':'',' id="',A.id+'_',CKEDITOR.tools.getNextNumber(),'" href="javascript:void(0)"',' hidefocus="true">',A.label,'</a>'].join(''));if(K._.pageCount===0)K.parts.dialog.addClass('cke_single_page');else K.parts.dialog.removeClass('cke_single_page');K._.tabs[A.id]=[G,F];K._.tabIdList.push(A.id);K._.pageCount++;K._.lastTab=G; var H=K._.contents[A.id]={},I,J=E.getChild();while(I=J.shift()){H[I.id]=I;if(typeof I.getChild=='function')J.push.apply(J,I.getChild());}F.setAttribute('name',A.id);F.appendTo(K.parts.contents);G.unselectable();K.parts.tabs.append(G);if(A.accessKey){u(K,K,'CTRL+'+A.accessKey,x,w);K._.accessKeyMap['CTRL+'+A.accessKey]=A.id;}},selectPage:function(A){var F=this;for(var B in F._.tabs){var C=F._.tabs[B][0],D=F._.tabs[B][1];if(B!=A){C.removeClass('cke_dialog_tab_selected');D.hide();}}var E=F._.tabs[A];E[0].addClass('cke_dialog_tab_selected');E[1].show();F._.currentTabId=A;F._.currentTabIndex=CKEDITOR.tools.indexOf(F._.tabIdList,A);},hidePage:function(A){var B=this._.tabs[A]&&this._.tabs[A][0];if(!B)return;B.hide();},showPage:function(A){var B=this._.tabs[A]&&this._.tabs[A][0];if(!B)return;B.show();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(A,B){return this._.contents[A][B];},getValueOf:function(A,B){return this.getContentElement(A,B).getValue();},setValueOf:function(A,B,C){return this.getContentElement(A,B).setValue(C);},getButton:function(A){return this._.buttons[A];},click:function(A){return this._.buttons[A].click();},disableButton:function(A){return this._.buttons[A].disable();},enableButton:function(A){return this._.buttons[A].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(A,B){var D=this;if(typeof B=='undefined'){B=D._.focusList.length;D._.focusList.push(new e(D,A,B));}else{D._.focusList.splice(B,0,new e(D,A,B));for(var C=B+1;C<D._.focusList.length;C++)D._.focusList[C].focusIndex++;}}};CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(A,B){if(!this._.dialogDefinitions[A]||typeof B=='function')this._.dialogDefinitions[A]=B;},exists:function(A){return!!this._.dialogDefinitions[A];},getCurrent:function(){return CKEDITOR.dialog._.currentTop;},okButton:(function(){var A=function(B,C){C=C||{};return CKEDITOR.tools.extend({id:'ok',type:'button',label:B.lang.common.ok,'class':'cke_dialog_ui_button_ok',onClick:function(D){var E=D.data.dialog;if(E.fire('ok',{hide:true}).hide!==false)E.hide();}},C,true);};A.type='button';A.override=function(B){return CKEDITOR.tools.extend(function(C){return A(C,B);},{type:'button'},true);};return A;})(),cancelButton:(function(){var A=function(B,C){C=C||{};return CKEDITOR.tools.extend({id:'cancel',type:'button',label:B.lang.common.cancel,'class':'cke_dialog_ui_button_cancel',onClick:function(D){var E=D.data.dialog; if(E.fire('cancel',{hide:true}).hide!==false)E.hide();}},C,true);};A.type='button';A.override=function(B){return CKEDITOR.tools.extend(function(C){return A(C,B);},{type:'button'},true);};return A;})(),addUIElement:function(A,B){this._.uiElementBuilders[A]=B;}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype,true);var f={resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},g=function(A,B,C){for(var D=0,E;E=A[D];D++){if(E.id==B)return E;if(C&&E[C]){var F=g(E[C],B,C);if(F)return F;}}return null;},h=function(A,B,C,D,E){if(C){for(var F=0,G;G=A[F];F++){if(G.id==C){A.splice(F,0,B);return B;}if(D&&G[D]){var H=h(G[D],B,C,D,true);if(H)return H;}}if(E)return null;}A.push(B);return B;},i=function(A,B,C){for(var D=0,E;E=A[D];D++){if(E.id==B)return A.splice(D,1);if(C&&E[C]){var F=i(E[C],B,C);if(F)return F;}}return null;},j=function(A,B){this.dialog=A;var C=B.contents;for(var D=0,E;E=C[D];D++)C[D]=new k(A,E);CKEDITOR.tools.extend(this,B);};j.prototype={getContents:function(A){return g(this.contents,A);},getButton:function(A){return g(this.buttons,A);},addContents:function(A,B){return h(this.contents,A,B);},addButton:function(A,B){return h(this.buttons,A,B);},removeContents:function(A){i(this.contents,A);},removeButton:function(A){i(this.buttons,A);}};function k(A,B){this._={dialog:A};CKEDITOR.tools.extend(this,B);};k.prototype={get:function(A){return g(this.elements,A,'children');},add:function(A,B){return h(this.elements,A,B,'children');},remove:function(A){i(this.elements,A,'children');}};function l(A){var B=null,C=null,D=A.getElement().getFirst(),E=A.getParentEditor(),F=E.config.dialog_magnetDistance,G=d[E.skinName].margins||[0,0,0,0];if(typeof F=='undefined')F=20;function H(J){var K=A.getSize(),L=CKEDITOR.document.getWindow().getViewPaneSize(),M=J.data.$.screenX,N=J.data.$.screenY,O=M-B.x,P=N-B.y,Q,R;B={x:M,y:N};C.x+=O;C.y+=P;if(C.x+G[3]<F)Q=-G[3];else if(C.x-G[1]>L.width-K.width-F)Q=L.width-K.width+G[1];else Q=C.x;if(C.y+G[0]<F)R=-G[0];else if(C.y-G[2]>L.height-K.height-F)R=L.height-K.height+G[2];else R=C.y;A.move(Q,R);J.data.preventDefault();};function I(J){CKEDITOR.document.removeListener('mousemove',H);CKEDITOR.document.removeListener('mouseup',I);if(CKEDITOR.env.ie6Compat){var K=o.getChild(0).getFrameDocument();K.removeListener('mousemove',H); K.removeListener('mouseup',I);}};A.parts.title.on('mousedown',function(J){A._.updateSize=true;B={x:J.data.$.screenX,y:J.data.$.screenY};CKEDITOR.document.on('mousemove',H);CKEDITOR.document.on('mouseup',I);C=A.getPosition();if(CKEDITOR.env.ie6Compat){var K=o.getChild(0).getFrameDocument();K.on('mousemove',H);K.on('mouseup',I);}J.data.preventDefault();},A);};function m(A){var B=A.definition,C=B.minWidth||0,D=B.minHeight||0,E=B.resizable,F=d[A.getParentEditor().skinName].margins||[0,0,0,0];function G(R,S){R.y+=S;};function H(R,S){R.x2+=S;};function I(R,S){R.y2+=S;};function J(R,S){R.x+=S;};var K=null,L=null,M=A._.editor.config.magnetDistance,N=['tl','t','tr','l','r','bl','b','br'];function O(R){var S=R.listenerData.part,T=A.getSize();L=A.getPosition();CKEDITOR.tools.extend(L,{x2:L.x+T.width,y2:L.y+T.height});K={x:R.data.$.screenX,y:R.data.$.screenY};CKEDITOR.document.on('mousemove',P,A,{part:S});CKEDITOR.document.on('mouseup',Q,A,{part:S});if(CKEDITOR.env.ie6Compat){var U=o.getChild(0).getFrameDocument();U.on('mousemove',P,A,{part:S});U.on('mouseup',Q,A,{part:S});}R.data.preventDefault();};function P(R){var S=R.data.$.screenX,T=R.data.$.screenY,U=S-K.x,V=T-K.y,W=CKEDITOR.document.getWindow().getViewPaneSize(),X=R.listenerData.part;if(X.search('t')!=-1)G(L,V);if(X.search('l')!=-1)J(L,U);if(X.search('b')!=-1)I(L,V);if(X.search('r')!=-1)H(L,U);K={x:S,y:T};var Y,Z,aa,ab;if(L.x+F[3]<M)Y=-F[3];else if(X.search('l')!=-1&&L.x2-L.x<C+M)Y=L.x2-C;else Y=L.x;if(L.y+F[0]<M)Z=-F[0];else if(X.search('t')!=-1&&L.y2-L.y<D+M)Z=L.y2-D;else Z=L.y;if(L.x2-F[1]>W.width-M)aa=W.width+F[1];else if(X.search('r')!=-1&&L.x2-L.x<C+M)aa=L.x+C;else aa=L.x2;if(L.y2-F[2]>W.height-M)ab=W.height+F[2];else if(X.search('b')!=-1&&L.y2-L.y<D+M)ab=L.y+D;else ab=L.y2;A.move(Y,Z);A.resize(aa-Y,ab-Z);R.data.preventDefault();};function Q(R){CKEDITOR.document.removeListener('mouseup',Q);CKEDITOR.document.removeListener('mousemove',P);if(CKEDITOR.env.ie6Compat){var S=o.getChild(0).getFrameDocument();S.removeListener('mouseup',Q);S.removeListener('mousemove',P);}};};var n,o,p=function(A){var B=CKEDITOR.document.getWindow();if(!o){var C=['<div style="position: ',CKEDITOR.env.ie6Compat?'absolute':'fixed','; z-index: ',A.config.baseFloatZIndex,'; top: 0px; left: 0px; ','background-color: ',A.config.dialog_backgroundCoverColor||'white','" id="cke_dialog_background_cover">'];if(CKEDITOR.env.ie6Compat){var D=CKEDITOR.env.isCustomDomain();C.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'); C.push(D?"void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())':"''");C.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>');}C.push('</div>');o=CKEDITOR.dom.element.createFromHtml(C.join(''));}var E=o,F=function(){var J=B.getViewPaneSize();E.setStyles({width:J.width+'px',height:J.height+'px'});},G=function(){var J=B.getScrollPosition(),K=CKEDITOR.dialog._.currentTop;E.setStyles({left:J.x+'px',top:J.y+'px'});do{var L=K.getPosition();K.move(L.x,L.y);}while(K=K._.parentDialog)};n=F;B.on('resize',F);F();if(CKEDITOR.env.ie6Compat){var H=function(){G();arguments.callee.prevScrollHandler.apply(this,arguments);};B.$.setTimeout(function(){H.prevScrollHandler=window.onscroll||(function(){});window.onscroll=H;},0);G();}var I=A.config.dialog_backgroundCoverOpacity;E.setOpacity(typeof I!='undefined'?I:0.5);E.appendTo(CKEDITOR.document.getBody());},q=function(){if(!o)return;var A=CKEDITOR.document.getWindow();o.remove();A.removeListener('resize',n);if(CKEDITOR.env.ie6Compat)A.$.setTimeout(function(){var B=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=B||null;},0);n=null;},r={},s=function(A){var B=A.data.$.ctrlKey||A.data.$.metaKey,C=A.data.$.altKey,D=A.data.$.shiftKey,E=String.fromCharCode(A.data.$.keyCode),F=r[(B?'CTRL+':'')+(C?'ALT+':'')+(D?'SHIFT+':'')+E];if(!F||!F.length)return;F=F[F.length-1];F.keydown&&F.keydown.call(F.uiElement,F.dialog,F.key);A.data.preventDefault();},t=function(A){var B=A.data.$.ctrlKey||A.data.$.metaKey,C=A.data.$.altKey,D=A.data.$.shiftKey,E=String.fromCharCode(A.data.$.keyCode),F=r[(B?'CTRL+':'')+(C?'ALT+':'')+(D?'SHIFT+':'')+E];if(!F||!F.length)return;F=F[F.length-1];F.keyup&&F.keyup.call(F.uiElement,F.dialog,F.key);A.data.preventDefault();},u=function(A,B,C,D,E){var F=r[C]||(r[C]=[]);F.push({uiElement:A,dialog:B,key:C,keyup:E||A.accessKeyUp,keydown:D||A.accessKeyDown});},v=function(A){for(var B in r){var C=r[B];for(var D=C.length-1;D>=0;D--)if(C[D].dialog==A||C[D].uiElement==A)C.splice(D,1);if(C.length===0)delete r[B];}},w=function(A,B){if(A._.accessKeyMap[B])A.selectPage(A._.accessKeyMap[B]);},x=function(A,B){},y={27:1,13:1},z=function(A){if(A.data.getKeystroke() in y)A.data.stopPropagation();};(function(){CKEDITOR.ui.dialog={uiElement:function(A,B,C,D,E,F,G){if(arguments.length<4)return;var H=(D.call?D(B):D)||('div'),I=['<',H,' '],J=(E&&E.call?E(B):E)||({}),K=(F&&F.call?F(B):F)||({}),L=(G&&G.call?G(A,B):G)||(''),M=this.domId=K.id||CKEDITOR.tools.getNextNumber()+'_uiElement',N=this.id=B.id,O; K.id=M;var P={};if(B.type)P['cke_dialog_ui_'+B.type]=1;if(B.className)P[B.className]=1;var Q=K['class']&&K['class'].split?K['class'].split(' '):[];for(O=0;O<Q.length;O++)if(Q[O])P[Q[O]]=1;var R=[];for(O in P)R.push(O);K['class']=R.join(' ');if(B.title)K.title=B.title;var S=(B.style||'').split(';');for(O in J)S.push(O+':'+J[O]);if(B.hidden)S.push('display:none');for(O=S.length-1;O>=0;O--)if(S[O]==='')S.splice(O,1);if(S.length>0)K.style=(K.style?K.style+'; ':'')+(S.join('; '));for(O in K)I.push(O+'="'+CKEDITOR.tools.htmlEncode(K[O])+'" ');I.push('>',L,'</',H,'>');C.push(I.join(''));(this._||(this._={})).dialog=A;if(typeof B.isChanged=='boolean')this.isChanged=function(){return B.isChanged;};if(typeof B.isChanged=='function')this.isChanged=B.isChanged;CKEDITOR.event.implementOn(this);this.registerEvents(B);if(this.accessKeyUp&&this.accessKeyDown&&B.accessKey)u(this,A,'CTRL+'+B.accessKey);var T=this;A.on('load',function(){if(T.getInputElement())T.getInputElement().on('focus',function(){A._.tabBarMode=false;A._.hasFocus=true;T.fire('focus');},T);});if(this.keyboardFocusable){this.focusIndex=A._.focusList.push(this)-1;this.on('focus',function(){A._.currentFocusIndex=T.focusIndex;});}CKEDITOR.tools.extend(this,B);},hbox:function(A,B,C,D,E){if(arguments.length<4)return;this._||(this._={});var F=this._.children=B,G=E&&E.widths||null,H=E&&E.height||null,I={},J,K=function(){var L=['<tbody><tr class="cke_dialog_ui_hbox">'];for(J=0;J<C.length;J++){var M='cke_dialog_ui_hbox_child',N=[];if(J===0)M='cke_dialog_ui_hbox_first';if(J==C.length-1)M='cke_dialog_ui_hbox_last';L.push('<td class="',M,'" ');if(G){if(G[J])N.push('width:'+CKEDITOR.tools.cssLength(G[J]));}else N.push('width:'+Math.floor(100/C.length)+'%');if(H)N.push('height:'+CKEDITOR.tools.cssLength(H));if(E&&E.padding!=undefined)N.push('padding:'+CKEDITOR.tools.cssLength(E.padding));if(N.length>0)L.push('style="'+N.join('; ')+'" ');L.push('>',C[J],'</td>');}L.push('</tr></tbody>');return L.join('');};CKEDITOR.ui.dialog.uiElement.call(this,A,E||{type:'hbox'},D,'table',I,E&&E.align&&{align:E.align}||null,K);},vbox:function(A,B,C,D,E){if(arguments.length<3)return;this._||(this._={});var F=this._.children=B,G=E&&E.width||null,H=E&&E.heights||null,I=function(){var J=['<table cellspacing="0" border="0" '];J.push('style="');if(E&&E.expand)J.push('height:100%;');J.push('width:'+CKEDITOR.tools.cssLength(G||'100%'),';');J.push('"');J.push('align="',CKEDITOR.tools.htmlEncode(E&&E.align||(A.getParentEditor().lang.dir=='ltr'?'left':'right')),'" '); J.push('><tbody>');for(var K=0;K<C.length;K++){var L=[];J.push('<tr><td ');if(G)L.push('width:'+CKEDITOR.tools.cssLength(G||'100%'));if(H)L.push('height:'+CKEDITOR.tools.cssLength(H[K]));else if(E&&E.expand)L.push('height:'+Math.floor(100/C.length)+'%');if(E&&E.padding!=undefined)L.push('padding:'+CKEDITOR.tools.cssLength(E.padding));if(L.length>0)J.push('style="',L.join('; '),'" ');J.push(' class="cke_dialog_ui_vbox_child">',C[K],'</td></tr>');}J.push('</tbody></table>');return J.join('');};CKEDITOR.ui.dialog.uiElement.call(this,A,E||{type:'vbox'},D,'div',null,null,I);}};})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(A){this.getInputElement().setValue(A);this.fire('change',{value:A});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var D=this;var A=D.getInputElement(),B=A,C;while((B=B.getParent())&&(B.$.className.search('cke_dialog_page_contents')==-1)){}if(!B)return D;C=B.getAttribute('name');if(D._.dialog._.currentTabId!=C)D._.dialog.selectPage(C);return D;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(A){var B=/^on([A-Z]\w+)/,C,D=function(F,G,H,I){G.on('load',function(){F.getInputElement().on(H,I,F);});};for(var E in A){if(!(C=E.match(B)))continue;if(this.eventProcessors[E])this.eventProcessors[E].call(this,this._.dialog,A[E]);else D(this,this._.dialog,C[1].toLowerCase(),A[E]);}return this;},eventProcessors:{onLoad:function(A,B){A.on('load',B,this);},onShow:function(A,B){A.on('show',B,this);},onHide:function(A,B){A.on('hide',B,this);}},accessKeyDown:function(A,B){this.focus();},accessKeyUp:function(A,B){},disable:function(){var A=this.getInputElement();A.setAttribute('disabled','true');A.addClass('cke_disabled');},enable:function(){var A=this.getInputElement();A.removeAttribute('disabled');A.removeClass('cke_disabled');},isEnabled:function(){return!this.getInputElement().getAttribute('disabled');},isVisible:function(){return!!this.getInputElement().$.offsetHeight;},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{getChild:function(A){var B=this;if(arguments.length<1)return B._.children.concat(); if(!A.splice)A=[A];if(A.length<2)return B._.children[A[0]];else return B._.children[A[0]]&&B._.children[A[0]].getChild?B._.children[A[0]].getChild(A.slice(1,A.length)):null;}},true);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox();(function(){var A={build:function(B,C,D){var E=C.children,F,G=[],H=[];for(var I=0;I<E.length&&(F=E[I]);I++){var J=[];G.push(J);H.push(CKEDITOR.dialog._.uiElementBuilders[F.type].build(B,F,J));}return new CKEDITOR.ui.dialog[C.type](B,H,G,D,C);}};CKEDITOR.dialog.addUIElement('hbox',A);CKEDITOR.dialog.addUIElement('vbox',A);})();CKEDITOR.dialogCommand=function(A){this.dialogName=A;};CKEDITOR.dialogCommand.prototype={exec:function(A){A.openDialog(this.dialogName);},canUndo:false};(function(){var A=/^([a]|[^a])+$/,B=/^\d*$/,C=/^\d*(?:\.\d+)?$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){return function(){var J=this;var D=J&&J.getValue?J.getValue():arguments[0],E=undefined,F=CKEDITOR.VALIDATE_AND,G=[],H;for(H=0;H<arguments.length;H++)if(typeof arguments[H]=='function')G.push(arguments[H]);else break;if(H<arguments.length&&typeof arguments[H]=='string'){E=arguments[H];H++;}if(H<arguments.length&&typeof arguments[H]=='number')F=arguments[H];var I=F==CKEDITOR.VALIDATE_AND?true:false;for(H=0;H<G.length;H++)if(F==CKEDITOR.VALIDATE_AND)I=I&&G[H](D);else I=I||G[H](D);if(!I){if(E!==undefined)alert(E);if(J&&(J.select||J.focus))J.select||J.focus();return false;}return true;};},regex:function(D,E){return function(){var G=this;var F=G&&G.getValue?G.getValue():arguments[0];if(!D.test(F)){if(E!==undefined)alert(E);if(G&&(G.select||G.focus))if(G.select)G.select();else G.focus();return false;}return true;};},notEmpty:function(D){return this.regex(A,D);},integer:function(D){return this.regex(B,D);},number:function(D){return this.regex(C,D);},equals:function(D,E){return this.functions(function(F){return F==D;},E);},notEqual:function(D,E){return this.functions(function(F){return F!=D;},E);}};})();CKEDITOR.skins.add=(function(){var A=CKEDITOR.skins.add;return function(B,C){d[B]={margins:C.margins};return A.apply(this,arguments);};})();})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a){var b=CKEDITOR.dialog._.dialogDefinitions[a];if(typeof b=='function'){var c=this._.storedDialogs||(this._.storedDialogs={}),d=c[a]||(c[a]=new CKEDITOR.dialog(this,a));d.show();return d;}else if(b=='failed')throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.'); var e=CKEDITOR.document.getBody(),f=e.$.style.cursor,g=this;e.setStyle('cursor','wait');CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(b),function(){if(typeof CKEDITOR.dialog._.dialogDefinitions[a]!='function')CKEDITOR.dialog._.dialogDefinitions[a]='failed';g.openDialog(a);e.setStyle('cursor',f);});return null;}});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/dialog/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){CKEDITOR.plugins.add('enterkey',{requires:['keystrokes','indent'],init:function(h){var i=h.specialKeys;i[13]=d;i[CKEDITOR.SHIFT+13]=c;}});var a,b=/^h[1-6]$/;function c(h){a=1;return d(h,h.config.shiftEnterMode);};function d(h,i){if(h.mode!='wysiwyg')return false;if(!i)i=h.config.enterMode;setTimeout(function(){h.fire('saveSnapshot');if(i==CKEDITOR.ENTER_BR||h.getSelection().getStartElement().hasAscendant('pre',true))f(h,i);else e(h,i);a=0;},0);return true;};function e(h,i,j){j=j||g(h);var k=j.document,l=i==CKEDITOR.ENTER_DIV?'div':'p',m=j.splitBlock(l);if(!m)return;var n=m.previousBlock,o=m.nextBlock,p=m.wasStartOfBlock,q=m.wasEndOfBlock,r;if(o){r=o.getParent();if(r.is('li')){o.breakParent(r);o.move(o.getNext(),true);}}else if(n&&(r=n.getParent())&&(r.is('li'))){n.breakParent(r);j.moveToElementEditStart(n.getNext());n.move(n.getPrevious());}if(!p&&!q){if(o.is('li')&&(r=o.getFirst())&&(r.is&&r.is('ul','ol')))o.insertBefore(k.createText('\xa0'),r);if(o)j.moveToElementEditStart(o);}else{if(p&&q&&n.is('li')){h.execCommand('outdent');return;}var s;if(n){if(!a&&!b.test(n.getName()))s=n.clone();}else if(o)s=o.clone();if(!s)s=k.createElement(l);var t=m.elementPath;if(t)for(var u=0,v=t.elements.length;u<v;u++){var w=t.elements[u];if(w.equals(t.block)||w.equals(t.blockLimit))break;if(CKEDITOR.dtd.$removeEmpty[w.getName()]){w=w.clone();s.moveChildren(w);s.append(w);}}if(!CKEDITOR.env.ie)s.appendBogus();j.insertNode(s);if(CKEDITOR.env.ie&&p&&(!q||!n.getChildCount())){j.moveToElementEditStart(q?n:s);j.select();}j.moveToElementEditStart(p&&!q?o:s);}if(!CKEDITOR.env.ie)if(o){var x=k.createElement('span');x.setHtml('&nbsp;');j.insertNode(x);x.scrollIntoView();j.deleteContents();}else s.scrollIntoView();j.select();};function f(h,i){var j=g(h),k=j.document,l=i==CKEDITOR.ENTER_DIV?'div':'p',m=j.checkEndOfBlock(),n=new CKEDITOR.dom.elementPath(h.getSelection().getStartElement()),o=n.block,p=o&&n.block.getName(),q=false;if(!a&&p=='li'){e(h,i,j);return;}if(!a&&m&&b.test(p)){k.createElement('br').insertAfter(o);if(CKEDITOR.env.gecko)k.createText('').insertAfter(o);j.setStartAt(o.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START);}else{var r;q=p=='pre';if(q)r=k.createText(CKEDITOR.env.ie?'\r':'\n');else r=k.createElement('br');j.deleteContents();j.insertNode(r);if(!CKEDITOR.env.ie)k.createText('').insertAfter(r);if(m&&!CKEDITOR.env.ie)r.getParent().appendBogus();if(!CKEDITOR.env.ie)r.getNext().$.nodeValue='';if(CKEDITOR.env.ie)j.setStartAt(r,CKEDITOR.POSITION_AFTER_END); else j.setStartAt(r.getNext(),CKEDITOR.POSITION_AFTER_START);if(!CKEDITOR.env.ie){var s=null;if(!CKEDITOR.env.gecko){s=k.createElement('span');s.setHtml('&nbsp;');}else s=k.createElement('br');s.insertBefore(r.getNext());s.scrollIntoView();s.remove();}}j.collapse(true);j.select(q);};function g(h){var i=h.getSelection().getRanges();for(var j=i.length-1;j>0;j--)i[j].deleteContents();return i[0];};})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/enterkey/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a={table:1,pre:1},b=/\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|&#160;)\s*(:?<\/\1>)?\s*$/gi;function c(g){var l=this;if(l.mode=='wysiwyg'){l.focus();var h=l.getSelection(),i=g.data;if(l.dataProcessor)i=l.dataProcessor.toHtml(i);if(CKEDITOR.env.ie){var j=h.isLocked;if(j)h.unlock();var k=h.getNative();if(k.type=='Control')k.clear();k.createRange().pasteHTML(i);if(j)l.getSelection().lock();}else l.document.$.execCommand('inserthtml',false,i);}};function d(g){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var h=g.data,i=h.getName(),j=CKEDITOR.dtd.$block[i],k=this.getSelection(),l=k.getRanges(),m=k.isLocked;if(m)k.unlock();var n,o,p,q;for(var r=l.length-1;r>=0;r--){n=l[r];n.deleteContents();o=!r&&h||h.clone(true);var s,t;if(j)while((s=n.getCommonAncestor(false,true))&&((t=CKEDITOR.dtd[s.getName()])&&(!(t&&t[i]))))if(n.checkStartOfBlock()&&n.checkEndOfBlock()){n.setStartBefore(s);n.collapse(true);s.remove();}else n.splitBlock();n.insertNode(o);if(!p)p=o;}n.moveToPosition(p,CKEDITOR.POSITION_AFTER_END);var u=p.getNextSourceNode(true);if(u&&u.type==CKEDITOR.NODE_ELEMENT)n.moveToElementEditStart(u);k.selectRanges([n]);if(m)this.getSelection().lock();CKEDITOR.tools.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function e(g){if(!g.checkDirty())setTimeout(function(){g.resetDirty();});};function f(g){var h=g.editor,i=g.data.path,j=i.blockLimit,k=g.data.selection,l=k.getRanges()[0],m=h.document.getBody(),n=h.config.enterMode;if(n!=CKEDITOR.ENTER_BR&&l.collapsed&&j.getName()=='body'&&!i.block){e(h);var o=k.createBookmarks(),p=l.fixBlock(true,h.config.enterMode==CKEDITOR.ENTER_DIV?'div':'p');if(CKEDITOR.env.ie){var q=p.getElementsByTag('br'),r;for(var s=0;s<q.count();s++)if((r=q.getItem(s))&&(r.hasAttribute('_cke_bogus')))r.remove();}k.selectBookmarks(o);var t=p.getChildren(),u=t.count(),v,w=CKEDITOR.dom.walker.whitespaces(true),x=p.getPrevious(w),y=p.getNext(w),z;if(x&&x.getName&&!(x.getName() in a))z=x;else if(y&&y.getName&&!(y.getName() in a))z=y;if((!u||(v=t.getItem(0))&&(v.is&&v.is('br')))&&(z&&l.moveToElementEditStart(z))){p.remove();l.select();}}var A=m.getLast(CKEDITOR.dom.walker.whitespaces(true));if(A&&A.getName&&A.getName() in a){e(h);var B=h.document.createElement(CKEDITOR.env.ie&&n!=CKEDITOR.ENTER_BR?'<br _cke_bogus="true" />':'br');m.append(B);}};CKEDITOR.plugins.add('wysiwygarea',{requires:['editingblock'],init:function(g){var h=g.config.enterMode!=CKEDITOR.ENTER_BR?g.config.enterMode==CKEDITOR.ENTER_DIV?'div':'p':false; g.on('editingBlockReady',function(){var i,j,k,l,m,n,o,p=CKEDITOR.env.isCustomDomain(),q=function(){if(k)k.remove();if(j)j.remove();n=0;var t='void( '+(CKEDITOR.env.gecko?'setTimeout':'')+'( function(){'+'document.open();'+(CKEDITOR.env.ie&&p?'document.domain="'+document.domain+'";':'')+'document.write( window.parent[ "_cke_htmlToLoad_'+g.name+'" ] );'+'document.close();'+'window.parent[ "_cke_htmlToLoad_'+g.name+'" ] = null;'+'}'+(CKEDITOR.env.gecko?', 0 )':')()')+' )';if(CKEDITOR.env.opera)t='void(0);';k=CKEDITOR.dom.element.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0" tabIndex="-1" allowTransparency="true" src="javascript:'+encodeURIComponent(t)+'"'+'></iframe>');var u=g.lang.editorTitle.replace('%1',g.name);if(CKEDITOR.env.gecko){k.on('load',function(v){v.removeListener();s(k.$.contentWindow);});i.setAttributes({role:'region',title:u});k.setAttributes({role:'region',title:' '});}else if(CKEDITOR.env.webkit){k.setAttribute('title',u);k.setAttribute('name',u);}else if(CKEDITOR.env.ie){j=CKEDITOR.dom.element.createFromHtml('<fieldset style="height:100%'+(CKEDITOR.env.ie&&CKEDITOR.env.quirks?';position:relative':'')+'">'+'<legend style="display:block;width:0;height:0;overflow:hidden;'+(CKEDITOR.env.ie&&CKEDITOR.env.quirks?'position:absolute':'')+'">'+CKEDITOR.tools.htmlEncode(u)+'</legend>'+'</fieldset>',CKEDITOR.document);k.appendTo(j);j.appendTo(i);}if(!CKEDITOR.env.ie)i.append(k);},r='<script id="cke_actscrpt" type="text/javascript">window.onload = function(){window.parent.CKEDITOR._["contentDomReady'+g.name+'"]( window );'+'}'+'</script>',s=function(t){if(n)return;n=1;var u=t.document,v=u.body,w=u.getElementById('cke_actscrpt');w.parentNode.removeChild(w);delete CKEDITOR._['contentDomReady'+g.name];v.spellcheck=!g.config.disableNativeSpellChecker;if(CKEDITOR.env.ie){v.hideFocus=true;v.disabled=true;v.contentEditable=true;v.removeAttribute('disabled');}else u.designMode='on';try{u.execCommand('enableObjectResizing',false,!g.config.disableObjectResizing);}catch(z){}try{u.execCommand('enableInlineTableEditing',false,!g.config.disableNativeTableHandles);}catch(A){}t=g.window=new CKEDITOR.dom.window(t);u=g.document=new CKEDITOR.dom.document(u);if(!(CKEDITOR.env.ie||CKEDITOR.env.opera))u.on('mousedown',function(B){var C=B.data.getTarget();if(C.is('img','hr','input','textarea','select'))g.getSelection().selectElement(C);});if(CKEDITOR.env.webkit){u.on('click',function(B){if(B.data.getTarget().is('input','select'))B.data.preventDefault(); });u.on('mouseup',function(B){if(B.data.getTarget().is('input','textarea'))B.data.preventDefault();});}var x=CKEDITOR.env.ie||CKEDITOR.env.webkit?t:u;x.on('blur',function(){g.focusManager.blur();});x.on('focus',function(){if(CKEDITOR.env.gecko){var B=v;while(B.firstChild)B=B.firstChild;if(!B.nextSibling&&'BR'==B.tagName&&B.hasAttribute('_moz_editor_bogus_node')){var C=u.$.createEvent('KeyEvents');C.initKeyEvent('keypress',true,true,t.$,false,false,false,false,0,32);u.$.dispatchEvent(C);var D=u.getBody().getFirst();if(g.config.enterMode==CKEDITOR.ENTER_BR)u.createElement('br',{attributes:{_moz_dirty:''}}).replace(D);else D.remove();}}g.focusManager.focus();});var y=g.keystrokeHandler;if(y)y.attach(u);if(CKEDITOR.env.ie)g.on('key',function(B){var C=B.data.keyCode==8&&g.getSelection().getSelectedElement();if(C){g.fire('saveSnapshot');C.remove();g.fire('saveSnapshot');B.cancel();}});if(g.contextMenu)g.contextMenu.addTarget(u);setTimeout(function(){g.fire('contentDom');if(o){g.mode='wysiwyg';g.fire('mode');o=false;}l=false;if(m){g.focus();m=false;}setTimeout(function(){g.fire('dataReady');},0);if(CKEDITOR.env.ie)setTimeout(function(){if(g.document){var B=g.document.$.body;B.runtimeStyle.marginBottom='0px';B.runtimeStyle.marginBottom='';}},1000);},0);};g.addMode('wysiwyg',{load:function(t,u,v){i=t;if(CKEDITOR.env.ie&&CKEDITOR.env.quirks)t.setStyle('position','relative');g.mayBeDirty=true;o=true;if(v)this.loadSnapshotData(u);else this.loadData(u);},loadData:function(t){l=true;if(g.dataProcessor)t=g.dataProcessor.toHtml(t,h);t=g.config.docType+'<html dir="'+g.config.contentsLangDirection+'">'+'<head>'+'<link type="text/css" rel="stylesheet" href="'+[].concat(g.config.contentsCss).join('"><link type="text/css" rel="stylesheet" href="')+'">'+'<style type="text/css" _fcktemp="true">'+g._.styles.join('\n')+'</style>'+'</head>'+'<body>'+t+'</body>'+'</html>'+r;window['_cke_htmlToLoad_'+g.name]=t;CKEDITOR._['contentDomReady'+g.name]=s;q();if(CKEDITOR.env.opera){var u=k.$.contentWindow.document;u.open();u.write(t);u.close();}},getData:function(){var t=k.getFrameDocument().getBody().getHtml();if(g.dataProcessor)t=g.dataProcessor.toDataFormat(t,h);if(g.config.ignoreEmptyParagraph)t=t.replace(b,'');return t;},getSnapshotData:function(){return k.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(t){k.getFrameDocument().getBody().setHtml(t);},unload:function(t){g.window=g.document=k=i=m=null;g.fire('contentDomUnload');},focus:function(){if(l)m=true;else if(g.window){g.window.focus(); g.selectionChange();}}});g.on('insertHtml',c,null,null,20);g.on('insertElement',d,null,null,20);g.on('selectionChange',f,null,null,1);});}});})();CKEDITOR.config.disableObjectResizing=false;CKEDITOR.config.disableNativeTableHandles=true;CKEDITOR.config.disableNativeSpellChecker=true;CKEDITOR.config.ignoreEmptyParagraph=true;
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/wysiwygarea/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(d,e,f){if(!e.is||!e.getCustomData('block_processed')){e.is&&CKEDITOR.dom.element.setMarker(f,e,'block_processed',true);d.push(e);}};function b(d){var e=[],f=d.getChildren();for(var g=0;g<f.count();g++){var h=f.getItem(g);if(!(h.type===CKEDITOR.NODE_TEXT&&/^[ \t\n\r]+$/.test(h.getText())))e.push(h);}return e;};function c(d,e){var f=(function(){var p=CKEDITOR.tools.extend({},CKEDITOR.dtd.$blockLimit);delete p.div;if(d.config.div_wrapTable){delete p.td;delete p.th;}return p;})(),g=CKEDITOR.dtd.div;function h(p){var q=new CKEDITOR.dom.elementPath(p).elements,r;for(var s=0;s<q.length;s++){if(q[s].getName() in f){r=q[s];break;}}return r;};function i(){this.foreach(function(p){if(/^(?!vbox|hbox)/.test(p.type)){if(!p.setup)p.setup=function(q){p.setValue(q.getAttribute(p.id)||'');};if(!p.commit)p.commit=function(q){var r=this.getValue();if('dir'==p.id&&q.getComputedStyle('direction')==r)return;if(r)q.setAttribute(p.id,r);else q.removeAttribute(p.id);};}});};function j(p){var q=[],r={},s=[],t,u=p.document.getSelection(),v=u.getRanges(),w=u.createBookmarks(),x,y,z=p.config.enterMode==CKEDITOR.ENTER_DIV?'div':'p';for(x=0;x<v.length;x++){y=v[x].createIterator();while(t=y.getNextParagraph()){if(t.getName() in f){var A,B=t.getChildren();for(A=0;A<B.count();A++)a(s,B.getItem(A),r);}else{while(!g[t.getName()]&&t.getName()!='body')t=t.getParent();a(s,t,r);}}}CKEDITOR.dom.element.clearAllMarkers(r);var C=l(s),D,E,F;for(x=0;x<C.length;x++){var G=C[x][0];D=G.getParent();for(A=1;A<C[x].length;A++)D=D.getCommonAncestor(C[x][A]);F=new CKEDITOR.dom.element('div',p.document);for(A=0;A<C[x].length;A++){G=C[x][A];while(!G.getParent().equals(D))G=G.getParent();C[x][A]=G;}var H=null;for(A=0;A<C[x].length;A++){G=C[x][A];if(!(G.getCustomData&&G.getCustomData('block_processed'))){G.is&&CKEDITOR.dom.element.setMarker(r,G,'block_processed',true);if(!A)F.insertBefore(G);F.append(G);}}CKEDITOR.dom.element.clearAllMarkers(r);q.push(F);}u.selectBookmarks(w);return q;};function k(p){var q=new CKEDITOR.dom.elementPath(p.getSelection().getStartElement()),r=q.blockLimit,s=r&&r.getAscendant('div',true);return s;};function l(p){var q=[],r=null,s,t;for(var u=0;u<p.length;u++){t=p[u];var v=h(t);if(!v.equals(r)){r=v;q.push([]);}q[q.length-1].push(t);}return q;};function m(p){var q=this.getDialog(),r=q._element&&q._element.clone()||new CKEDITOR.dom.element('div',d.document);this.commit(r,true);p=[].concat(p);var s=p.length,t;for(var u=0;u<s;u++){t=q.getContentElement.apply(q,p[u].split(':')); t&&t.setup&&t.setup(r,true);}};var n={},o=[];return{title:d.lang.div.title,minWidth:400,minHeight:165,contents:[{id:'info',label:d.lang.common.generalTab,title:d.lang.common.generalTab,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'elementStyle',type:'select',style:'width: 100%;',label:d.lang.div.styleSelectLabel,'default':'',items:[[d.lang.common.notSet,'']],onChange:function(){m.call(this,['info:class','advanced:dir','advanced:style']);},setup:function(p){for(var q in n)n[q].checkElementRemovable(p,true)&&this.setValue(q);},commit:function(p){var q;if(q=this.getValue()){var r=n[q],s=p.getCustomData('elementStyle')||'';r.applyToObject(p);p.setCustomData('elementStyle',s+r._.definition.attributes.style);}}},{id:'class',type:'text',label:d.lang.common.cssClass,'default':''}]}]},{id:'advanced',label:d.lang.common.advancedTab,title:d.lang.common.advancedTab,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['50%','50%'],children:[{type:'text',id:'id',label:d.lang.common.id,'default':''},{type:'text',id:'lang',label:d.lang.link.langCode,'default':''}]},{type:'hbox',children:[{type:'text',id:'style',style:'width: 100%;',label:d.lang.common.cssStyle,'default':'',commit:function(p){var q=this.getValue()+(p.getCustomData('elementStyle')||'');p.setAttribute('style',q);}}]},{type:'hbox',children:[{type:'text',id:'title',style:'width: 100%;',label:d.lang.common.advisoryTitle,'default':''}]},{type:'select',id:'dir',style:'width: 100%;',label:d.lang.common.langDir,'default':'',items:[[d.lang.common.notSet,''],[d.lang.common.langDirLtr,'ltr'],[d.lang.common.langDirRtl,'rtl']]}]}]}],onLoad:function(){i.call(this);var p=this,q=this.getContentElement('info','elementStyle');d.getStylesSet(function(r){var s;if(r)for(var t=0;t<r.length;t++){var u=r[t];if(u.element&&u.element=='div'){s=u.name;n[s]=new CKEDITOR.style(u);q.items.push([s,s]);q.add(s,s);}}q[q.items.length>1?'enable':'disable']();setTimeout(function(){q.setup(p._element);},0);});},onShow:function(){if(e=='editdiv'){var p=k(d);p&&this.setupContent(this._element=p);}},onOk:function(){if(e=='editdiv')o=[this._element];else o=j(d,true);var p=o.length;for(var q=0;q<p;q++){this.commitContent(o[q]);!o[q].getAttribute('style')&&o[q].removeAttribute('style');}this.hide();},onHide:function(){if(e=='editdiv')this._element.removeCustomData('elementStyle');delete this._element;}};};CKEDITOR.dialog.add('creatediv',function(d){return c(d,'creatediv');});CKEDITOR.dialog.add('editdiv',function(d){return c(d,'editdiv'); });})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/div/dialogs/div.js
div.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(a){var b=a.config,c=a.lang.colorButton,d;if(!CKEDITOR.env.hc){e('TextColor','fore',c.textColorTitle);e('BGColor','back',c.bgColorTitle);}function e(g,h,i){a.ui.add(g,CKEDITOR.UI_PANELBUTTON,{label:i,title:i,className:'cke_button_'+g.toLowerCase(),modes:{wysiwyg:1},panel:{css:[CKEDITOR.getUrl(a.skinPath+'editor.css')]},onBlock:function(j,k){var l=j.addBlock(k);l.autoSize=true;l.element.addClass('cke_colorblock');l.element.setHtml(f(j,h));var m=l.keys;m[39]='next';m[9]='next';m[37]='prev';m[CKEDITOR.SHIFT+9]='prev';m[32]='click';}});};function f(g,h){var i=[],j=b.colorButton_colors.split(','),k=CKEDITOR.tools.addFunction(function(o,p){if(o=='?')return;a.focus();g.hide();var q=new CKEDITOR.style(b['colorButton_'+p+'Style'],o&&{color:o});a.fire('saveSnapshot');if(o)q.apply(a.document);else q.remove(a.document);a.fire('saveSnapshot');});i.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',c.auto,'" onclick="CKEDITOR.tools.callFunction(',k,",null,'",h,"');return false;\" href=\"javascript:void('",c.auto,'\')"><table cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" style="background-color:#000"></span></td><td colspan=7 align=center>',c.auto,'</td></tr></table></a><table cellspacing=0 cellpadding=0 width="100%">');for(var l=0;l<j.length;l++){if(l%8===0)i.push('</tr><tr>');var m=j[l],n=a.lang.colors[m]||m;i.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',n,'" onclick="CKEDITOR.tools.callFunction(',k,",'#",m,"','",h,"'); return false;\" href=\"javascript:void('",n,'\')"><span class="cke_colorbox" style="background-color:#',m,'"></span></a></td>');}if(b.colorButton_enableMore)i.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',c.more,'" onclick="CKEDITOR.tools.callFunction(',k,",'?','",h,"');return false;\" href=\"javascript:void('",c.more,"')\">",c.more,'</a></td>');i.push('</tr></table>');return i.join('');};}});CKEDITOR.config.colorButton_enableMore=false;CKEDITOR.config.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';CKEDITOR.config.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]}; CKEDITOR.config.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/colorbutton/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=['click','keydown','mousedown','keypress','mouseover','mouseout'];function b(c){var d=c.getElementsByTag('*'),e=d.count(),f;for(var g=0;g<e;g++){f=d.getItem(g);(function(h){for(var i=0;i<a.length;i++)(function(j){var k=h.getAttribute('on'+j);if(h.hasAttribute('on'+j)){h.removeAttribute('on'+j);h.on(j,function(l){var m=/(return\s*)?CKEDITOR\.tools\.callFunction\(([^)]+)\)/.exec(k),n=m&&m[1],o=m&&m[2].split(','),p=/return false;/.test(k);if(o){var q=o.length,r;for(var s=0;s<q;s++){o[s]=r=CKEDITOR.tools.trim(o[s]);var t=r.match(/^(["'])([^"']*?)\1$/);if(t){o[s]=t[2];continue;}if(r.match(/\d+/)){o[s]=parseInt(r,10);continue;}switch(r){case 'this':o[s]=h.$;break;case 'event':o[s]=l.data.$;break;case 'null':o[s]=null;break;}}var u=CKEDITOR.tools.callFunction.apply(window,o);if(n&&u===false)p=1;}if(p)l.data.preventDefault();});}})(a[i]);})(f);}};CKEDITOR.plugins.add('adobeair',{init:function(c){if(!CKEDITOR.env.air)return;c.addCss('body { padding: 8px }');c.on('uiReady',function(){b(c.container);if(c.sharedSpaces)for(var d in c.sharedSpaces)b(c.sharedSpaces[d]);c.on('elementsPathUpdate',function(e){b(e.data.space);});});c.on('contentDom',function(){c.document.on('click',function(d){d.data.preventDefault(true);});});}});CKEDITOR.ui.on('ready',function(c){var d=c.data;if(d._.panel){var e=d._.panel._.panel,f;(function(){if(!e.isLoaded){setTimeout(arguments.callee,30);return;}f=e._.holder;b(f);})();}else if(d instanceof CKEDITOR.dialog)b(d._.element);});})();CKEDITOR.dom.document.prototype.write=CKEDITOR.tools.override(CKEDITOR.dom.document.prototype.write,function(a){function b(c,d,e,f){var g=c.append(d),h=CKEDITOR.htmlParser.fragment.fromHtml(e).children[0].attributes;h&&g.setAttributes(h);f&&g.append(c.getDocument().createText(f));};return function(c,d){if(this.getBody()){var e=this,f=this.getHead();c=c.replace(/(<style[^>]*>)([\s\S]*?)<\/style>/gi,function(g,h,i){b(f,'style',h,i);return '';});c=c.replace(/<base\b[^>]*\/>/i,function(g){b(f,'base',g);return '';});c=c.replace(/<title>([\s\S]*)<\/title>/i,function(g,h){e.$.title=h;return '';});c=c.replace(/<head>([\s\S]*)<\/head>/i,function(g){var h=new CKEDITOR.dom.element('div',e);h.setHtml(g);h.moveChildren(f);return '';});c.replace(/(<body[^>]*>)([\s\S]*)(?=$|<\/body>)/i,function(g,h,i){e.getBody().setHtml(i);var j=CKEDITOR.htmlParser.fragment.fromHtml(h).children[0].attributes;j&&e.getBody().setAttributes(j);});}else a.apply(this,arguments);};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/adobeair/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=/(-moz-|-webkit-|start|auto)/i;function b(e,f){var g=f.block||f.blockLimit;if(!g||g.getName()=='body')return CKEDITOR.TRISTATE_OFF;var h=g.getComputedStyle('text-align').replace(a,'');if(!h&&this.isDefaultAlign||h==this.value)return CKEDITOR.TRISTATE_ON;return CKEDITOR.TRISTATE_OFF;};function c(e){var f=e.editor.getCommand(this.name);f.state=b.call(this,e.editor,e.data.path);f.fire('state');};function d(e,f,g){var j=this;j.name=f;j.value=g;var h=e.config.contentsLangDirection;j.isDefaultAlign=g=='left'&&h=='ltr'||g=='right'&&h=='rtl';var i=e.config.justifyClasses;if(i){switch(g){case 'left':j.cssClassName=i[0];break;case 'center':j.cssClassName=i[1];break;case 'right':j.cssClassName=i[2];break;case 'justify':j.cssClassName=i[3];break;}j.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+i.join('|')+')(?=$|\\s)');}};d.prototype={exec:function(e){var n=this;var f=e.getSelection();if(!f)return;var g=f.createBookmarks(),h=f.getRanges(),i=n.cssClassName,j,k;for(var l=h.length-1;l>=0;l--){j=h[l].createIterator();while(k=j.getNextParagraph()){k.removeAttribute('align');if(i){var m=k.$.className=CKEDITOR.tools.ltrim(k.$.className.replace(n.cssClassRegex,''));if(n.state==CKEDITOR.TRISTATE_OFF&&!n.isDefaultAlign)k.addClass(i);else if(!m)k.removeAttribute('class');}else if(n.state==CKEDITOR.TRISTATE_OFF&&!n.isDefaultAlign)k.setStyle('text-align',n.value);else k.removeStyle('text-align');}}e.focus();e.forceNextSelectionCheck();f.selectBookmarks(g);}};CKEDITOR.plugins.add('justify',{init:function(e){var f=new d(e,'justifyleft','left'),g=new d(e,'justifycenter','center'),h=new d(e,'justifyright','right'),i=new d(e,'justifyblock','justify');e.addCommand('justifyleft',f);e.addCommand('justifycenter',g);e.addCommand('justifyright',h);e.addCommand('justifyblock',i);e.ui.addButton('JustifyLeft',{label:e.lang.justify.left,command:'justifyleft'});e.ui.addButton('JustifyCenter',{label:e.lang.justify.center,command:'justifycenter'});e.ui.addButton('JustifyRight',{label:e.lang.justify.right,command:'justifyright'});e.ui.addButton('JustifyBlock',{label:e.lang.justify.block,command:'justifyblock'});e.on('selectionChange',CKEDITOR.tools.bind(c,f));e.on('selectionChange',CKEDITOR.tools.bind(c,h));e.on('selectionChange',CKEDITOR.tools.bind(c,g));e.on('selectionChange',CKEDITOR.tools.bind(c,i));},requires:['domiterator']});})();CKEDITOR.tools.extend(CKEDITOR.config,{justifyClasses:null});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/justify/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a={scrolling:{'true':'yes','false':'no'},frameborder:{'true':'1','false':'0'}};function b(d){var g=this;var e=g instanceof CKEDITOR.ui.dialog.checkbox;if(d.hasAttribute(g.id)){var f=d.getAttribute(g.id);if(e)g.setValue(a[g.id]['true']==f.toLowerCase());else g.setValue(f);}};function c(d){var h=this;var e=h.getValue()==='',f=h instanceof CKEDITOR.ui.dialog.checkbox,g=h.getValue();if(e)d.removeAttribute(h.att||h.id);else if(f)d.setAttribute(h.id,a[h.id][g]);else d.setAttribute(h.att||h.id,g);};CKEDITOR.dialog.add('iframe',function(d){var e=d.lang.iframe,f=d.lang.common,g=d.plugins.dialogadvtab;return{title:e.title,minWidth:350,minHeight:260,onShow:function(){var j=this;j.fakeImage=j.iframeNode=null;var h=j.getSelectedElement();if(h&&h.data('cke-real-element-type')&&h.data('cke-real-element-type')=='iframe'){j.fakeImage=h;var i=d.restoreRealElement(h);j.iframeNode=i;j.setupContent(i,h);}},onOk:function(){var l=this;var h;if(!l.fakeImage)h=new CKEDITOR.dom.element('iframe');else h=l.iframeNode;var i={},j={};l.commitContent(h,i,j);var k=d.createFakeElement(h,'cke_iframe','iframe',true);k.setAttributes(j);k.setStyles(i);if(l.fakeImage){k.replace(l.fakeImage);d.getSelection().selectElement(k);}else d.insertElement(k);},contents:[{id:'info',label:f.generalTab,accessKey:'I',elements:[{type:'vbox',padding:0,children:[{id:'src',type:'text',label:f.url,required:true,validate:CKEDITOR.dialog.validate.notEmpty(e.noUrl),setup:b,commit:c}]},{type:'hbox',children:[{id:'width',type:'text',style:'width:100%',labelLayout:'vertical',label:f.width,validate:CKEDITOR.dialog.validate.integer(f.invalidWidth),setup:function(h,i){b.apply(this,arguments);if(i){var j=parseInt(i.$.style.width,10);if(!isNaN(j))this.setValue(j);}},commit:function(h,i){c.apply(this,arguments);if(this.getValue())i.width=this.getValue()+'px';}},{id:'height',type:'text',style:'width:100%',labelLayout:'vertical',label:f.height,validate:CKEDITOR.dialog.validate.integer(f.invalidHeight),setup:function(h,i){b.apply(this,arguments);if(i){var j=parseInt(i.$.style.height,10);if(!isNaN(j))this.setValue(j);}},commit:function(h,i){c.apply(this,arguments);if(this.getValue())i.height=this.getValue()+'px';}},{id:'align',type:'select','default':'',items:[[f.notSet,''],[f.alignLeft,'left'],[f.alignRight,'right'],[f.alignTop,'top'],[f.alignMiddle,'middle'],[f.alignBottom,'bottom']],style:'width:100%',labelLayout:'vertical',label:f.align,setup:function(h,i){b.apply(this,arguments);if(i){var j=i.getAttribute('align'); this.setValue(j&&j.toLowerCase()||'');}},commit:function(h,i,j){c.apply(this,arguments);if(this.getValue())j.align=this.getValue();}}]},{type:'hbox',widths:['50%','50%'],children:[{id:'scrolling',type:'checkbox',label:e.scrolling,setup:b,commit:c},{id:'frameborder',type:'checkbox',label:e.border,setup:b,commit:c}]},{type:'hbox',widths:['50%','50%'],children:[{id:'name',type:'text',label:f.name,setup:b,commit:c},{id:'title',type:'text',label:f.advisoryTitle,setup:b,commit:c}]},{id:'longdesc',type:'text',label:f.longDescr,setup:b,commit:c}]},g&&g.createAdvancedTab(d,{id:1,classes:1,styles:1})]};});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/iframe/dialogs/iframe.js
iframe.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler);}});CKEDITOR.UI_RICHCOMBO=3;CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){var c=this;CKEDITOR.tools.extend(c,a,{title:a.label,modes:{wysiwyg:1}});var b=c.panel||{};delete c.panel;c.id=CKEDITOR.tools.getNextNumber();c.document=b&&b.parent&&b.parent.getDocument()||CKEDITOR.document;b.className=(b.className||'')+(' cke_rcombopanel');c._={panelDefinition:b,items:{},state:CKEDITOR.TRISTATE_OFF};},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a);}}},proto:{renderHtml:function(a){var b=[];this.render(a,b);return b.join('');},render:function(a,b){var c='cke_'+this.id,d=CKEDITOR.tools.addFunction(function(g){var j=this;var h=j._;if(h.state==CKEDITOR.TRISTATE_DISABLED)return;j.createPanel(a);if(h.on){h.panel.hide();return;}if(!h.committed){h.list.commit();h.committed=1;}var i=j.getValue();if(i)h.list.mark(i);else h.list.unmarkAll();h.panel.showBlock(j.id,new CKEDITOR.dom.element(g),4);},this),e={id:c,combo:this,focus:function(){var g=CKEDITOR.document.getById(c).getChild(1);g.focus();},execute:d};a.on('mode',function(){this.setState(this.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);},this);var f=CKEDITOR.tools.addFunction(function(g,h){g=new CKEDITOR.dom.event(g);var i=g.getKeystroke();switch(i){case 13:case 32:case 40:CKEDITOR.tools.callFunction(d,h);break;default:e.onkey(e,i);}g.preventDefault();});b.push('<span class="cke_rcombo">','<span id=',c);if(this.className)b.push(' class="',this.className,' cke_off"');b.push('><span class=cke_label>',this.label,'</span><a hidefocus=true title="',this.title,'" tabindex="-1" href="javascript:void(\'',this.label,"')\"");if(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)b.push(' onkeypress="return false;"');if(CKEDITOR.env.gecko)b.push(' onblur="this.style.cssText = this.style.cssText;"');b.push(' onkeydown="CKEDITOR.tools.callFunction( ',f,', event, this );" onclick="CKEDITOR.tools.callFunction(',d,', this); return false;"><span><span class="cke_accessibility">'+(this.voiceLabel?this.voiceLabel+' ':'')+'</span>'+'<span id="'+c+'_text" class="cke_text cke_inline_label">'+this.label+'</span>'+'</span>'+'<span class=cke_openbutton></span>'+'</a>'+'</span>'+'</span>');if(this.onRender)this.onRender();return e;},createPanel:function(a){if(this._.panel)return;var b=this._.panelDefinition,c=b.parent||CKEDITOR.document.getBody(),d=new CKEDITOR.ui.floatPanel(a,c,b),e=d.addListBlock(this.id,this.multiSelect),f=this; d.onShow=function(){if(f.className)this.element.getFirst().addClass(f.className+'_panel');f.setState(CKEDITOR.TRISTATE_ON);e.focus(!f.multiSelect&&f.getValue());f._.on=1;if(f.onOpen)f.onOpen();};d.onHide=function(){if(f.className)this.element.getFirst().removeClass(f.className+'_panel');f.setState(CKEDITOR.TRISTATE_OFF);f._.on=0;if(f.onClose)f.onClose();};d.onEscape=function(){d.hide();f.document.getById('cke_'+f.id).getFirst().getNext().focus();};e.onClick=function(g,h){f.document.getWindow().focus();if(f.onClick)f.onClick.call(f,g,h);if(h)f.setValue(g,f._.items[g]);else f.setValue('');d.hide();};this._.panel=d;this._.list=e;d.getBlock(this.id).onHide=function(){f._.on=0;f.setState(CKEDITOR.TRISTATE_OFF);};if(this.init)this.init();},setValue:function(a,b){var d=this;d._.value=a;var c=d.document.getById('cke_'+d.id+'_text');if(!a){b=d.label;c.addClass('cke_inline_label');}else c.removeClass('cke_inline_label');c.setHtml(typeof b!='undefined'?b:a);},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(a){this._.list.mark(a);},hideItem:function(a){this._.list.hideItem(a);},hideGroup:function(a){this._.list.hideGroup(a);},showAll:function(){this._.list.showAll();},add:function(a,b,c){this._.items[a]=c||a;this._.list.add(a,b,c);},startGroup:function(a){this._.list.startGroup(a);},commit:function(){this._.list.commit();},setState:function(a){var b=this;if(b._.state==a)return;b.document.getById('cke_'+b.id).setState(a);b._.state=a;}}});CKEDITOR.ui.prototype.addRichCombo=function(a,b){this.add(a,CKEDITOR.UI_RICHCOMBO,b);};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/richcombo/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a={ol:1,ul:1};function b(g,h){g.getCommand(this.name).setState(h);};function c(g){var r=this;var h=g.data.path.elements,i,j,k=g.editor;for(var l=0;l<h.length;l++){if(h[l].getName()=='li'){j=h[l];continue;}if(a[h[l].getName()]){i=h[l];break;}}if(i)if(r.name=='outdent')return b.call(r,k,CKEDITOR.TRISTATE_OFF);else{while(j&&(j=j.getPrevious(CKEDITOR.dom.walker.whitespaces(true))))if(j.getName&&j.getName()=='li')return b.call(r,k,CKEDITOR.TRISTATE_OFF);return b.call(r,k,CKEDITOR.TRISTATE_DISABLED);}if(!r.useIndentClasses&&r.name=='indent')return b.call(r,k,CKEDITOR.TRISTATE_OFF);var m=g.data.path,n=m.block||m.blockLimit;if(!n)return b.call(r,k,CKEDITOR.TRISTATE_DISABLED);if(r.useIndentClasses){var o=n.$.className.match(r.classNameRegex),p=0;if(o){o=o[1];p=r.indentClassMap[o];}if(r.name=='outdent'&&!p||r.name=='indent'&&p==k.config.indentClasses.length)return b.call(r,k,CKEDITOR.TRISTATE_DISABLED);return b.call(r,k,CKEDITOR.TRISTATE_OFF);}else{var q=parseInt(n.getStyle(r.indentCssProperty),10);if(isNaN(q))q=0;if(q<=0)return b.call(r,k,CKEDITOR.TRISTATE_DISABLED);return b.call(r,k,CKEDITOR.TRISTATE_OFF);}};function d(g,h,i){var j=h.startContainer,k=h.endContainer;while(j&&!j.getParent().equals(i))j=j.getParent();while(k&&!k.getParent().equals(i))k=k.getParent();if(!j||!k)return;var l=j,m=[],n=false;while(!n){if(l.equals(k))n=true;m.push(l);l=l.getNext();}if(m.length<1)return;var o=i.getParents(true);for(var p=0;p<o.length;p++)if(o[p].getName&&a[o[p].getName()]){i=o[p];break;}var q=this.name=='indent'?1:-1,r=m[0],s=m[m.length-1],t={},u=CKEDITOR.plugins.list.listToArray(i,t),v=u[s.getCustomData('listarray_index')].indent;for(p=r.getCustomData('listarray_index');p<=s.getCustomData('listarray_index');p++)u[p].indent+=q;for(p=s.getCustomData('listarray_index')+1;p<u.length&&u[p].indent>v;p++)u[p].indent+=q;var w=CKEDITOR.plugins.list.arrayToList(u,t,null,g.config.enterMode,0);if(this.name=='outdent'){var x;if((x=i.getParent())&&(x.is('li'))){var y=w.listNode.getChildren(),z=[],A=y.count(),B;for(p=A-1;p>=0;p--)if((B=y.getItem(p))&&(B.is&&B.is('li')))z.push(B);}}if(w)w.listNode.replace(i);if(z&&z.length)for(p=0;p<z.length;p++){var C=z[p],D=C;while((D=D.getNext())&&(D.is&&D.getName() in a))C.append(D);C.insertAfter(x);}CKEDITOR.dom.element.clearAllMarkers(t);};function e(g,h){var p=this;var i=h.createIterator(),j=g.config.enterMode;i.enforceRealBlocks=true;i.enlargeBr=j!=CKEDITOR.ENTER_BR;var k;while(k=i.getNextParagraph())if(p.useIndentClasses){var l=k.$.className.match(p.classNameRegex),m=0; if(l){l=l[1];m=p.indentClassMap[l];}if(p.name=='outdent')m--;else m++;m=Math.min(m,g.config.indentClasses.length);m=Math.max(m,0);var n=CKEDITOR.tools.ltrim(k.$.className.replace(p.classNameRegex,''));if(m<1)k.$.className=n;else k.addClass(g.config.indentClasses[m-1]);}else{var o=parseInt(k.getStyle(p.indentCssProperty),10);if(isNaN(o))o=0;o+=(p.name=='indent'?1:-1)*(g.config.indentOffset);o=Math.max(o,0);o=Math.ceil(o/g.config.indentOffset)*g.config.indentOffset;k.setStyle(p.indentCssProperty,o?o+g.config.indentUnit:'');if(k.getAttribute('style')==='')k.removeAttribute('style');}};function f(g,h){var j=this;j.name=h;j.useIndentClasses=g.config.indentClasses&&g.config.indentClasses.length>0;if(j.useIndentClasses){j.classNameRegex=new RegExp('(?:^|\\s+)('+g.config.indentClasses.join('|')+')(?=$|\\s)');j.indentClassMap={};for(var i=0;i<g.config.indentClasses.length;i++)j.indentClassMap[g.config.indentClasses[i]]=i+1;}else j.indentCssProperty=g.config.contentsLangDirection=='ltr'?'margin-left':'margin-right';};f.prototype={exec:function(g){var h=g.getSelection(),i=h&&h.getRanges()[0];if(!h||!i)return;var j=h.createBookmarks(true),k=i.getCommonAncestor();while(k&&!(k.type==CKEDITOR.NODE_ELEMENT&&a[k.getName()]))k=k.getParent();if(k)d.call(this,g,i,k);else e.call(this,g,i);g.focus();g.forceNextSelectionCheck();h.selectBookmarks(j);}};CKEDITOR.plugins.add('indent',{init:function(g){var h=new f(g,'indent'),i=new f(g,'outdent');g.addCommand('indent',h);g.addCommand('outdent',i);g.ui.addButton('Indent',{label:g.lang.indent,command:'indent'});g.ui.addButton('Outdent',{label:g.lang.outdent,command:'outdent'});g.on('selectionChange',CKEDITOR.tools.bind(c,h));g.on('selectionChange',CKEDITOR.tools.bind(c,i));},requires:['domiterator','list']});})();CKEDITOR.tools.extend(CKEDITOR.config,{indentOffset:40,indentUnit:'px',indentClasses:null});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/indent/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('colordialog',function(a){var b=CKEDITOR.dom.element,c=CKEDITOR.document,d=CKEDITOR.tools,e=a.lang.colordialog,f,g={type:'html',html:'&nbsp;'};function h(){c.getById(x).removeStyle('background-color');f.getContentElement('picker','selectedColor').setValue('');};function i(z){if(!(z instanceof CKEDITOR.dom.event))z=new CKEDITOR.dom.event(z);var A=z.getTarget(),B;if(A.getName()=='a'&&(B=A.getChild(0).getHtml()))f.getContentElement('picker','selectedColor').setValue(B);};function j(z){if(!(z instanceof CKEDITOR.dom.event))z=z.data;var A=z.getTarget(),B;if(A.getName()=='a'&&(B=A.getChild(0).getHtml())){c.getById(v).setStyle('background-color',B);c.getById(w).setHtml(B);}};function k(){c.getById(v).removeStyle('background-color');c.getById(w).setHtml('&nbsp;');};var l=d.addFunction(k),m=i,n=CKEDITOR.tools.addFunction(m),o=j,p=k,q=CKEDITOR.tools.addFunction(function(z){z=new CKEDITOR.dom.event(z);var A=z.getTarget(),B,C,D=z.getKeystroke(),E=a.lang.dir=='rtl';switch(D){case 38:if(B=A.getParent().getParent().getPrevious()){C=B.getChild([A.getParent().getIndex(),0]);C.focus();p(z,A);o(z,C);}z.preventDefault();break;case 40:if(B=A.getParent().getParent().getNext()){C=B.getChild([A.getParent().getIndex(),0]);if(C&&C.type==1){C.focus();p(z,A);o(z,C);}}z.preventDefault();break;case 32:m(z);z.preventDefault();break;case E?37:39:if(B=A.getParent().getNext()){C=B.getChild(0);if(C.type==1){C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);}else if(B=A.getParent().getParent().getNext()){C=B.getChild([0,0]);if(C&&C.type==1){C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);}break;case E?39:37:if(B=A.getParent().getPrevious()){C=B.getChild(0);C.focus();p(z,A);o(z,C);z.preventDefault(true);}else if(B=A.getParent().getParent().getPrevious()){C=B.getLast().getChild(0);C.focus();p(z,A);o(z,C);z.preventDefault(true);}else p(null,A);break;default:return;}});function r(){var z=['00','33','66','99','cc','ff'];function A(F,G){for(var H=F;H<F+3;H++){var I=s.$.insertRow(-1);for(var J=G;J<G+3;J++)for(var K=0;K<6;K++)B(I,'#'+z[J]+z[K]+z[H]);}};function B(F,G){var H=new b(F.insertCell(-1));H.setAttribute('class','ColorCell');H.setStyle('background-color',G);H.setStyle('width','15px');H.setStyle('height','15px');var I=H.$.cellIndex+1+18*F.rowIndex;H.append(CKEDITOR.dom.element.createFromHtml('<a href="javascript: void(0);" role="option" aria-posinset="'+I+'"'+' aria-setsize="'+234+'"'+' style="cursor: pointer;display:block;width:100%;height:100% " title="'+CKEDITOR.tools.htmlEncode(G)+'"'+' onkeydown="CKEDITOR.tools.callFunction( '+q+', event, this )"'+' onclick="CKEDITOR.tools.callFunction('+n+', event, this ); return false;"'+' tabindex="-1"><span class="cke_voice_label">'+G+'</span>&nbsp;</a>',CKEDITOR.document)); };A(0,0);A(3,0);A(0,3);A(3,3);var C=s.$.insertRow(-1);for(var D=0;D<6;D++)B(C,'#'+z[D]+z[D]+z[D]);for(var E=0;E<12;E++)B(C,'#000000');};var s=new b('table');r();var t=s.getHtml(),u=function(z){return CKEDITOR.tools.getNextId()+'_'+z;},v=u('hicolor'),w=u('hicolortext'),x=u('selhicolor'),y=u('color_table_label');return{title:e.title,minWidth:360,minHeight:220,onLoad:function(){f=this;},contents:[{id:'picker',label:e.title,accessKey:'I',elements:[{type:'hbox',padding:0,widths:['70%','10%','30%'],children:[{type:'html',html:'<table role="listbox" aria-labelledby="'+y+'" onmouseout="CKEDITOR.tools.callFunction( '+l+' );">'+(!CKEDITOR.env.webkit?t:'')+'</table><span id="'+y+'" class="cke_voice_label">'+e.options+'</span>',onLoad:function(){var z=CKEDITOR.document.getById(this.domId);z.on('mouseover',j);CKEDITOR.env.webkit&&z.setHtml(t);},focus:function(){var z=this.getElement().getElementsByTag('a').getItem(0);z.focus();}},g,{type:'vbox',padding:0,widths:['70%','5%','25%'],children:[{type:'html',html:'<span>'+e.highlight+'</span>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+v+'" style="border: 1px solid; height: 74px; width: 74px;"></div>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+w+'">&nbsp;</div><span>'+e.selected+'</span>\t\t\t\t\t\t\t\t\t\t\t\t<div id="'+x+'" style="border: 1px solid; height: 20px; width: 74px;"></div>'},{type:'text',label:e.selected,labelStyle:'display:none',id:'selectedColor',style:'width: 74px',onChange:function(){try{c.getById(x).setStyle('background-color',this.getValue());}catch(z){h();}}},g,{type:'button',id:'clear',style:'margin-top: 5px',label:e.clear,onClick:h}]}]}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/colordialog/dialogs/colordialog.js
colordialog.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('paste',function(a){var b=a.lang.clipboard,c=CKEDITOR.env.isCustomDomain();function d(e){var f=new CKEDITOR.dom.document(e.document),g=f.$,h=f.getById('cke_actscrpt');h&&h.remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)f.getWindow().on('blur',function(){g.selection.empty();});f.on('keydown',function(i){var j=i.data,k=j.getKeystroke(),l;switch(k){case 27:this.hide();l=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(true);l=1;}l&&j.preventDefault();},this);a.fire('ariaWidget',new CKEDITOR.dom.element(e.frameElement));};return{title:b.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;var e='<html dir="'+a.config.contentsLangDirection+'"'+' lang="'+(a.config.contentsLanguage||a.langCode)+'">'+'<head><style>body { margin: 3px; height: 95%; } </style></head><body>'+'<script id="cke_actscrpt" type="text/javascript">'+'window.parent.CKEDITOR.tools.callFunction( '+CKEDITOR.tools.addFunction(d,this)+', this );'+'</script></body>'+'</html>',f=CKEDITOR.env.air?'javascript:void(0)':c?"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'',g=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="'+f+'"'+' role="region"'+' aria-label="'+b.pasteArea+'"'+' aria-describedby="'+this.getContentElement('general','pasteMsg').domId+'"'+' aria-multiple="true"'+'></iframe>');g.on('load',function(k){k.removeListener();var l=g.getFrameDocument();l.write(e);if(CKEDITOR.env.air)d.call(this,l.getWindow().$);},this);g.setCustomData('dialog',this);var h=this.getContentElement('general','editing_area'),i=h.getElement();i.setHtml('');i.append(g);if(CKEDITOR.env.ie){var j=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute;" role="presentation"></span>');j.on('focus',function(){g.$.contentWindow.focus();});i.append(j);h.focus=function(){j.focus();this.fire('focus');};}h.getInputElement=function(){return g;};if(CKEDITOR.env.ie){i.setStyle('display','block');i.setStyle('height',g.$.offsetHeight+2+'px');}},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true';},onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&a.lang.dir=='rtl')this.parts.contents.setStyle('overflow','hidden');},onOk:function(){var e=this.getContentElement('general','editing_area').getElement(),f=e.getElementsByTag('iframe').getItem(0),g=this.getParentEditor(),h=f.$.contentWindow.document.body.innerHTML; setTimeout(function(){g.fire('paste',{html:h});},0);},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'<div style="white-space:normal;width:340px;">'+b.securityMsg+'</div>'},{type:'html',id:'pasteMsg',html:'<div style="white-space:normal;width:340px;">'+b.pasteMsg+'</div>'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'',focus:function(){var e=this.getInputElement().$.contentWindow;setTimeout(function(){e.focus();},500);}}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/clipboard/dialogs/paste.js
paste.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('link',{init:function(a){a.addCommand('link',new CKEDITOR.dialogCommand('link'));a.addCommand('anchor',new CKEDITOR.dialogCommand('anchor'));a.addCommand('unlink',new CKEDITOR.unlinkCommand());a.ui.addButton('Link',{label:a.lang.link.toolbar,command:'link'});a.ui.addButton('Unlink',{label:a.lang.unlink,command:'unlink'});a.ui.addButton('Anchor',{label:a.lang.anchor.toolbar,command:'anchor'});CKEDITOR.dialog.add('link',this.path+'dialogs/link.js');CKEDITOR.dialog.add('anchor',this.path+'dialogs/anchor.js');a.addCss('img.cke_anchor{background-image: url('+CKEDITOR.getUrl(this.path+'images/anchor.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 18px;'+'height: 18px;'+'}\n'+'a.cke_anchor'+'{'+'background-image: url('+CKEDITOR.getUrl(this.path+'images/anchor.gif')+');'+'background-position: 0 center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'padding-left: 18px;'+'}');a.on('selectionChange',function(b){var c=a.getCommand('unlink'),d=b.data.path.lastElement.getAscendant('a',true);if(d&&d.getName()=='a'&&d.getAttribute('href'))c.setState(CKEDITOR.TRISTATE_OFF);else c.setState(CKEDITOR.TRISTATE_DISABLED);});if(a.addMenuItems)a.addMenuItems({anchor:{label:a.lang.anchor.menu,command:'anchor',group:'anchor'},link:{label:a.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:a.lang.unlink,command:'unlink',group:'link',order:5}});if(a.contextMenu)a.contextMenu.addListener(function(b,c){if(!b)return null;var d=b.is('img')&&b.getAttribute('_cke_real_element_type')=='anchor';if(!d){if(!(b=b.getAscendant('a',true)))return null;d=b.getAttribute('name')&&!b.getAttribute('href');}return d?{anchor:CKEDITOR.TRISTATE_OFF}:{link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF};});},afterInit:function(a){var b=a.dataProcessor,c=b&&b.dataFilter;if(c)c.addRules({elements:{a:function(d){var e=d.attributes;if(e.name&&!e.href)return a.createFakeParserElement(d,'cke_anchor','anchor');}}});},requires:['fakeobjects']});CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){var b=a.getSelection(),c=b.createBookmarks(),d=b.getRanges(),e,f;for(var g=0;g<d.length;g++){e=d[g].getCommonAncestor(true);f=e.getAscendant('a',true);if(!f)continue;d[g].selectNodeContents(f);}b.selectRanges(d);a.document.$.execCommand('unlink',false,null);b.selectBookmarks(c);}};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:true,linkShowTargetTab:true});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/link/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('link',function(a){var b=CKEDITOR.plugins.link,c=function(){var E=this.getDialog(),F=E.getContentElement('target','popupFeatures'),G=E.getContentElement('target','linkTargetName'),H=this.getValue();if(!F||!G)return;F=F.getElement();F.hide();G.setValue('');switch(H){case 'frame':G.setLabel(a.lang.link.targetFrameName);G.getElement().show();break;case 'popup':F.show();G.setLabel(a.lang.link.targetPopupName);G.getElement().show();break;default:G.setValue(H);G.getElement().hide();break;}},d=function(){var E=this.getDialog(),F=['urlOptions','anchorOptions','emailOptions'],G=this.getValue(),H=E.definition.getContents('upload'),I=H&&H.hidden;if(G=='url'){if(a.config.linkShowTargetTab)E.showPage('target');if(!I)E.showPage('upload');}else{E.hidePage('target');if(!I)E.hidePage('upload');}for(var J=0;J<F.length;J++){var K=E.getContentElement('info',F[J]);if(!K)continue;K=K.getElement().getParent().getParent();if(F[J]==G+'Options')K.show();else K.hide();}E.layout();},e=/^javascript:/,f=/^mailto:([^?]+)(?:\?(.+))?$/,g=/subject=([^;?:@&=$,\/]*)/,h=/body=([^;?:@&=$,\/]*)/,i=/^#(.*)$/,j=/^((?:http|https|ftp|news):\/\/)?(.*)$/,k=/^(_(?:self|top|parent|blank))$/,l=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,m=/^javascript:([^(]+)\(([^)]+)\)$/,n=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,o=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,p=function(E,F){var G=F&&(F.data('cke-saved-href')||F.getAttribute('href'))||'',H,I,J,K,L={};if(H=G.match(e))if(y=='encode')G=G.replace(l,function(ab,ac,ad){return 'mailto:'+String.fromCharCode.apply(String,ac.split(','))+(ad&&w(ad));});else if(y)G.replace(m,function(ab,ac,ad){if(ac==z.name){L.type='email';var ae=L.email={},af=/[^,\s]+/g,ag=/(^')|('$)/g,ah=ad.match(af),ai=ah.length,aj,ak;for(var al=0;al<ai;al++){ak=decodeURIComponent(w(ah[al].replace(ag,'')));aj=z.params[al].toLowerCase();ae[aj]=ak;}ae.address=[ae.name,ae.domain].join('@');}});if(!L.type)if(J=G.match(i)){L.type='anchor';L.anchor={};L.anchor.name=L.anchor.id=J[1];}else if(I=G.match(f)){var M=G.match(g),N=G.match(h);L.type='email';var O=L.email={};O.address=I[1];M&&(O.subject=decodeURIComponent(M[1]));N&&(O.body=decodeURIComponent(N[1]));}else if(G&&(K=G.match(j))){L.type='url';L.url={};L.url.protocol=K[1];L.url.url=K[2];}else L.type='url';if(F){var P=F.getAttribute('target');L.target={};L.adv={};if(!P){var Q=F.data('cke-pa-onclick')||F.getAttribute('onclick'),R=Q&&Q.match(n); if(R){L.target.type='popup';L.target.name=R[1];var S;while(S=o.exec(R[2])){if(S[2]=='yes'||S[2]=='1')L.target[S[1]]=true;else if(isFinite(S[2]))L.target[S[1]]=S[2];}}}else{var T=P.match(k);if(T)L.target.type=L.target.name=P;else{L.target.type='frame';L.target.name=P;}}var U=this,V=function(ab,ac){var ad=F.getAttribute(ac);if(ad!==null)L.adv[ab]=ad||'';};V('advId','id');V('advLangDir','dir');V('advAccessKey','accessKey');L.adv.advName=F.data('cke-saved-name')||F.getAttribute('name')||'';V('advLangCode','lang');V('advTabIndex','tabindex');V('advTitle','title');V('advContentType','type');V('advCSSClasses','class');V('advCharset','charset');V('advStyles','style');}var W=E.document.getElementsByTag('img'),X=new CKEDITOR.dom.nodeList(E.document.$.anchors),Y=L.anchors=[];for(var Z=0;Z<W.count();Z++){var aa=W.getItem(Z);if(aa.data('cke-realelement')&&aa.data('cke-real-element-type')=='anchor')Y.push(E.restoreRealElement(aa));}for(Z=0;Z<X.count();Z++)Y.push(X.getItem(Z));for(Z=0;Z<Y.length;Z++){aa=Y[Z];Y[Z]={name:aa.getAttribute('name'),id:aa.getAttribute('id')};}this._.selectedElement=F;return L;},q=function(E,F){if(F[E])this.setValue(F[E][this.id]||'');},r=function(E){return q.call(this,'target',E);},s=function(E){return q.call(this,'adv',E);},t=function(E,F){if(!F[E])F[E]={};F[E][this.id]=this.getValue()||'';},u=function(E){return t.call(this,'target',E);},v=function(E){return t.call(this,'adv',E);};function w(E){return E.replace(/\\'/g,"'");};function x(E){return E.replace(/'/g,'\\$&');};var y=a.config.emailProtection||'';if(y&&y!='encode'){var z={};y.replace(/^([^(]+)\(([^)]+)\)$/,function(E,F,G){z.name=F;z.params=[];G.replace(/[^,\s]+/g,function(H){z.params.push(H);});});}function A(E){var F,G=z.name,H=z.params,I,J;F=[G,'('];for(var K=0;K<H.length;K++){I=H[K].toLowerCase();J=E[I];K>0&&F.push(',');F.push("'",J?x(encodeURIComponent(E[I])):'',"'");}F.push(')');return F.join('');};function B(E){var F,G=E.length,H=[];for(var I=0;I<G;I++){F=E.charCodeAt(I);H.push(F);}return 'String.fromCharCode('+H.join(',')+')';};var C=a.lang.common,D=a.lang.link;return{title:D.title,minWidth:350,minHeight:230,contents:[{id:'info',label:D.info,title:D.info,elements:[{id:'linkType',type:'select',label:D.type,'default':'url',items:[[D.toUrl,'url'],[D.toAnchor,'anchor'],[D.toEmail,'email']],onChange:d,setup:function(E){if(E.type)this.setValue(E.type);},commit:function(E){E.type=this.getValue();}},{type:'vbox',id:'urlOptions',children:[{type:'hbox',widths:['25%','75%'],children:[{id:'protocol',type:'select',label:C.protocol,'default':'http://',items:[['http://‎','http://'],['https://‎','https://'],['ftp://‎','ftp://'],['news://‎','news://'],[D.other,'']],setup:function(E){if(E.url)this.setValue(E.url.protocol||''); },commit:function(E){if(!E.url)E.url={};E.url.protocol=this.getValue();}},{type:'text',id:'url',label:C.url,required:true,onLoad:function(){this.allowOnChange=true;},onKeyUp:function(){var J=this;J.allowOnChange=false;var E=J.getDialog().getContentElement('info','protocol'),F=J.getValue(),G=/^(http|https|ftp|news):\/\/(?=.)/i,H=/^((javascript:)|[#\/\.\?])/i,I=G.exec(F);if(I){J.setValue(F.substr(I[0].length));E.setValue(I[0].toLowerCase());}else if(H.test(F))E.setValue('');J.allowOnChange=true;},onChange:function(){if(this.allowOnChange)this.onKeyUp();},validate:function(){var E=this.getDialog();if(E.getContentElement('info','linkType')&&E.getValueOf('info','linkType')!='url')return true;if(this.getDialog().fakeObj)return true;var F=CKEDITOR.dialog.validate.notEmpty(D.noUrl);return F.apply(this);},setup:function(E){this.allowOnChange=false;if(E.url)this.setValue(E.url.url);this.allowOnChange=true;},commit:function(E){this.onChange();if(!E.url)E.url={};E.url.url=this.getValue();this.allowOnChange=false;}}],setup:function(E){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().show();}},{type:'button',id:'browse',hidden:'true',filebrowser:'info:url',label:C.browseServer}]},{type:'vbox',id:'anchorOptions',width:260,align:'center',padding:0,children:[{type:'fieldset',id:'selectAnchorText',label:D.selectAnchor,setup:function(E){if(E.anchors.length>0)this.getElement().show();else this.getElement().hide();},children:[{type:'hbox',id:'selectAnchor',children:[{type:'select',id:'anchorName','default':'',label:D.anchorName,style:'width: 100%;',items:[['']],setup:function(E){var H=this;H.clear();H.add('');for(var F=0;F<E.anchors.length;F++){if(E.anchors[F].name)H.add(E.anchors[F].name);}if(E.anchor)H.setValue(E.anchor.name);var G=H.getDialog().getContentElement('info','linkType');if(G&&G.getValue()=='email')H.focus();},commit:function(E){if(!E.anchor)E.anchor={};E.anchor.name=this.getValue();}},{type:'select',id:'anchorId','default':'',label:D.anchorId,style:'width: 100%;',items:[['']],setup:function(E){var G=this;G.clear();G.add('');for(var F=0;F<E.anchors.length;F++){if(E.anchors[F].id)G.add(E.anchors[F].id);}if(E.anchor)G.setValue(E.anchor.id);},commit:function(E){if(!E.anchor)E.anchor={};E.anchor.id=this.getValue();}}],setup:function(E){if(E.anchors.length>0)this.getElement().show();else this.getElement().hide();}}]},{type:'html',id:'noAnchors',style:'text-align: center;',html:'<div role="label" tabIndex="-1">'+CKEDITOR.tools.htmlEncode(D.noAnchors)+'</div>',focus:true,setup:function(E){if(E.anchors.length<1)this.getElement().show(); else this.getElement().hide();}}],setup:function(E){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}},{type:'vbox',id:'emailOptions',padding:1,children:[{type:'text',id:'emailAddress',label:D.emailAddress,required:true,validate:function(){var E=this.getDialog();if(!E.getContentElement('info','linkType')||E.getValueOf('info','linkType')!='email')return true;var F=CKEDITOR.dialog.validate.notEmpty(D.noEmail);return F.apply(this);},setup:function(E){if(E.email)this.setValue(E.email.address);var F=this.getDialog().getContentElement('info','linkType');if(F&&F.getValue()=='email')this.select();},commit:function(E){if(!E.email)E.email={};E.email.address=this.getValue();}},{type:'text',id:'emailSubject',label:D.emailSubject,setup:function(E){if(E.email)this.setValue(E.email.subject);},commit:function(E){if(!E.email)E.email={};E.email.subject=this.getValue();}},{type:'textarea',id:'emailBody',label:D.emailBody,rows:3,'default':'',setup:function(E){if(E.email)this.setValue(E.email.body);},commit:function(E){if(!E.email)E.email={};E.email.body=this.getValue();}}],setup:function(E){if(!this.getDialog().getContentElement('info','linkType'))this.getElement().hide();}}]},{id:'target',label:D.target,title:D.target,elements:[{type:'hbox',widths:['50%','50%'],children:[{type:'select',id:'linkTargetType',label:C.target,'default':'notSet',style:'width : 100%;',items:[[C.notSet,'notSet'],[D.targetFrame,'frame'],[D.targetPopup,'popup'],[C.targetNew,'_blank'],[C.targetTop,'_top'],[C.targetSelf,'_self'],[C.targetParent,'_parent']],onChange:c,setup:function(E){if(E.target)this.setValue(E.target.type||'notSet');c.call(this);},commit:function(E){if(!E.target)E.target={};E.target.type=this.getValue();}},{type:'text',id:'linkTargetName',label:D.targetFrameName,'default':'',setup:function(E){if(E.target)this.setValue(E.target.name);},commit:function(E){if(!E.target)E.target={};E.target.name=this.getValue().replace(/\W/gi,'');}}]},{type:'vbox',width:'100%',align:'center',padding:2,id:'popupFeatures',children:[{type:'fieldset',label:D.popupFeatures,children:[{type:'hbox',children:[{type:'checkbox',id:'resizable',label:D.popupResizable,setup:r,commit:u},{type:'checkbox',id:'status',label:D.popupStatusBar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'location',label:D.popupLocationBar,setup:r,commit:u},{type:'checkbox',id:'toolbar',label:D.popupToolbar,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'menubar',label:D.popupMenuBar,setup:r,commit:u},{type:'checkbox',id:'fullscreen',label:D.popupFullScreen,setup:r,commit:u}]},{type:'hbox',children:[{type:'checkbox',id:'scrollbars',label:D.popupScrollBars,setup:r,commit:u},{type:'checkbox',id:'dependent',label:D.popupDependent,setup:r,commit:u}]},{type:'hbox',children:[{type:'text',widths:['50%','50%'],labelLayout:'horizontal',label:C.width,id:'width',setup:r,commit:u},{type:'text',labelLayout:'horizontal',widths:['50%','50%'],label:D.popupLeft,id:'left',setup:r,commit:u}]},{type:'hbox',children:[{type:'text',labelLayout:'horizontal',widths:['50%','50%'],label:C.height,id:'height',setup:r,commit:u},{type:'text',labelLayout:'horizontal',label:D.popupTop,widths:['50%','50%'],id:'top',setup:r,commit:u}]}]}]}]},{id:'upload',label:D.upload,title:D.upload,hidden:true,filebrowser:'uploadButton',elements:[{type:'file',id:'upload',label:C.upload,style:'height:40px',size:29},{type:'fileButton',id:'uploadButton',label:C.uploadSubmit,filebrowser:'info:url','for':['upload','upload']}]},{id:'advanced',label:D.advanced,title:D.advanced,elements:[{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',id:'advId',label:D.id,setup:s,commit:v},{type:'select',id:'advLangDir',label:D.langDir,'default':'',style:'width:110px',items:[[C.notSet,''],[D.langDirLTR,'ltr'],[D.langDirRTL,'rtl']],setup:s,commit:v},{type:'text',id:'advAccessKey',width:'80px',label:D.acccessKey,maxLength:1,setup:s,commit:v}]},{type:'hbox',widths:['45%','35%','20%'],children:[{type:'text',label:D.name,id:'advName',setup:s,commit:v},{type:'text',label:D.langCode,id:'advLangCode',width:'110px','default':'',setup:s,commit:v},{type:'text',label:D.tabIndex,id:'advTabIndex',width:'80px',maxLength:5,setup:s,commit:v}]}]},{type:'vbox',padding:1,children:[{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:D.advisoryTitle,'default':'',id:'advTitle',setup:s,commit:v},{type:'text',label:D.advisoryContentType,'default':'',id:'advContentType',setup:s,commit:v}]},{type:'hbox',widths:['45%','55%'],children:[{type:'text',label:D.cssClasses,'default':'',id:'advCSSClasses',setup:s,commit:v},{type:'text',label:D.charset,'default':'',id:'advCharset',setup:s,commit:v}]},{type:'hbox',children:[{type:'text',label:D.styles,'default':'',id:'advStyles',setup:s,commit:v}]}]}]}],onShow:function(){var H=this; H.fakeObj=false;var E=H.getParentEditor(),F=E.getSelection(),G=null;if((G=b.getSelectedLink(E))&&G.hasAttribute('href'))F.selectElement(G);else if((G=F.getSelectedElement())&&G.is('img')&&G.data('cke-real-element-type')&&G.data('cke-real-element-type')=='anchor'){H.fakeObj=G;G=E.restoreRealElement(H.fakeObj);F.selectElement(H.fakeObj);}else G=null;H.setupContent(p.apply(H,[E,G]));},onOk:function(){var E={},F=[],G={},H=this,I=this.getParentEditor();this.commitContent(G);switch(G.type||'url'){case 'url':var J=G.url&&G.url.protocol!=undefined?G.url.protocol:'http://',K=G.url&&G.url.url||'';E['data-cke-saved-href']=K.indexOf('/')===0?K:J+K;break;case 'anchor':var L=G.anchor&&G.anchor.name,M=G.anchor&&G.anchor.id;E['data-cke-saved-href']='#'+(L||M||'');break;case 'email':var N,O=G.email,P=O.address;switch(y){case '':case 'encode':var Q=encodeURIComponent(O.subject||''),R=encodeURIComponent(O.body||''),S=[];Q&&S.push('subject='+Q);R&&S.push('body='+R);S=S.length?'?'+S.join('&'):'';if(y=='encode'){N=["javascript:void(location.href='mailto:'+",B(P)];S&&N.push("+'",x(S),"'");N.push(')');}else N=['mailto:',P,S];break;default:var T=P.split('@',2);O.name=T[0];O.domain=T[1];N=['javascript:',A(O)];}E['data-cke-saved-href']=N.join('');break;}if(G.target)if(G.target.type=='popup'){var U=["window.open(this.href, '",G.target.name||'',"', '"],V=['resizable','status','location','toolbar','menubar','fullscreen','scrollbars','dependent'],W=V.length,X=function(ai){if(G.target[ai])V.push(ai+'='+G.target[ai]);};for(var Y=0;Y<W;Y++)V[Y]=V[Y]+(G.target[V[Y]]?'=yes':'=no');X('width');X('left');X('height');X('top');U.push(V.join(','),"'); return false;");E['data-cke-pa-onclick']=U.join('');F.push('target');}else{if(G.target.type!='notSet'&&G.target.name)E.target=G.target.name;else F.push('target');F.push('data-cke-pa-onclick','onclick');}if(G.adv){var Z=function(ai,aj){var ak=G.adv[ai];if(ak)E[aj]=ak;else F.push(aj);};Z('advId','id');Z('advLangDir','dir');Z('advAccessKey','accessKey');if(G.adv.advName){E.name=E['data-cke-saved-name']=G.adv.advName;E['class']=(E['class']?E['class']+' ':'')+'cke_anchor';}else F=F.concat(['data-cke-saved-name','name']);Z('advLangCode','lang');Z('advTabIndex','tabindex');Z('advTitle','title');Z('advContentType','type');Z('advCSSClasses','class');Z('advCharset','charset');Z('advStyles','style');}E.href=E['data-cke-saved-href'];if(!this._.selectedElement){var aa=I.getSelection(),ab=aa.getRanges(true);if(ab.length==1&&ab[0].collapsed){var ac=new CKEDITOR.dom.text(G.type=='email'?G.email.address:E['data-cke-saved-href'],I.document); ab[0].insertNode(ac);ab[0].selectNodeContents(ac);aa.selectRanges(ab);}var ad=new CKEDITOR.style({element:'a',attributes:E});ad.type=CKEDITOR.STYLE_INLINE;ad.apply(I.document);}else{var ae=this._.selectedElement,af=ae.data('cke-saved-href'),ag=ae.getHtml();if(CKEDITOR.env.ie&&E.name!=ae.getAttribute('name')){var ah=new CKEDITOR.dom.element('<a name="'+CKEDITOR.tools.htmlEncode(E.name)+'">',I.document);aa=I.getSelection();ae.copyAttributes(ah,{name:1});ae.moveChildren(ah);ah.replace(ae);ae=ah;aa.selectElement(ae);}ae.setAttributes(E);ae.removeAttributes(F);if(af==ag||G.type=='email'&&ag.indexOf('@')!=-1)ae.setHtml(G.type=='email'?G.email.address:E['data-cke-saved-href']);if(ae.getAttribute('name'))ae.addClass('cke_anchor');else ae.removeClass('cke_anchor');if(this.fakeObj)I.createFakeElement(ae,'cke_anchor','anchor').replace(this.fakeObj);delete this._.selectedElement;}},onLoad:function(){if(!a.config.linkShowAdvancedTab)this.hidePage('advanced');if(!a.config.linkShowTargetTab)this.hidePage('target');},onFocus:function(){var E=this.getContentElement('info','linkType'),F;if(E&&E.getValue()=='url'){F=this.getContentElement('info','url');F.select();}}};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/link/dialogs/link.js
link.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('forms',{init:function(a){var b=a.lang;a.addCss('form{border: 1px dotted #FF0000;padding: 2px;}');var c=function(e,f,g){a.addCommand(f,new CKEDITOR.dialogCommand(f));a.ui.addButton(e,{label:b.common[e.charAt(0).toLowerCase()+e.slice(1)],command:f});CKEDITOR.dialog.add(f,g);},d=this.path+'dialogs/';c('Form','form',d+'form.js');c('Checkbox','checkbox',d+'checkbox.js');c('Radio','radio',d+'radio.js');c('TextField','textfield',d+'textfield.js');c('Textarea','textarea',d+'textarea.js');c('Select','select',d+'select.js');c('Button','button',d+'button.js');c('ImageButton','imagebutton',CKEDITOR.plugins.getPath('image')+'dialogs/image.js');c('HiddenField','hiddenfield',d+'hiddenfield.js');if(a.addMenuItems)a.addMenuItems({form:{label:b.form.menu,command:'form',group:'form'},checkbox:{label:b.checkboxAndRadio.checkboxTitle,command:'checkbox',group:'checkbox'},radio:{label:b.checkboxAndRadio.radioTitle,command:'radio',group:'radio'},textfield:{label:b.textfield.title,command:'textfield',group:'textfield'},hiddenfield:{label:b.hidden.title,command:'hiddenfield',group:'hiddenfield'},imagebutton:{label:b.image.titleButton,command:'imagebutton',group:'imagebutton'},button:{label:b.button.title,command:'button',group:'button'},select:{label:b.select.title,command:'select',group:'select'},textarea:{label:b.textarea.title,command:'textarea',group:'textarea'}});if(a.contextMenu){a.contextMenu.addListener(function(e){if(e&&e.hasAscendant('form'))return{form:CKEDITOR.TRISTATE_OFF};});a.contextMenu.addListener(function(e){if(e){var f=e.getName();if(f=='select')return{select:CKEDITOR.TRISTATE_OFF};if(f=='textarea')return{textarea:CKEDITOR.TRISTATE_OFF};if(f=='input'){var g=e.getAttribute('type');if(g=='text'||g=='password')return{textfield:CKEDITOR.TRISTATE_OFF};if(g=='button'||g=='submit'||g=='reset')return{button:CKEDITOR.TRISTATE_OFF};if(g=='checkbox')return{checkbox:CKEDITOR.TRISTATE_OFF};if(g=='radio')return{radio:CKEDITOR.TRISTATE_OFF};if(g=='image')return{imagebutton:CKEDITOR.TRISTATE_OFF};}if(f=='img'&&e.getAttribute('_cke_real_element_type')=='hiddenfield')return{hiddenfield:CKEDITOR.TRISTATE_OFF};}});}},requires:['image']});if(CKEDITOR.env.ie)CKEDITOR.dom.element.prototype.hasAttribute=function(a){var d=this;var b=d.$.attributes.getNamedItem(a);if(d.getName()=='input')switch(a){case 'class':return d.$.className.length>0;case 'checked':return!!d.$.checked;case 'value':var c=d.getAttribute('type');if(c=='checkbox'||c=='radio')return d.$.value!='on';break; default:}return!!(b&&b.specified);};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('textfield',function(a){var b={value:1,size:1,maxLength:1},c={text:1,password:1};return{title:a.lang.textfield.title,minWidth:350,minHeight:150,onShow:function(){var e=this;delete e.textField;var d=e.getParentEditor().getSelection().getSelectedElement();if(d&&d.getName()=='input'&&(c[d.getAttribute('type')]||!d.getAttribute('type'))){e.textField=d;e.setupContent(d);}},onOk:function(){var d,e=this.textField,f=!e;if(f){d=this.getParentEditor();e=d.document.createElement('input');e.setAttribute('type','text');}if(f)d.insertElement(e);this.commitContent({element:e});},onLoad:function(){var d=function(f){var g=f.hasAttribute(this.id)&&f.getAttribute(this.id);this.setValue(g||'');},e=function(f){var g=f.element,h=this.getValue();if(h)g.setAttribute(this.id,h);else g.removeAttribute(this.id);};this.foreach(function(f){if(b[f.id]){f.setup=d;f.commit=e;}});},contents:[{id:'info',label:a.lang.textfield.title,title:a.lang.textfield.title,elements:[{type:'hbox',widths:['50%','50%'],children:[{id:'_cke_saved_name',type:'text',label:a.lang.textfield.name,'default':'',accessKey:'N',setup:function(d){this.setValue(d.data('cke-saved-name')||d.getAttribute('name')||'');},commit:function(d){var e=d.element;if(this.getValue())e.data('cke-saved-name',this.getValue());else{e.data('cke-saved-name',false);e.removeAttribute('name');}}},{id:'value',type:'text',label:a.lang.textfield.value,'default':'',accessKey:'V'}]},{type:'hbox',widths:['50%','50%'],children:[{id:'size',type:'text',label:a.lang.textfield.charWidth,'default':'',accessKey:'C',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed)},{id:'maxLength',type:'text',label:a.lang.textfield.maxChars,'default':'',accessKey:'M',style:'width:50px',validate:CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed)}],onLoad:function(){if(CKEDITOR.env.ie7Compat)this.getElement().setStyle('zoom','100%');}},{id:'type',type:'select',label:a.lang.textfield.type,'default':'text',accessKey:'M',items:[[a.lang.textfield.typeText,'text'],[a.lang.textfield.typePass,'password']],setup:function(d){this.setValue(d.getAttribute('type'));},commit:function(d){var e=d.element;if(CKEDITOR.env.ie){var f=e.getAttribute('type'),g=this.getValue();if(f!=g){var h=CKEDITOR.dom.element.createFromHtml('<input type="'+g+'"></input>',a.document);e.copyAttributes(h,{type:1});h.replace(e);a.getSelection().selectElement(h);d.element=h;}}else e.setAttribute('type',this.getValue());}}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/dialogs/textfield.js
textfield.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('checkbox',function(a){return{title:a.lang.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,onShow:function(){var c=this;delete c.checkbox;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getAttribute('type')=='checkbox'){c.checkbox=b;c.setupContent(b);}},onOk:function(){var b,c=this.checkbox,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('input');c.setAttribute('type','checkbox');b.insertElement(c);}this.commitContent({element:c});},contents:[{id:'info',label:a.lang.checkboxAndRadio.checkboxTitle,title:a.lang.checkboxAndRadio.checkboxTitle,startupFocus:'txtName',elements:[{id:'txtName',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){var c=b.element;if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'txtValue',type:'text',label:a.lang.checkboxAndRadio.value,'default':'',accessKey:'V',setup:function(b){var c=b.getAttribute('value');this.setValue(CKEDITOR.env.ie&&c=='on'?'':c);},commit:function(b){var c=b.element,d=this.getValue();if(d&&!(CKEDITOR.env.ie&&d=='on'))c.setAttribute('value',d);else if(CKEDITOR.env.ie){var e=new CKEDITOR.dom.element('input',c.getDocument());c.copyAttributes(e,{value:1});e.replace(c);a.getSelection().selectElement(e);b.element=e;}else c.removeAttribute('value');}},{id:'cmbSelected',type:'checkbox',label:a.lang.checkboxAndRadio.selected,'default':'',accessKey:'S',value:'checked',setup:function(b){this.setValue(b.getAttribute('checked'));},commit:function(b){var c=b.element;if(CKEDITOR.env.ie){var d=!!c.getAttribute('checked'),e=!!this.getValue();if(d!=e){var f=CKEDITOR.dom.element.createFromHtml('<input type="checkbox"'+(e?' checked="checked"':'')+'/>',a.document);c.copyAttributes(f,{type:1,checked:1});f.replace(c);a.getSelection().selectElement(f);b.element=f;}}else{var g=this.getValue();if(g)c.setAttribute('checked','checked');else c.removeAttribute('checked');}}}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/dialogs/checkbox.js
checkbox.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('form',function(a){var b={action:1,id:1,method:1,enctype:1,target:1};return{title:a.lang.form.title,minWidth:350,minHeight:200,onShow:function(){var e=this;delete e.form;var c=e.getParentEditor().getSelection().getStartElement(),d=c&&c.getAscendant('form',true);if(d){e.form=d;e.setupContent(d);}},onOk:function(){var c,d=this.form,e=!d;if(e){c=this.getParentEditor();d=c.document.createElement('form');!CKEDITOR.env.ie&&d.append(c.document.createElement('br'));}if(e)c.insertElement(d);this.commitContent(d);},onLoad:function(){function c(e){this.setValue(e.getAttribute(this.id)||'');};function d(e){var f=this;if(f.getValue())e.setAttribute(f.id,f.getValue());else e.removeAttribute(f.id);};this.foreach(function(e){if(b[e.id]){e.setup=c;e.commit=d;}});},contents:[{id:'info',label:a.lang.form.title,title:a.lang.form.title,elements:[{id:'txtName',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(c){this.setValue(c.data('cke-saved-name')||c.getAttribute('name')||'');},commit:function(c){if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'action',type:'text',label:a.lang.form.action,'default':'',accessKey:'T'},{type:'hbox',widths:['45%','55%'],children:[{id:'id',type:'text',label:a.lang.common.id,'default':'',accessKey:'I'},{id:'enctype',type:'select',label:a.lang.form.encoding,style:'width:100%',accessKey:'E','default':'',items:[[''],['text/plain'],['multipart/form-data'],['application/x-www-form-urlencoded']]}]},{type:'hbox',widths:['45%','55%'],children:[{id:'target',type:'select',label:a.lang.common.target,style:'width:100%',accessKey:'M','default':'',items:[[a.lang.common.notSet,''],[a.lang.common.targetNew,'_blank'],[a.lang.common.targetTop,'_top'],[a.lang.common.targetSelf,'_self'],[a.lang.common.targetParent,'_parent']]},{id:'method',type:'select',label:a.lang.form.method,accessKey:'M','default':'GET',items:[['GET','get'],['POST','post']]}]}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/dialogs/form.js
form.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('select',function(a){function b(k,l,m,n,o){k=j(k);var p;if(n)p=n.createElement('OPTION');else p=document.createElement('OPTION');if(k&&p&&p.getName()=='option'){if(CKEDITOR.env.ie){if(!isNaN(parseInt(o,10)))k.$.options.add(p.$,o);else k.$.options.add(p.$);p.$.innerHTML=l.length>0?l:'';p.$.value=m;}else{if(o!==null&&o<k.getChildCount())k.getChild(o<0?0:o).insertBeforeMe(p);else k.append(p);p.setText(l.length>0?l:'');p.setValue(m);}}else return false;return p;};function c(k){k=j(k);var l=g(k);for(var m=k.getChildren().count()-1;m>=0;m--){if(k.getChild(m).$.selected)k.getChild(m).remove();}h(k,l);};function d(k,l,m,n){k=j(k);if(l<0)return false;var o=k.getChild(l);o.setText(m);o.setValue(n);return o;};function e(k){k=j(k);while(k.getChild(0)&&k.getChild(0).remove()){}};function f(k,l,m){k=j(k);var n=g(k);if(n<0)return false;var o=n+l;o=o<0?0:o;o=o>=k.getChildCount()?k.getChildCount()-1:o;if(n==o)return false;var p=k.getChild(n),q=p.getText(),r=p.getValue();p.remove();p=b(k,q,r,!m?null:m,o);h(k,o);return p;};function g(k){k=j(k);return k?k.$.selectedIndex:-1;};function h(k,l){k=j(k);if(l<0)return null;var m=k.getChildren().count();k.$.selectedIndex=l>=m?m-1:l;return k;};function i(k){k=j(k);return k?k.getChildren():false;};function j(k){if(k&&k.domId&&k.getInputElement().$)return k.getInputElement();else if(k&&k.$)return k;return false;};return{title:a.lang.select.title,minWidth:CKEDITOR.env.ie?460:395,minHeight:CKEDITOR.env.ie?320:300,onShow:function(){var n=this;delete n.selectBox;n.setupContent('clear');var k=n.getParentEditor().getSelection().getSelectedElement();if(k&&k.getName()=='select'){n.selectBox=k;n.setupContent(k.getName(),k);var l=i(k);for(var m=0;m<l.count();m++)n.setupContent('option',l.getItem(m));}},onOk:function(){var k=this.getParentEditor(),l=this.selectBox,m=!l;if(m)l=k.document.createElement('select');this.commitContent(l);if(m){k.insertElement(l);if(CKEDITOR.env.ie){var n=k.getSelection(),o=n.createBookmarks();setTimeout(function(){n.selectBookmarks(o);},0);}}},contents:[{id:'info',label:a.lang.select.selectInfo,title:a.lang.select.selectInfo,accessKey:'',elements:[{id:'txtName',type:'text',widths:['25%','75%'],labelLayout:'horizontal',label:a.lang.common.name,'default':'',accessKey:'N',align:'center',style:'width:350px',setup:function(k,l){if(k=='clear')this.setValue(this['default']||'');else if(k=='select')this.setValue(l.data('cke-saved-name')||l.getAttribute('name')||'');},commit:function(k){if(this.getValue())k.data('cke-saved-name',this.getValue()); else{k.data('cke-saved-name',false);k.removeAttribute('name');}}},{id:'txtValue',type:'text',widths:['25%','75%'],labelLayout:'horizontal',label:a.lang.select.value,style:'width:350px','default':'',className:'cke_disabled',onLoad:function(){this.getInputElement().setAttribute('readOnly',true);},setup:function(k,l){if(k=='clear')this.setValue('');else if(k=='option'&&l.getAttribute('selected'))this.setValue(l.$.value);}},{type:'hbox',widths:['175px','170px'],align:'center',children:[{id:'txtSize',type:'text',align:'center',labelLayout:'horizontal',label:a.lang.select.size,'default':'',accessKey:'S',style:'width:175px',validate:function(){var k=CKEDITOR.dialog.validate.integer(a.lang.common.validateNumberFailed);return this.getValue()===''||k.apply(this);},setup:function(k,l){if(k=='select')this.setValue(l.getAttribute('size')||'');if(CKEDITOR.env.webkit)this.getInputElement().setStyle('width','86px');},commit:function(k){if(this.getValue())k.setAttribute('size',this.getValue());else k.removeAttribute('size');}},{type:'html',html:'<span>'+CKEDITOR.tools.htmlEncode(a.lang.select.lines)+'</span>'}]},{type:'html',html:'<span>'+CKEDITOR.tools.htmlEncode(a.lang.select.opAvail)+'</span>'},{type:'hbox',widths:['115px','115px','100px'],align:'top',children:[{type:'vbox',children:[{id:'txtOptName',type:'text',label:a.lang.select.opText,style:'width:115px',setup:function(k,l){if(k=='clear')this.setValue('');}},{type:'select',id:'cmbName',label:'',title:'',size:5,style:'width:115px;height:75px',items:[],onChange:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbValue'),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=g(this);h(l,o);m.setValue(this.getValue());n.setValue(l.getValue());},setup:function(k,l){if(k=='clear')e(this);else if(k=='option')b(this,l.getText(),l.getText(),this.getDialog().getParentEditor().document);},commit:function(k){var l=this.getDialog(),m=i(this),n=i(l.getContentElement('info','cmbValue')),o=l.getContentElement('info','txtValue').getValue();e(k);for(var p=0;p<m.count();p++){var q=b(k,m.getItem(p).getValue(),n.getItem(p).getValue(),l.getParentEditor().document);if(n.getItem(p).getValue()==o){q.setAttribute('selected','selected');q.selected=true;}}}}]},{type:'vbox',children:[{id:'txtOptValue',type:'text',label:a.lang.select.opValue,style:'width:115px',setup:function(k,l){if(k=='clear')this.setValue('');}},{type:'select',id:'cmbValue',label:'',size:5,style:'width:115px;height:75px',items:[],onChange:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=g(this); h(l,o);m.setValue(l.getValue());n.setValue(this.getValue());},setup:function(k,l){var n=this;if(k=='clear')e(n);else if(k=='option'){var m=l.getValue();b(n,m,m,n.getDialog().getParentEditor().document);if(l.getAttribute('selected')=='selected')n.getDialog().getContentElement('info','txtValue').setValue(m);}}}]},{type:'vbox',padding:5,children:[{type:'button',style:'',label:a.lang.select.btnAdd,title:a.lang.select.btnAdd,style:'width:100%;',onClick:function(){var k=this.getDialog(),l=k.getParentEditor(),m=k.getContentElement('info','txtOptName'),n=k.getContentElement('info','txtOptValue'),o=k.getContentElement('info','cmbName'),p=k.getContentElement('info','cmbValue');b(o,m.getValue(),m.getValue(),k.getParentEditor().document);b(p,n.getValue(),n.getValue(),k.getParentEditor().document);m.setValue('');n.setValue('');}},{type:'button',label:a.lang.select.btnModify,title:a.lang.select.btnModify,style:'width:100%;',onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','txtOptName'),m=k.getContentElement('info','txtOptValue'),n=k.getContentElement('info','cmbName'),o=k.getContentElement('info','cmbValue'),p=g(n);if(p>=0){d(n,p,l.getValue(),l.getValue());d(o,p,m.getValue(),m.getValue());}}},{type:'button',style:'width:100%;',label:a.lang.select.btnUp,title:a.lang.select.btnUp,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue');f(l,-1,k.getParentEditor().document);f(m,-1,k.getParentEditor().document);}},{type:'button',style:'width:100%;',label:a.lang.select.btnDown,title:a.lang.select.btnDown,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue');f(l,1,k.getParentEditor().document);f(m,1,k.getParentEditor().document);}}]}]},{type:'hbox',widths:['40%','20%','40%'],children:[{type:'button',label:a.lang.select.btnSetValue,title:a.lang.select.btnSetValue,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbValue'),m=k.getContentElement('info','txtValue');m.setValue(l.getValue());}},{type:'button',label:a.lang.select.btnDelete,title:a.lang.select.btnDelete,onClick:function(){var k=this.getDialog(),l=k.getContentElement('info','cmbName'),m=k.getContentElement('info','cmbValue'),n=k.getContentElement('info','txtOptName'),o=k.getContentElement('info','txtOptValue');c(l);c(m);n.setValue('');o.setValue('');}},{id:'chkMulti',type:'checkbox',label:a.lang.select.chkMulti,'default':'',accessKey:'M',value:'checked',setup:function(k,l){if(k=='select')this.setValue(l.getAttribute('multiple')); if(CKEDITOR.env.webkit)this.getElement().getParent().setStyle('vertical-align','middle');},commit:function(k){if(this.getValue())k.setAttribute('multiple',this.getValue());else k.removeAttribute('multiple');}}]}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/dialogs/select.js
select.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add('radio',function(a){return{title:a.lang.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){var c=this;delete c.radioButton;var b=c.getParentEditor().getSelection().getSelectedElement();if(b&&b.getName()=='input'&&b.getAttribute('type')=='radio'){c.radioButton=b;c.setupContent(b);}},onOk:function(){var b,c=this.radioButton,d=!c;if(d){b=this.getParentEditor();c=b.document.createElement('input');c.setAttribute('type','radio');}if(d)b.insertElement(c);this.commitContent({element:c});},contents:[{id:'info',label:a.lang.checkboxAndRadio.radioTitle,title:a.lang.checkboxAndRadio.radioTitle,elements:[{id:'name',type:'text',label:a.lang.common.name,'default':'',accessKey:'N',setup:function(b){this.setValue(b.data('cke-saved-name')||b.getAttribute('name')||'');},commit:function(b){var c=b.element;if(this.getValue())c.data('cke-saved-name',this.getValue());else{c.data('cke-saved-name',false);c.removeAttribute('name');}}},{id:'value',type:'text',label:a.lang.checkboxAndRadio.value,'default':'',accessKey:'V',setup:function(b){this.setValue(b.getAttribute('value')||'');},commit:function(b){var c=b.element;if(this.getValue())c.setAttribute('value',this.getValue());else c.removeAttribute('value');}},{id:'checked',type:'checkbox',label:a.lang.checkboxAndRadio.selected,'default':'',accessKey:'S',value:'checked',setup:function(b){this.setValue(b.getAttribute('checked'));},commit:function(b){var c=b.element;if(!(CKEDITOR.env.ie||CKEDITOR.env.opera)){if(this.getValue())c.setAttribute('checked','checked');else c.removeAttribute('checked');}else{var d=c.getAttribute('checked'),e=!!this.getValue();if(d!=e){var f=CKEDITOR.dom.element.createFromHtml('<input type="radio"'+(e?' checked="checked"':'')+'></input>',a.document);c.copyAttributes(f,{type:1,checked:1});f.replace(c);a.getSelection().selectElement(f);b.element=f;}}}}]}]};});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/forms/dialogs/radio.js
radio.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('domiterator');(function(){var a=function(c){var d=this;if(arguments.length<1)return;d.range=c;d.forceBrBreak=false;d.enlargeBr=true;d.enforceRealBlocks=false;d._||(d._={});},b=/^[\r\n\t ]+$/;a.prototype={getNextParagraph:function(c){var D=this;var d,e,f,g,h;if(!D._.lastNode){e=D.range.clone();e.enlarge(D.forceBrBreak||!D.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);var i=new CKEDITOR.dom.walker(e),j=CKEDITOR.dom.walker.bookmark(true,true);i.evaluator=j;D._.nextNode=i.next();i=new CKEDITOR.dom.walker(e);i.evaluator=j;var k=i.previous();D._.lastNode=k.getNextSourceNode(true);if(D._.lastNode&&D._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(D._.lastNode.getText())&&D._.lastNode.getParent().isBlockBoundary()){var l=new CKEDITOR.dom.range(e.document);l.moveToPosition(D._.lastNode,CKEDITOR.POSITION_AFTER_END);if(l.checkEndOfBlock()){var m=new CKEDITOR.dom.elementPath(l.endContainer),n=m.block||m.blockLimit;D._.lastNode=n.getNextSourceNode(true);}}if(!D._.lastNode){D._.lastNode=D._.docEndMarker=e.document.createText('');D._.lastNode.insertAfter(k);}e=null;}var o=D._.nextNode;k=D._.lastNode;D._.nextNode=null;while(o){var p=false,q=o.type!=CKEDITOR.NODE_ELEMENT,r=false;if(!q){var s=o.getName();if(o.isBlockBoundary(D.forceBrBreak&&{br:1})){if(s=='br')q=true;else if(!e&&!o.getChildCount()&&s!='hr'){d=o;f=o.equals(k);break;}if(e){e.setEndAt(o,CKEDITOR.POSITION_BEFORE_START);if(s!='br')D._.nextNode=o;}p=true;}else{if(o.getFirst()){if(!e){e=new CKEDITOR.dom.range(D.range.document);e.setStartAt(o,CKEDITOR.POSITION_BEFORE_START);}o=o.getFirst();continue;}q=true;}}else if(o.type==CKEDITOR.NODE_TEXT)if(b.test(o.getText()))q=false;if(q&&!e){e=new CKEDITOR.dom.range(D.range.document);e.setStartAt(o,CKEDITOR.POSITION_BEFORE_START);}f=(!p||q)&&(o.equals(k));if(e&&!p)while(!o.getNext()&&!f){var t=o.getParent();if(t.isBlockBoundary(D.forceBrBreak&&{br:1})){p=true;f=f||t.equals(k);break;}o=t;q=true;f=o.equals(k);r=true;}if(q)e.setEndAt(o,CKEDITOR.POSITION_AFTER_END);o=o.getNextSourceNode(r,null,k);f=!o;if((p||f)&&(e)){var u=e.getBoundaryNodes(),v=new CKEDITOR.dom.elementPath(e.startContainer),w=new CKEDITOR.dom.elementPath(e.endContainer);if(u.startNode.equals(u.endNode)&&u.startNode.getParent().equals(v.blockLimit)&&u.startNode.type==CKEDITOR.NODE_ELEMENT&&u.startNode.getAttribute('_fck_bookmark')){e=null;D._.nextNode=null;}else break;}if(f)break;}if(!d){if(!e){D._.docEndMarker&&D._.docEndMarker.remove();D._.nextNode=null; return null;}v=new CKEDITOR.dom.elementPath(e.startContainer);var x=v.blockLimit,y={div:1,th:1,td:1};d=v.block;if(!d&&!D.enforceRealBlocks&&y[x.getName()]&&e.checkStartOfBlock()&&e.checkEndOfBlock())d=x;else if(!d||D.enforceRealBlocks&&d.getName()=='li'){d=D.range.document.createElement(c||'p');e.extractContents().appendTo(d);d.trim();e.insertNode(d);g=h=true;}else if(d.getName()!='li'){if(!e.checkStartOfBlock()||!e.checkEndOfBlock()){d=d.clone(false);e.extractContents().appendTo(d);d.trim();var z=e.splitBlock();g=!z.wasStartOfBlock;h=!z.wasEndOfBlock;e.insertNode(d);}}else if(!f)D._.nextNode=d.equals(k)?null:e.getBoundaryNodes().endNode.getNextSourceNode(true,null,k);}if(g){var A=d.getPrevious();if(A&&A.type==CKEDITOR.NODE_ELEMENT)if(A.getName()=='br')A.remove();else if(A.getLast()&&A.getLast().$.nodeName.toLowerCase()=='br')A.getLast().remove();}if(h){var B=CKEDITOR.dom.walker.bookmark(false,true),C=d.getLast();if(C&&C.type==CKEDITOR.NODE_ELEMENT&&C.getName()=='br')if(CKEDITOR.env.ie||C.getPrevious(B)||C.getNext(B))C.remove();}if(!D._.nextNode)D._.nextNode=f||d.equals(k)?null:d.getNextSourceNode(true,null,k);return d;}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this);};})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/domiterator/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add('sourcearea',{requires:['editingblock'],init:function(a){var b=CKEDITOR.plugins.sourcearea;a.on('editingBlockReady',function(){var c,d;a.addMode('source',{load:function(e,f){if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)e.setStyle('position','relative');a.textarea=c=new CKEDITOR.dom.element('textarea');c.setAttributes({dir:'ltr',tabIndex:-1});c.addClass('cke_source');c.addClass('cke_enable_context_menu');var g={width:CKEDITOR.env.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(CKEDITOR.env.ie){if(!CKEDITOR.env.ie8Compat){d=function(){c.hide();c.setStyle('height',e.$.clientHeight+'px');c.show();};a.on('resize',d);a.on('afterCommandExec',function(i){if(i.data.name=='toolbarCollapse')d();});g.height=e.$.clientHeight+'px';}}else c.on('mousedown',function(i){i.data.stopPropagation();});e.setHtml('');e.append(c);c.setStyles(g);c.on('blur',function(){a.focusManager.blur();});c.on('focus',function(){a.focusManager.focus();});a.mayBeDirty=true;this.loadData(f);var h=a.keystrokeHandler;if(h)h.attach(c);setTimeout(function(){a.mode='source';a.fire('mode');},CKEDITOR.env.gecko||CKEDITOR.env.webkit?100:0);},loadData:function(e){c.setValue(e);a.fire('dataReady');},getData:function(){return c.getValue();},getSnapshotData:function(){return c.getValue();},unload:function(e){a.textarea=c=null;if(d)a.removeListener('resize',d);if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)e.removeStyle('position');},focus:function(){c.focus();}});});a.addCommand('source',b.commands.source);if(a.ui.addButton)a.ui.addButton('Source',{label:a.lang.source,command:'source'});a.on('mode',function(){a.getCommand('source').setState(a.mode=='source'?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);});}});CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},exec:function(a){if(a.mode=='wysiwyg')a.fire('saveSnapshot');a.getCommand('source').setState(CKEDITOR.TRISTATE_DISABLED);a.setMode(a.mode=='source'?'wysiwyg':'source');},canUndo:false}}};
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/sourcearea/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function a(e,f){var g=f.block||f.blockLimit;if(!g||g.getName()=='body')return CKEDITOR.TRISTATE_OFF;if(g.getAscendant('blockquote',true))return CKEDITOR.TRISTATE_ON;return CKEDITOR.TRISTATE_OFF;};function b(e){var f=e.editor,g=f.getCommand('blockquote');g.state=a(f,e.data.path);g.fire('state');};function c(e){for(var f=0,g=e.getChildCount(),h;f<g&&(h=e.getChild(f));f++)if(h.type==CKEDITOR.NODE_ELEMENT&&h.isBlockBoundary())return false;return true;};var d={exec:function(e){var f=e.getCommand('blockquote').state,g=e.getSelection(),h=g&&g.getRanges()[0];if(!h)return;var i=g.createBookmarks();if(CKEDITOR.env.ie){var j=i[0].startNode,k=i[0].endNode,l;if(j&&j.getParent().getName()=='blockquote'){l=j;while(l=l.getNext())if(l.type==CKEDITOR.NODE_ELEMENT&&l.isBlockBoundary()){j.move(l,true);break;}}if(k&&k.getParent().getName()=='blockquote'){l=k;while(l=l.getPrevious())if(l.type==CKEDITOR.NODE_ELEMENT&&l.isBlockBoundary()){k.move(l);break;}}}var m=h.createIterator(),n;if(f==CKEDITOR.TRISTATE_OFF){var o=[];while(n=m.getNextParagraph())o.push(n);if(o.length<1){var p=e.document.createElement(e.config.enterMode==CKEDITOR.ENTER_P?'p':'div'),q=i.shift();h.insertNode(p);p.append(new CKEDITOR.dom.text('',e.document));h.moveToBookmark(q);h.selectNodeContents(p);h.collapse(true);q=h.createBookmark();o.push(p);i.unshift(q);}var r=o[0].getParent(),s=[];for(var t=0;t<o.length;t++){n=o[t];r=r.getCommonAncestor(n.getParent());}var u={table:1,tbody:1,tr:1,ol:1,ul:1};while(u[r.getName()])r=r.getParent();var v=null;while(o.length>0){n=o.shift();while(!n.getParent().equals(r))n=n.getParent();if(!n.equals(v))s.push(n);v=n;}while(s.length>0){n=s.shift();if(n.getName()=='blockquote'){var w=new CKEDITOR.dom.documentFragment(e.document);while(n.getFirst()){w.append(n.getFirst().remove());o.push(w.getLast());}w.replace(n);}else o.push(n);}var x=e.document.createElement('blockquote');x.insertBefore(o[0]);while(o.length>0){n=o.shift();x.append(n);}}else if(f==CKEDITOR.TRISTATE_ON){var y=[],z={};while(n=m.getNextParagraph()){var A=null,B=null;while(n.getParent()){if(n.getParent().getName()=='blockquote'){A=n.getParent();B=n;break;}n=n.getParent();}if(A&&B&&!B.getCustomData('blockquote_moveout')){y.push(B);CKEDITOR.dom.element.setMarker(z,B,'blockquote_moveout',true);}}CKEDITOR.dom.element.clearAllMarkers(z);var C=[],D=[];z={};while(y.length>0){var E=y.shift();x=E.getParent();if(!E.getPrevious())E.remove().insertBefore(x);else if(!E.getNext())E.remove().insertAfter(x);else{E.breakParent(E.getParent()); D.push(E.getNext());}if(!x.getCustomData('blockquote_processed')){D.push(x);CKEDITOR.dom.element.setMarker(z,x,'blockquote_processed',true);}C.push(E);}CKEDITOR.dom.element.clearAllMarkers(z);for(t=D.length-1;t>=0;t--){x=D[t];if(c(x))x.remove();}if(e.config.enterMode==CKEDITOR.ENTER_BR){var F=true;while(C.length){E=C.shift();if(E.getName()=='div'){w=new CKEDITOR.dom.documentFragment(e.document);var G=F&&E.getPrevious()&&!(E.getPrevious().type==CKEDITOR.NODE_ELEMENT&&E.getPrevious().isBlockBoundary());if(G)w.append(e.document.createElement('br'));var H=E.getNext()&&!(E.getNext().type==CKEDITOR.NODE_ELEMENT&&E.getNext().isBlockBoundary());while(E.getFirst())E.getFirst().remove().appendTo(w);if(H)w.append(e.document.createElement('br'));w.replace(E);F=false;}}}}g.selectBookmarks(i);e.focus();}};CKEDITOR.plugins.add('blockquote',{init:function(e){e.addCommand('blockquote',d);e.ui.addButton('Blockquote',{label:e.lang.blockquote,command:'blockquote'});e.on('selectionChange',b);},requires:['domiterator']});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/blockquote/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=CKEDITOR.document;CKEDITOR.dialog.add('templates',function(b){function c(k,l){k.setHtml('');for(var m=0,n=l.length;m<n;m++){var o=CKEDITOR.getTemplates(l[m]),p=o.imagesPath,q=o.templates,r=q.length;for(var s=0;s<r;s++){var t=q[s],u=d(t,p);u.setAttribute('aria-posinset',s+1);u.setAttribute('aria-setsize',r);k.append(u);}}};function d(k,l){var m=CKEDITOR.dom.element.createFromHtml('<a href="javascript:void(0)" tabIndex="-1" role="option" ><div class="cke_tpl_item"></div></a>'),n='<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';if(k.image&&l)n+='<td class="cke_tpl_preview_img"><img src="'+CKEDITOR.getUrl(l+k.image)+'"'+(CKEDITOR.env.ie6Compat?' onload="this.width=this.width"':'')+' alt="" title=""></td>';n+='<td style="white-space:normal;"><span class="cke_tpl_title">'+k.title+'</span><br/>';if(k.description)n+='<span>'+k.description+'</span>';n+='</td></tr></table>';m.getFirst().setHtml(n);m.on('click',function(){e(k.html);});return m;};function e(k){var l=CKEDITOR.dialog.getCurrent(),m=l.getValueOf('selectTpl','chkInsertOpt');if(m){b.on('contentDom',function(n){n.removeListener();l.hide();var o=new CKEDITOR.dom.range(b.document);o.moveToElementEditStart(b.document.getBody());o.select(1);setTimeout(function(){b.fire('saveSnapshot');},0);});b.fire('saveSnapshot');b.setData(k);}else{b.insertHtml(k);l.hide();}};function f(k){var l=k.data.getTarget(),m=g.equals(l);if(m||g.contains(l)){var n=k.data.getKeystroke(),o=g.getElementsByTag('a'),p;if(o){if(m)p=o.getItem(0);else switch(n){case 40:p=l.getNext();break;case 38:p=l.getPrevious();break;case 13:case 32:l.fire('click');}if(p){p.focus();k.data.preventDefault();}}}};CKEDITOR.skins.load(b,'templates');var g,h='cke_tpl_list_label_'+CKEDITOR.tools.getNextNumber(),i=b.lang.templates,j=b.config;return{title:b.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:'selectTpl',label:i.title,elements:[{type:'vbox',padding:5,children:[{type:'html',html:'<span>'+i.selectPromptMsg+'</span>'},{id:'templatesList',type:'html',focus:true,html:'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="'+h+'">'+'<div class="cke_tpl_loading"><span></span></div>'+'</div>'+'<span class="cke_voice_label" id="'+h+'">'+i.options+'</span>'},{id:'chkInsertOpt',type:'checkbox',label:i.insertOption,'default':j.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var k=this.getContentElement('selectTpl','templatesList'); g=k.getElement();CKEDITOR.loadTemplates(j.templates_files,function(){var l=(j.templates||'default').split(',');if(l.length){c(g,l);k.focus();}else g.setHtml('<div class="cke_tpl_empty"><span>'+i.emptyListMsg+'</span>'+'</div>');});this._.element.on('keydown',f);},onHide:function(){this._.element.removeListener('keydown',f);}};});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/templates/dialogs/templates.js
templates.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a=CKEDITOR.tools.cssLength,b=CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks||CKEDITOR.env.version<7);function c(k){return CKEDITOR.env.ie?k.$.clientWidth:parseInt(k.getComputedStyle('width'),10);};function d(k,l){var m=k.getComputedStyle('border-'+l+'-width'),n={thin:'0px',medium:'1px',thick:'2px'};if(m.indexOf('px')<0)if(m in n&&k.getComputedStyle('border-style')!='none')m=n[m];else m=0;return parseInt(m,10);};function e(k){var l=k.$.rows,m=0,n,o,p;for(var q=0,r=l.length;q<r;q++){p=l[q];n=p.cells.length;if(n>m){m=n;o=p;}}return o;};function f(k){var l=[],m=-1,n=k.getComputedStyle('direction')=='rtl',o=e(k),p=new CKEDITOR.dom.element(k.$.tBodies[0]),q=p.getDocumentPosition();for(var r=0,s=o.cells.length;r<s;r++){var t=new CKEDITOR.dom.element(o.cells[r]),u=o.cells[r+1]&&new CKEDITOR.dom.element(o.cells[r+1]);m+=t.$.colSpan||1;var v,w,x,y,z=t.getDocumentPosition().x;n?w=z+d(t,'left'):v=z+t.$.offsetWidth-d(t,'right');if(u){z=u.getDocumentPosition().x;n?v=z+u.$.offsetWidth-d(u,'right'):w=z+d(u,'left');}else{z=k.getDocumentPosition().x;n?v=z:w=z+k.$.offsetWidth;}x=Math.max(w-v,3);y=Math.max(Math.round(7-x/2),0);l.push({table:k,index:m,x:v,y:q.y,width:x,height:p.$.offsetHeight,padding:y,rtl:n});}return l;};function g(k,l){for(var m=0,n=k.length;m<n;m++){var o=k[m],p=o.padding;if(l>=o.x-p&&l<=o.x+o.width+p)return o;}return null;};function h(k){(k.data||k).preventDefault();};function i(k){var l,m,n,o,p,q,r,s,t,u;function v(){l=null;q=0;o=0;m.removeListener('mouseup',A);n.removeListener('mousedown',z);n.removeListener('mousemove',B);m.getBody().setStyle('cursor','auto');b?n.remove():n.hide();};function w(){var D=l.index,E=CKEDITOR.tools.buildTableMap(l.table),F=[],G=[],H=Number.MAX_VALUE,I=H,J=l.rtl;for(var K=0,L=E.length;K<L;K++){var M=E[K],N=M[D+(J?1:0)],O=M[D+(J?0:1)];N=N&&new CKEDITOR.dom.element(N);O=O&&new CKEDITOR.dom.element(O);if(!N||!O||!N.equals(O)){N&&(H=Math.min(H,c(N)));O&&(I=Math.min(I,c(O)));F.push(N);G.push(O);}}r=F;s=G;t=l.x-H;u=l.x+I;n.setOpacity(0.5);p=parseInt(n.getStyle('left'),10);q=0;o=1;n.on('mousemove',B);m.on('dragstart',h);};function x(){o=0;n.setOpacity(0);q&&y();var D=l.table;setTimeout(function(){D.removeCustomData('_cke_table_pillars');},0);m.removeListener('dragstart',h);};function y(){var D=l.rtl,E=D?s.length:r.length;for(var F=0;F<E;F++){var G=r[F],H=s[F],I=l.table;CKEDITOR.tools.setTimeout(function(J,K,L,M,N,O){J&&J.setStyle('width',a(Math.max(K+O,0)));L&&L.setStyle('width',a(Math.max(M-O,0)));if(N)I.setStyle('width',a(N+O*(D?-1:1))); },0,this,[G,G&&c(G),H,H&&c(H),(!G||!H)&&c(I)+d(I,'left')+d(I,'right'),q]);}};function z(D){h(D);w();m.on('mouseup',A,this);};function A(D){D.removeListener();x();};function B(D){C(D.data.$.clientX);};m=k.document;n=CKEDITOR.dom.element.createFromHtml('<div data-cke-temp=1 contenteditable=false unselectable=on style="position:absolute;cursor:col-resize;filter:alpha(opacity=0);opacity:0;padding:0;background-color:#004;background-image:none;border:0px none;z-index:10"></div>',m);if(!b)m.getDocumentElement().append(n);this.attachTo=function(D){if(o)return;if(b){m.getBody().append(n);q=0;}l=D;n.setStyles({width:a(D.width),height:a(D.height),left:a(D.x),top:a(D.y)});b&&n.setOpacity(0.25);n.on('mousedown',z,this);m.getBody().setStyle('cursor','col-resize');n.show();};var C=this.move=function(D){if(!l)return 0;var E=l.padding;if(!o&&(D<l.x-E||D>l.x+l.width+E)){v();return 0;}var F=D-Math.round(n.$.offsetWidth/2);if(o){if(F==t||F==u)return 1;F=Math.max(F,t);F=Math.min(F,u);q=F-p;}n.setStyle('left',a(F));return 1;};};function j(k){var l=k.data.getTarget();if(k.name=='mouseout'){if(!l.is('table'))return;var m=new CKEDITOR.dom.element(k.data.$.relatedTarget||k.data.$.toElement);while(m&&m.$&&!m.equals(l)&&!m.is('body'))m=m.getParent();if(!m||m.equals(l))return;}l.getAscendant('table',1).removeCustomData('_cke_table_pillars');k.removeListener();};CKEDITOR.plugins.add('tableresize',{requires:['tabletools'],init:function(k){k.on('contentDom',function(){var l;k.document.getBody().on('mousemove',function(m){m=m.data;if(l&&l.move(m.$.clientX)){h(m);return;}var n=m.getTarget(),o,p;if(!n.is('table')&&!n.getAscendant('tbody',1))return;o=n.getAscendant('table',1);if(!(p=o.getCustomData('_cke_table_pillars'))){o.setCustomData('_cke_table_pillars',p=f(o));o.on('mouseout',j);o.on('mousedown',j);}var q=g(p,m.$.clientX);if(q){!l&&(l=new i(k));l.attachTo(q);}});});}});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/tableresize/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a='nbsp,gt,lt,quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',b='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',c='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv';function d(e){var f={},g=[],h={nbsp:'\xa0',shy:'­',gt:'>',lt:'<'};e=e.replace(/\b(nbsp|shy|gt|lt|amp)(?:,|$)/g,function(m,n){f[h[n]]='&'+n+';';g.push(h[n]);return '';});e=e.split(',');var i=document.createElement('div'),j;i.innerHTML='&'+e.join(';&')+';';j=i.innerHTML;i=null;for(var k=0;k<j.length;k++){var l=j.charAt(k);f[l]='&'+e[k]+';';g.push(l);}f.regex=g.join('');return f;};CKEDITOR.plugins.add('entities',{afterInit:function(e){var f=e.config;if(!f.entities)return;var g=e.dataProcessor,h=g&&g.htmlFilter;if(h){var i=a;if(f.entities_latin)i+=','+b;if(f.entities_greek)i+=','+c;if(f.entities_additional)i+=','+f.entities_additional;var j=d(i),k='['+j.regex+']';delete j.regex;if(f.entities_processNumerical)k='[^ -~]|'+k;k=new RegExp(k,'g');function l(m){return j[m]||'&#'+m.charCodeAt(0)+';';};h.addRules({text:function(m){return m.replace(k,l);}});}}});})();CKEDITOR.config.entities=true;CKEDITOR.config.entities_latin=true;CKEDITOR.config.entities_greek=true;CKEDITOR.config.entities_processNumerical=false;CKEDITOR.config.entities_additional='#39';
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/entities/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a;function b(i){return i.type==CKEDITOR.NODE_TEXT&&i.getLength()>0&&(!a||!i.isReadOnly());};function c(i){return!(i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary(CKEDITOR.tools.extend({},CKEDITOR.dtd.$empty,CKEDITOR.dtd.$nonEditable)));};var d=function(){var i=this;return{textNode:i.textNode,offset:i.offset,character:i.textNode?i.textNode.getText().charAt(i.offset):null,hitMatchBoundary:i._.matchBoundary};},e=['find','replace'],f=[['txtFindFind','txtFindReplace'],['txtFindCaseChk','txtReplaceCaseChk'],['txtFindWordChk','txtReplaceWordChk'],['txtFindCyclic','txtReplaceCyclic']];function g(i){var j,k,l,m;j=i==='find'?1:0;k=1-j;var n,o=f.length;for(n=0;n<o;n++){l=this.getContentElement(e[j],f[n][j]);m=this.getContentElement(e[k],f[n][k]);m.setValue(l.getValue());}};var h=function(i,j){var k=new CKEDITOR.style(CKEDITOR.tools.extend({fullMatch:true,childRule:function(){return 0;}},i.config.find_highlight)),l=function(y,z){var A=this,B=new CKEDITOR.dom.walker(y);B.guard=z?c:function(C){!c(C)&&(A._.matchBoundary=true);};B.evaluator=b;B.breakOnFalse=1;if(y.startContainer.type==CKEDITOR.NODE_TEXT){this.textNode=y.startContainer;this.offset=y.startOffset-1;}this._={matchWord:z,walker:B,matchBoundary:false};};l.prototype={next:function(){return this.move();},back:function(){return this.move(true);},move:function(y){var A=this;var z=A.textNode;if(z===null)return d.call(A);A._.matchBoundary=false;if(z&&y&&A.offset>0){A.offset--;return d.call(A);}else if(z&&A.offset<z.getLength()-1){A.offset++;return d.call(A);}else{z=null;while(!z){z=A._.walker[y?'previous':'next'].call(A._.walker);if(A._.matchWord&&!z||A._.walker._.end)break;}A.textNode=z;if(z)A.offset=y?z.getLength()-1:0;else A.offset=0;}return d.call(A);}};var m=function(y,z){this._={walker:y,cursors:[],rangeLength:z,highlightRange:null,isMatched:0};};m.prototype={toDomRange:function(){var y=new CKEDITOR.dom.range(i.document),z=this._.cursors;if(z.length<1){var A=this._.walker.textNode;if(A)y.setStartAfter(A);else return null;}else{var B=z[0],C=z[z.length-1];y.setStart(B.textNode,B.offset);y.setEnd(C.textNode,C.offset+1);}return y;},updateFromDomRange:function(y){var B=this;var z,A=new l(y);B._.cursors=[];do{z=A.next();if(z.character)B._.cursors.push(z);}while(z.character);B._.rangeLength=B._.cursors.length;},setMatched:function(){this._.isMatched=true;},clearMatched:function(){this._.isMatched=false;},isMatched:function(){return this._.isMatched;},highlight:function(){var B=this;if(B._.cursors.length<1)return; if(B._.highlightRange)B.removeHighlight();var y=B.toDomRange(),z=y.createBookmark();k.applyToRange(y);y.moveToBookmark(z);B._.highlightRange=y;var A=y.startContainer;if(A.type!=CKEDITOR.NODE_ELEMENT)A=A.getParent();A.scrollIntoView();B.updateFromDomRange(y);},removeHighlight:function(){var z=this;if(!z._.highlightRange)return;var y=z._.highlightRange.createBookmark();k.removeFromRange(z._.highlightRange);z._.highlightRange.moveToBookmark(y);z.updateFromDomRange(z._.highlightRange);z._.highlightRange=null;},isReadOnly:function(){if(!this._.highlightRange)return 0;return this._.highlightRange.startContainer.isReadOnly();},moveBack:function(){var A=this;var y=A._.walker.back(),z=A._.cursors;if(y.hitMatchBoundary)A._.cursors=z=[];z.unshift(y);if(z.length>A._.rangeLength)z.pop();return y;},moveNext:function(){var A=this;var y=A._.walker.next(),z=A._.cursors;if(y.hitMatchBoundary)A._.cursors=z=[];z.push(y);if(z.length>A._.rangeLength)z.shift();return y;},getEndCharacter:function(){var y=this._.cursors;if(y.length<1)return null;return y[y.length-1].character;},getNextCharacterRange:function(y){var z,A,B=this._.cursors;if((z=B[B.length-1])&&z.textNode)A=new l(n(z));else A=this._.walker;return new m(A,y);},getCursors:function(){return this._.cursors;}};function n(y,z){var A=new CKEDITOR.dom.range();A.setStart(y.textNode,z?y.offset:y.offset+1);A.setEndAt(i.document.getBody(),CKEDITOR.POSITION_BEFORE_END);return A;};function o(y){var z=new CKEDITOR.dom.range();z.setStartAt(i.document.getBody(),CKEDITOR.POSITION_AFTER_START);z.setEnd(y.textNode,y.offset);return z;};var p=0,q=1,r=2,s=function(y,z){var A=[-1];if(z)y=y.toLowerCase();for(var B=0;B<y.length;B++){A.push(A[B]+1);while(A[B+1]>0&&y.charAt(B)!=y.charAt(A[B+1]-1))A[B+1]=A[A[B+1]-1]+1;}this._={overlap:A,state:0,ignoreCase:!!z,pattern:y};};s.prototype={feedCharacter:function(y){var z=this;if(z._.ignoreCase)y=y.toLowerCase();for(;;){if(y==z._.pattern.charAt(z._.state)){z._.state++;if(z._.state==z._.pattern.length){z._.state=0;return r;}return q;}else if(!z._.state)return p;else z._.state=z._.overlap[z._.state];}return null;},reset:function(){this._.state=0;}};var t=/[.,"'?!;: \u0085\u00a0\u1680\u280e\u2028\u2029\u202f\u205f\u3000]/,u=function(y){if(!y)return true;var z=y.charCodeAt(0);return z>=9&&z<=13||z>=8192&&z<=8202||t.test(y);},v={searchRange:null,matchRange:null,find:function(y,z,A,B,C,D){var M=this;if(!M.matchRange)M.matchRange=new m(new l(M.searchRange),y.length);else{M.matchRange.removeHighlight();M.matchRange=M.matchRange.getNextCharacterRange(y.length); }var E=new s(y,!z),F=p,G='%';while(G!==null){M.matchRange.moveNext();while(G=M.matchRange.getEndCharacter()){F=E.feedCharacter(G);if(F==r)break;if(M.matchRange.moveNext().hitMatchBoundary)E.reset();}if(F==r){if(A){var H=M.matchRange.getCursors(),I=H[H.length-1],J=H[0],K=new l(o(J),true),L=new l(n(I),true);if(!(u(K.back().character)&&u(L.next().character)))continue;}M.matchRange.setMatched();if(C!==false)M.matchRange.highlight();return true;}}M.matchRange.clearMatched();M.matchRange.removeHighlight();if(B&&!D){M.searchRange=w(1);M.matchRange=null;return arguments.callee.apply(M,Array.prototype.slice.call(arguments).concat([true]));}return false;},replaceCounter:0,replace:function(y,z,A,B,C,D,E){var J=this;a=1;var F=0;if(J.matchRange&&J.matchRange.isMatched()&&!J.matchRange._.isReplaced&&!J.matchRange.isReadOnly()){J.matchRange.removeHighlight();var G=J.matchRange.toDomRange(),H=i.document.createText(A);if(!E){var I=i.getSelection();I.selectRanges([G]);i.fire('saveSnapshot');}G.deleteContents();G.insertNode(H);if(!E){I.selectRanges([G]);i.fire('saveSnapshot');}J.matchRange.updateFromDomRange(G);if(!E)J.matchRange.highlight();J.matchRange._.isReplaced=true;J.replaceCounter++;F=1;}else F=J.find(z,B,C,D,!E);a=0;return F;}};function w(y){var z,A=i.getSelection(),B=i.document.getBody();if(A&&!y){z=A.getRanges()[0].clone();z.collapse(true);}else{z=new CKEDITOR.dom.range();z.setStartAt(B,CKEDITOR.POSITION_AFTER_START);}z.setEndAt(B,CKEDITOR.POSITION_BEFORE_END);return z;};var x=i.lang.findAndReplace;return{title:x.title,resizable:CKEDITOR.DIALOG_RESIZE_NONE,minWidth:350,minHeight:170,buttons:[CKEDITOR.dialog.cancelButton],contents:[{id:'find',label:x.find,title:x.find,accessKey:'',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindFind',label:x.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:x.find,onClick:function(){var y=this.getDialog();if(!v.find(y.getValueOf('find','txtFindFind'),y.getValueOf('find','txtFindCaseChk'),y.getValueOf('find','txtFindWordChk'),y.getValueOf('find','txtFindCyclic')))alert(x.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtFindCaseChk',isChanged:false,style:'margin-top:28px',label:x.matchCase},{type:'checkbox',id:'txtFindWordChk',isChanged:false,label:x.matchWord},{type:'checkbox',id:'txtFindCyclic',isChanged:false,'default':true,label:x.matchCyclic}]}]},{id:'replace',label:x.replace,accessKey:'M',elements:[{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtFindReplace',label:x.findWhat,isChanged:false,labelLayout:'horizontal',accessKey:'F'},{type:'button',align:'left',style:'width:100%',label:x.replace,onClick:function(){var y=this.getDialog(); if(!v.replace(y,y.getValueOf('replace','txtFindReplace'),y.getValueOf('replace','txtReplace'),y.getValueOf('replace','txtReplaceCaseChk'),y.getValueOf('replace','txtReplaceWordChk'),y.getValueOf('replace','txtReplaceCyclic')))alert(x.notFoundMsg);}}]},{type:'hbox',widths:['230px','90px'],children:[{type:'text',id:'txtReplace',label:x.replaceWith,isChanged:false,labelLayout:'horizontal',accessKey:'R'},{type:'button',align:'left',style:'width:100%',label:x.replaceAll,isChanged:false,onClick:function(){var y=this.getDialog(),z;v.replaceCounter=0;v.searchRange=w(1);if(v.matchRange){v.matchRange.removeHighlight();v.matchRange=null;}i.fire('saveSnapshot');while(v.replace(y,y.getValueOf('replace','txtFindReplace'),y.getValueOf('replace','txtReplace'),y.getValueOf('replace','txtReplaceCaseChk'),y.getValueOf('replace','txtReplaceWordChk'),false,true)){}if(v.replaceCounter){alert(x.replaceSuccessMsg.replace(/%1/,v.replaceCounter));i.fire('saveSnapshot');}else alert(x.notFoundMsg);}}]},{type:'vbox',padding:0,children:[{type:'checkbox',id:'txtReplaceCaseChk',isChanged:false,label:x.matchCase},{type:'checkbox',id:'txtReplaceWordChk',isChanged:false,label:x.matchWord},{type:'checkbox',id:'txtReplaceCyclic',isChanged:false,'default':true,label:x.matchCyclic}]}]}],onLoad:function(){var y=this,z,A,B=0;this.on('hide',function(){B=0;});this.on('show',function(){B=1;});this.selectPage=CKEDITOR.tools.override(this.selectPage,function(C){return function(D){C.call(y,D);var E=y._.tabs[D],F,G,H;G=D==='find'?'txtFindFind':'txtFindReplace';H=D==='find'?'txtFindWordChk':'txtReplaceWordChk';z=y.getContentElement(D,G);A=y.getContentElement(D,H);if(!E.initialized){F=CKEDITOR.document.getById(z._.inputId);E.initialized=true;}if(B)g.call(this,D);};});},onShow:function(){v.searchRange=w();this.selectPage(j);},onHide:function(){var y;if(v.matchRange&&v.matchRange.isMatched()){v.matchRange.removeHighlight();i.focus();y=v.matchRange.toDomRange();if(y)i.getSelection().selectRanges([y]);}delete v.matchRange;},onFocus:function(){if(j=='replace')return this.getContentElement('replace','txtFindReplace');else return this.getContentElement('find','txtFindFind');}};};CKEDITOR.dialog.add('find',function(i){return h(i,'find');});CKEDITOR.dialog.add('replace',function(i){return h(i,'replace');});})();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/plugins/find/dialogs/find.js
find.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'resize', { init : function( editor ) { var config = editor.config; !config.resize_dir && ( config.resize_dir = 'both' ); ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 ); ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 ); ( config.resize_minWidth == undefined ) && ( config.resize_minWidth = 750 ); ( config.resize_minHeight == undefined ) && ( config.resize_minHeight = 250 ); if ( config.resize_enabled !== false ) { var container = null, origin, startSize, resizeHorizontal = ( config.resize_dir == 'both' || config.resize_dir == 'horizontal' ) && ( config.resize_minWidth != config.resize_maxWidth ), resizeVertical = ( config.resize_dir == 'both' || config.resize_dir == 'vertical' ) && ( config.resize_minHeight != config.resize_maxHeight ); function dragHandler( evt ) { var dx = evt.data.$.screenX - origin.x, dy = evt.data.$.screenY - origin.y, width = startSize.width, height = startSize.height, internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ), internalHeight = height + dy; if ( resizeHorizontal ) width = Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ); if ( resizeVertical ) height = Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ); editor.resize( width, height ); } function dragEndHandler ( evt ) { CKEDITOR.document.removeListener( 'mousemove', dragHandler ); CKEDITOR.document.removeListener( 'mouseup', dragEndHandler ); if ( editor.document ) { editor.document.removeListener( 'mousemove', dragHandler ); editor.document.removeListener( 'mouseup', dragEndHandler ); } } var mouseDownFn = CKEDITOR.tools.addFunction( function( $event ) { if ( !container ) container = editor.getResizable(); startSize = { width : container.$.offsetWidth || 0, height : container.$.offsetHeight || 0 }; origin = { x : $event.screenX, y : $event.screenY }; config.resize_minWidth > startSize.width && ( config.resize_minWidth = startSize.width ); config.resize_minHeight > startSize.height && ( config.resize_minHeight = startSize.height ); CKEDITOR.document.on( 'mousemove', dragHandler ); CKEDITOR.document.on( 'mouseup', dragEndHandler ); if ( editor.document ) { editor.document.on( 'mousemove', dragHandler ); editor.document.on( 'mouseup', dragEndHandler ); } }); editor.on( 'destroy', function() { CKEDITOR.tools.removeFunction( mouseDownFn ); } ); editor.on( 'themeSpace', function( event ) { if ( event.data.space == 'bottom' ) { var direction = ''; if ( resizeHorizontal && !resizeVertical ) direction = ' cke_resizer_horizontal'; if ( !resizeHorizontal && resizeVertical ) direction = ' cke_resizer_vertical'; event.data.html += '<div class="cke_resizer' + direction + '"' + ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' + ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event)"' + '></div>'; } }, editor, null, 100 ); } } } ); /** * The minimum editor width, in pixels, when resizing it with the resize handle. * Note: It fallbacks to editor's actual width if that's smaller than the default value. * @name CKEDITOR.config.resize_minWidth * @type Number * @default 750 * @example * config.resize_minWidth = 500; */ /** * The minimum editor height, in pixels, when resizing it with the resize handle. * Note: It fallbacks to editor's actual height if that's smaller than the default value. * @name CKEDITOR.config.resize_minHeight * @type Number * @default 250 * @example * config.resize_minHeight = 600; */ /** * The maximum editor width, in pixels, when resizing it with the resize handle. * @name CKEDITOR.config.resize_maxWidth * @type Number * @default 3000 * @example * config.resize_maxWidth = 750; */ /** * The maximum editor height, in pixels, when resizing it with the resize handle. * @name CKEDITOR.config.resize_maxHeight * @type Number * @default 3000 * @example * config.resize_maxHeight = 600; */ /** * Whether to enable the resizing feature. If disabled the resize handler will not be visible. * @name CKEDITOR.config.resize_enabled * @type Boolean * @default true * @example * config.resize_enabled = false; */ /** * The directions to which the editor resizing is enabled. Possible values * are "both", "vertical" and "horizontal". * @name CKEDITOR.config.resize_dir * @type String * @default 'both' * @since 3.3 * @example * config.resize_dir = 'vertical'; */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/resize/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { function addCombo( editor, comboName, styleType, lang, entries, defaultLabel, styleDefinition ) { var config = editor.config; // Gets the list of fonts from the settings. var names = entries.split( ';' ), values = []; // Create style objects for all fonts. var styles = {}; for ( var i = 0 ; i < names.length ; i++ ) { var parts = names[ i ]; if ( parts ) { parts = parts.split( '/' ); var vars = {}, name = names[ i ] = parts[ 0 ]; vars[ styleType ] = values[ i ] = parts[ 1 ] || name; styles[ name ] = new CKEDITOR.style( styleDefinition, vars ); styles[ name ]._.definition.name = name; } else names.splice( i--, 1 ); } editor.ui.addRichCombo( comboName, { label : lang.label, title : lang.panelTitle, className : 'cke_' + ( styleType == 'size' ? 'fontSize' : 'font' ), panel : { css : editor.skin.editor.css.concat( config.contentsCss ), multiSelect : false, attributes : { 'aria-label' : lang.panelTitle } }, init : function() { this.startGroup( lang.panelTitle ); for ( var i = 0 ; i < names.length ; i++ ) { var name = names[ i ]; // Add the tag entry to the panel list. this.add( name, styles[ name ].buildPreview(), name ); } }, onClick : function( value ) { editor.focus(); editor.fire( 'saveSnapshot' ); var style = styles[ value ]; if ( this.getValue() == value ) style.remove( editor.document ); else style.apply( editor.document ); editor.fire( 'saveSnapshot' ); }, onRender : function() { editor.on( 'selectionChange', function( ev ) { var currentValue = this.getValue(); var elementPath = ev.data.path, elements = elementPath.elements; // For each element into the elements path. for ( var i = 0, element ; i < elements.length ; i++ ) { element = elements[i]; // Check if the element is removable by any of // the styles. for ( var value in styles ) { if ( styles[ value ].checkElementRemovable( element, true ) ) { if ( value != currentValue ) this.setValue( value ); return; } } } // If no styles match, just empty it. this.setValue( '', defaultLabel ); }, this); } }); } CKEDITOR.plugins.add( 'font', { requires : [ 'richcombo', 'styles' ], init : function( editor ) { var config = editor.config; addCombo( editor, 'Font', 'family', editor.lang.font, config.font_names, config.font_defaultLabel, config.font_style ); addCombo( editor, 'FontSize', 'size', editor.lang.fontSize, config.fontSize_sizes, config.fontSize_defaultLabel, config.fontSize_style ); } }); })(); /** * The list of fonts names to be displayed in the Font combo in the toolbar. * Entries are separated by semi-colons (;), while it's possible to have more * than one font for each entry, in the HTML way (separated by comma). * * A display name may be optionally defined by prefixing the entries with the * name and the slash character. For example, "Arial/Arial, Helvetica, sans-serif" * will be displayed as "Arial" in the list, but will be outputted as * "Arial, Helvetica, sans-serif". * @type String * @example * config.font_names = * 'Arial/Arial, Helvetica, sans-serif;' + * 'Times New Roman/Times New Roman, Times, serif;' + * 'Verdana'; * @example * config.font_names = 'Arial;Times New Roman;Verdana'; */ CKEDITOR.config.font_names = 'Arial/Arial, Helvetica, sans-serif;' + 'Comic Sans MS/Comic Sans MS, cursive;' + 'Courier New/Courier New, Courier, monospace;' + 'Georgia/Georgia, serif;' + 'Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;' + 'Tahoma/Tahoma, Geneva, sans-serif;' + 'Times New Roman/Times New Roman, Times, serif;' + 'Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;' + 'Verdana/Verdana, Geneva, sans-serif'; /** * The text to be displayed in the Font combo is none of the available values * matches the current cursor position or text selection. * @type String * @example * // If the default site font is Arial, we may making it more explicit to the end user. * config.font_defaultLabel = 'Arial'; */ CKEDITOR.config.font_defaultLabel = ''; /** * The style definition to be used to apply the font in the text. * @type Object * @example * // This is actually the default value for it. * config.font_style = * { * element : 'span', * styles : { 'font-family' : '#(family)' }, * overrides : [ { element : 'font', attributes : { 'face' : null } } ] * }; */ CKEDITOR.config.font_style = { element : 'span', styles : { 'font-family' : '#(family)' }, overrides : [ { element : 'font', attributes : { 'face' : null } } ] }; /** * The list of fonts size to be displayed in the Font Size combo in the * toolbar. Entries are separated by semi-colons (;). * * Any kind of "CSS like" size can be used, like "12px", "2.3em", "130%", * "larger" or "x-small". * * A display name may be optionally defined by prefixing the entries with the * name and the slash character. For example, "Bigger Font/14px" will be * displayed as "Bigger Font" in the list, but will be outputted as "14px". * @type String * @default '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px' * @example * config.fontSize_sizes = '16/16px;24/24px;48/48px;'; * @example * config.fontSize_sizes = '12px;2.3em;130%;larger;x-small'; * @example * config.fontSize_sizes = '12 Pixels/12px;Big/2.3em;30 Percent More/130%;Bigger/larger;Very Small/x-small'; */ CKEDITOR.config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px'; /** * The text to be displayed in the Font Size combo is none of the available * values matches the current cursor position or text selection. * @type String * @example * // If the default site font size is 12px, we may making it more explicit to the end user. * config.fontSize_defaultLabel = '12px'; */ CKEDITOR.config.fontSize_defaultLabel = ''; /** * The style definition to be used to apply the font size in the text. * @type Object * @example * // This is actually the default value for it. * config.fontSize_style = * { * element : 'span', * styles : { 'font-size' : '#(size)' }, * overrides : [ { element : 'font', attributes : { 'size' : null } } ] * }; */ CKEDITOR.config.fontSize_style = { element : 'span', styles : { 'font-size' : '#(size)' }, overrides : [ { element : 'font', attributes : { 'size' : null } } ] };
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/font/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'basicstyles', { requires : [ 'styles', 'button' ], init : function( editor ) { // All buttons use the same code to register. So, to avoid // duplications, let's use this tool function. var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton ) { var style = new CKEDITOR.style( styleDefiniton ); editor.attachStyleStateChange( style, function( state ) { editor.getCommand( commandName ).setState( state ); }); editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) ); editor.ui.addButton( buttonName, { label : buttonLabel, command : commandName }); }; var config = editor.config, lang = editor.lang; addButtonCommand( 'Bold' , lang.bold , 'bold' , config.coreStyles_bold ); addButtonCommand( 'Italic' , lang.italic , 'italic' , config.coreStyles_italic ); addButtonCommand( 'Underline' , lang.underline , 'underline' , config.coreStyles_underline ); addButtonCommand( 'Strike' , lang.strike , 'strike' , config.coreStyles_strike ); addButtonCommand( 'Subscript' , lang.subscript , 'subscript' , config.coreStyles_subscript ); addButtonCommand( 'Superscript' , lang.superscript , 'superscript' , config.coreStyles_superscript ); } }); // Basic Inline Styles. /** * The style definition to be used to apply the bold style in the text. * @type Object * @example * config.coreStyles_bold = { element : 'b', overrides : 'strong' }; * @example * config.coreStyles_bold = { element : 'span', attributes : {'class': 'Bold'} }; */ CKEDITOR.config.coreStyles_bold = { element : 'strong', overrides : 'b' }; /** * The style definition to be used to apply the italic style in the text. * @type Object * @default { element : 'em', overrides : 'i' } * @example * config.coreStyles_italic = { element : 'i', overrides : 'em' }; * @example * CKEDITOR.config.coreStyles_italic = { element : 'span', attributes : {'class': 'Italic'} }; */ CKEDITOR.config.coreStyles_italic = { element : 'em', overrides : 'i' }; /** * The style definition to be used to apply the underline style in the text. * @type Object * @default { element : 'u' } * @example * CKEDITOR.config.coreStyles_underline = { element : 'span', attributes : {'class': 'Underline'}}; */ CKEDITOR.config.coreStyles_underline = { element : 'u' }; /** * The style definition to be used to apply the strike style in the text. * @type Object * @default { element : 'strike' } * @example * CKEDITOR.config.coreStyles_strike = { element : 'span', attributes : {'class': 'StrikeThrough'}, overrides : 'strike' }; */ CKEDITOR.config.coreStyles_strike = { element : 'strike' }; /** * The style definition to be used to apply the subscript style in the text. * @type Object * @default { element : 'sub' } * @example * CKEDITOR.config.coreStyles_subscript = { element : 'span', attributes : {'class': 'Subscript'}, overrides : 'sub' }; */ CKEDITOR.config.coreStyles_subscript = { element : 'sub' }; /** * The style definition to be used to apply the superscript style in the text. * @type Object * @default { element : 'sup' } * @example * CKEDITOR.config.coreStyles_superscript = { element : 'span', attributes : {'class': 'Superscript'}, overrides : 'sup' }; */ CKEDITOR.config.coreStyles_superscript = { element : 'sup' };
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/basicstyles/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @file Insert and remove numbered and bulleted lists. */ (function() { var listNodeNames = { ol : 1, ul : 1 }, emptyTextRegex = /^[\n\r\t ]*$/; var whitespaces = CKEDITOR.dom.walker.whitespaces(), bookmarks = CKEDITOR.dom.walker.bookmark(), nonEmpty = function( node ){ return !( whitespaces( node ) || bookmarks( node ) ); }; CKEDITOR.plugins.list = { /* * Convert a DOM list tree into a data structure that is easier to * manipulate. This operation should be non-intrusive in the sense that it * does not change the DOM tree, with the exception that it may add some * markers to the list item nodes when database is specified. */ listToArray : function( listNode, database, baseArray, baseIndentLevel, grandparentNode ) { if ( !listNodeNames[ listNode.getName() ] ) return []; if ( !baseIndentLevel ) baseIndentLevel = 0; if ( !baseArray ) baseArray = []; // Iterate over all list items to and look for inner lists. for ( var i = 0, count = listNode.getChildCount() ; i < count ; i++ ) { var listItem = listNode.getChild( i ); // It may be a text node or some funny stuff. if ( listItem.$.nodeName.toLowerCase() != 'li' ) continue; var itemObj = { 'parent' : listNode, indent : baseIndentLevel, element : listItem, contents : [] }; if ( !grandparentNode ) { itemObj.grandparent = listNode.getParent(); if ( itemObj.grandparent && itemObj.grandparent.$.nodeName.toLowerCase() == 'li' ) itemObj.grandparent = itemObj.grandparent.getParent(); } else itemObj.grandparent = grandparentNode; if ( database ) CKEDITOR.dom.element.setMarker( database, listItem, 'listarray_index', baseArray.length ); baseArray.push( itemObj ); for ( var j = 0, itemChildCount = listItem.getChildCount(), child; j < itemChildCount ; j++ ) { child = listItem.getChild( j ); if ( child.type == CKEDITOR.NODE_ELEMENT && listNodeNames[ child.getName() ] ) // Note the recursion here, it pushes inner list items with // +1 indentation in the correct order. CKEDITOR.plugins.list.listToArray( child, database, baseArray, baseIndentLevel + 1, itemObj.grandparent ); else itemObj.contents.push( child ); } } return baseArray; }, // Convert our internal representation of a list back to a DOM forest. arrayToList : function( listArray, database, baseIndex, paragraphMode, dir ) { if ( !baseIndex ) baseIndex = 0; if ( !listArray || listArray.length < baseIndex + 1 ) return null; var doc = listArray[ baseIndex ].parent.getDocument(), retval = new CKEDITOR.dom.documentFragment( doc ), rootNode = null, currentIndex = baseIndex, indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ), currentListItem = null, paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); while ( 1 ) { var item = listArray[ currentIndex ]; if ( item.indent == indentLevel ) { if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() ) { rootNode = listArray[ currentIndex ].parent.clone( false, 1 ); dir && rootNode.setAttribute( 'dir', dir ); retval.append( rootNode ); } currentListItem = rootNode.append( item.element.clone( 0, 1 ) ); for ( var i = 0 ; i < item.contents.length ; i++ ) currentListItem.append( item.contents[i].clone( 1, 1 ) ); currentIndex++; } else if ( item.indent == Math.max( indentLevel, 0 ) + 1 ) { var listData = CKEDITOR.plugins.list.arrayToList( listArray, null, currentIndex, paragraphMode ); // If the next block is an <li> with another list tree as the first // child, we'll need to append a filler (<br>/NBSP) or the list item // wouldn't be editable. (#6724) if ( !currentListItem.getChildCount() && CKEDITOR.env.ie && !( doc.$.documentMode > 7 )) currentListItem.append( doc.createText( '\xa0' ) ); currentListItem.append( listData.listNode ); currentIndex = listData.nextIndex; } else if ( item.indent == -1 && !baseIndex && item.grandparent ) { currentListItem; if ( listNodeNames[ item.grandparent.getName() ] ) currentListItem = item.element.clone( false, true ); else { // Create completely new blocks here. if ( dir || item.element.hasAttributes() || paragraphMode != CKEDITOR.ENTER_BR ) { currentListItem = doc.createElement( paragraphName ); item.element.copyAttributes( currentListItem, { type:1, value:1 } ); var itemDir = item.element.getDirection() || dir; itemDir && currentListItem.setAttribute( 'dir', itemDir ); // There might be a case where there are no attributes in the element after all // (i.e. when "type" or "value" are the only attributes set). In this case, if enterMode = BR, // the current item should be a fragment. if ( !dir && paragraphMode == CKEDITOR.ENTER_BR && !currentListItem.hasAttributes() ) currentListItem = new CKEDITOR.dom.documentFragment( doc ); } else currentListItem = new CKEDITOR.dom.documentFragment( doc ); } for ( i = 0 ; i < item.contents.length ; i++ ) currentListItem.append( item.contents[i].clone( 1, 1 ) ); if ( currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && currentIndex != listArray.length - 1 ) { var last = currentListItem.getLast(); if ( last && last.type == CKEDITOR.NODE_ELEMENT && last.getAttribute( 'type' ) == '_moz' ) { last.remove(); } if ( !( last = currentListItem.getLast( nonEmpty ) && last.type == CKEDITOR.NODE_ELEMENT && last.getName() in CKEDITOR.dtd.$block ) ) { currentListItem.append( doc.createElement( 'br' ) ); } } if ( currentListItem.type == CKEDITOR.NODE_ELEMENT && currentListItem.getName() == paragraphName && currentListItem.$.firstChild ) { currentListItem.trim(); var firstChild = currentListItem.getFirst(); if ( firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.isBlockBoundary() ) { var tmp = new CKEDITOR.dom.documentFragment( doc ); currentListItem.moveChildren( tmp ); currentListItem = tmp; } } var currentListItemName = currentListItem.$.nodeName.toLowerCase(); if ( !CKEDITOR.env.ie && ( currentListItemName == 'div' || currentListItemName == 'p' ) ) currentListItem.appendBogus(); retval.append( currentListItem ); rootNode = null; currentIndex++; } else return null; if ( listArray.length <= currentIndex || Math.max( listArray[ currentIndex ].indent, 0 ) < indentLevel ) break; } // Clear marker attributes for the new list tree made of cloned nodes, if any. if ( database ) { var currentNode = retval.getFirst(); while ( currentNode ) { if ( currentNode.type == CKEDITOR.NODE_ELEMENT ) CKEDITOR.dom.element.clearMarkers( database, currentNode ); currentNode = currentNode.getNextSourceNode(); } } return { listNode : retval, nextIndex : currentIndex }; } }; function onSelectionChange( evt ) { var path = evt.data.path, blockLimit = path.blockLimit, elements = path.elements, element, i; // Grouping should only happen under blockLimit.(#3940). for ( i = 0 ; i < elements.length && ( element = elements[ i ] ) && !element.equals( blockLimit ); i++ ) { if ( listNodeNames[ elements[i].getName() ] ) return this.setState( this.type == elements[i].getName() ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); } return this.setState( CKEDITOR.TRISTATE_OFF ); } function changeListType( editor, groupObj, database, listsCreated ) { // This case is easy... // 1. Convert the whole list into a one-dimensional array. // 2. Change the list type by modifying the array. // 3. Recreate the whole list by converting the array to a list. // 4. Replace the original list with the recreated list. var listArray = CKEDITOR.plugins.list.listToArray( groupObj.root, database ), selectedListItems = []; for ( var i = 0 ; i < groupObj.contents.length ; i++ ) { var itemNode = groupObj.contents[i]; itemNode = itemNode.getAscendant( 'li', true ); if ( !itemNode || itemNode.getCustomData( 'list_item_processed' ) ) continue; selectedListItems.push( itemNode ); CKEDITOR.dom.element.setMarker( database, itemNode, 'list_item_processed', true ); } var root = groupObj.root, fakeParent = root.getDocument().createElement( this.type ); // Copy all attributes, except from 'start' and 'type'. root.copyAttributes( fakeParent, { start : 1, type : 1 } ); // The list-style-type property should be ignored. fakeParent.removeStyle( 'list-style-type' ); for ( i = 0 ; i < selectedListItems.length ; i++ ) { var listIndex = selectedListItems[i].getCustomData( 'listarray_index' ); listArray[listIndex].parent = fakeParent; } var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); var child, length = newList.listNode.getChildCount(); for ( i = 0 ; i < length && ( child = newList.listNode.getChild( i ) ) ; i++ ) { if ( child.getName() == this.type ) listsCreated.push( child ); } newList.listNode.replace( groupObj.root ); } var headerTagRegex = /^h[1-6]$/; function createList( editor, groupObj, listsCreated ) { var contents = groupObj.contents, doc = groupObj.root.getDocument(), listContents = []; // It is possible to have the contents returned by DomRangeIterator to be the same as the root. // e.g. when we're running into table cells. // In such a case, enclose the childNodes of contents[0] into a <div>. if ( contents.length == 1 && contents[0].equals( groupObj.root ) ) { var divBlock = doc.createElement( 'div' ); contents[0].moveChildren && contents[0].moveChildren( divBlock ); contents[0].append( divBlock ); contents[0] = divBlock; } // Calculate the common parent node of all content blocks. var commonParent = groupObj.contents[0].getParent(); for ( var i = 0 ; i < contents.length ; i++ ) commonParent = commonParent.getCommonAncestor( contents[i].getParent() ); var useComputedState = editor.config.useComputedState, listDir, explicitDirection; useComputedState = useComputedState === undefined || useComputedState; // We want to insert things that are in the same tree level only, so calculate the contents again // by expanding the selected blocks to the same tree level. for ( i = 0 ; i < contents.length ; i++ ) { var contentNode = contents[i], parentNode; while ( ( parentNode = contentNode.getParent() ) ) { if ( parentNode.equals( commonParent ) ) { listContents.push( contentNode ); // Determine the lists's direction. if ( !explicitDirection && contentNode.getDirection() ) explicitDirection = 1; var itemDir = contentNode.getDirection( useComputedState ); if ( listDir !== null ) { // If at least one LI have a different direction than current listDir, we can't have listDir. if ( listDir && listDir != itemDir ) listDir = null; else listDir = itemDir; } break; } contentNode = parentNode; } } if ( listContents.length < 1 ) return; // Insert the list to the DOM tree. var insertAnchor = listContents[ listContents.length - 1 ].getNext(), listNode = doc.createElement( this.type ); listsCreated.push( listNode ); var contentBlock, listItem; while ( listContents.length ) { contentBlock = listContents.shift(); listItem = doc.createElement( 'li' ); // Preserve preformat block and heading structure when converting to list item. (#5335) (#5271) if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) ) contentBlock.appendTo( listItem ); else { // Remove DIR attribute if it was merged into list root. if ( listDir && contentBlock.getDirection() ) { contentBlock.removeStyle( 'direction' ); contentBlock.removeAttribute( 'dir' ); } contentBlock.copyAttributes( listItem ); contentBlock.moveChildren( listItem ); contentBlock.remove(); } listItem.appendTo( listNode ); } // Apply list root dir only if it has been explicitly declared. if ( listDir && explicitDirection ) listNode.setAttribute( 'dir', listDir ); if ( insertAnchor ) listNode.insertBefore( insertAnchor ); else listNode.appendTo( commonParent ); } function removeList( editor, groupObj, database ) { // This is very much like the change list type operation. // Except that we're changing the selected items' indent to -1 in the list array. var listArray = CKEDITOR.plugins.list.listToArray( groupObj.root, database ), selectedListItems = []; for ( var i = 0 ; i < groupObj.contents.length ; i++ ) { var itemNode = groupObj.contents[i]; itemNode = itemNode.getAscendant( 'li', true ); if ( !itemNode || itemNode.getCustomData( 'list_item_processed' ) ) continue; selectedListItems.push( itemNode ); CKEDITOR.dom.element.setMarker( database, itemNode, 'list_item_processed', true ); } var lastListIndex = null; for ( i = 0 ; i < selectedListItems.length ; i++ ) { var listIndex = selectedListItems[i].getCustomData( 'listarray_index' ); listArray[listIndex].indent = -1; lastListIndex = listIndex; } // After cutting parts of the list out with indent=-1, we still have to maintain the array list // model's nextItem.indent <= currentItem.indent + 1 invariant. Otherwise the array model of the // list cannot be converted back to a real DOM list. for ( i = lastListIndex + 1 ; i < listArray.length ; i++ ) { if ( listArray[i].indent > listArray[i-1].indent + 1 ) { var indentOffset = listArray[i-1].indent + 1 - listArray[i].indent; var oldIndent = listArray[i].indent; while ( listArray[i] && listArray[i].indent >= oldIndent ) { listArray[i].indent += indentOffset; i++; } i--; } } var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, groupObj.root.getAttribute( 'dir' ) ); // Compensate <br> before/after the list node if the surrounds are non-blocks.(#3836) var docFragment = newList.listNode, boundaryNode, siblingNode; function compensateBrs( isStart ) { if ( ( boundaryNode = docFragment[ isStart ? 'getFirst' : 'getLast' ]() ) && !( boundaryNode.is && boundaryNode.isBlockBoundary() ) && ( siblingNode = groupObj.root[ isStart ? 'getPrevious' : 'getNext' ] ( CKEDITOR.dom.walker.whitespaces( true ) ) ) && !( siblingNode.is && siblingNode.isBlockBoundary( { br : 1 } ) ) ) editor.document.createElement( 'br' )[ isStart ? 'insertBefore' : 'insertAfter' ]( boundaryNode ); } compensateBrs( true ); compensateBrs(); docFragment.replace( groupObj.root ); } function listCommand( name, type ) { this.name = name; this.type = type; } listCommand.prototype = { exec : function( editor ) { editor.focus(); var doc = editor.document, selection = editor.getSelection(), ranges = selection && selection.getRanges( true ); // There should be at least one selected range. if ( !ranges || ranges.length < 1 ) return; // Midas lists rule #1 says we can create a list even in an empty document. // But DOM iterator wouldn't run if the document is really empty. // So create a paragraph if the document is empty and we're going to create a list. if ( this.state == CKEDITOR.TRISTATE_OFF ) { var body = doc.getBody(); body.trim(); if ( !body.getFirst() ) { var paragraph = doc.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : ( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'br' ) ); paragraph.appendTo( body ); ranges = new CKEDITOR.dom.rangeList( [ new CKEDITOR.dom.range( doc ) ] ); // IE exception on inserting anything when anchor inside <br>. if ( paragraph.is( 'br' ) ) { ranges[ 0 ].setStartBefore( paragraph ); ranges[ 0 ].setEndAfter( paragraph ); } else ranges[ 0 ].selectNodeContents( paragraph ); selection.selectRanges( ranges ); } // Maybe a single range there enclosing the whole list, // turn on the list state manually(#4129). else { var range = ranges.length == 1 && ranges[ 0 ], enclosedNode = range && range.getEnclosedNode(); if ( enclosedNode && enclosedNode.is && this.type == enclosedNode.getName() ) this.setState( CKEDITOR.TRISTATE_ON ); } } var bookmarks = selection.createBookmarks( true ); // Group the blocks up because there are many cases where multiple lists have to be created, // or multiple lists have to be cancelled. var listGroups = [], database = {}, rangeIterator = ranges.createIterator(), index = 0; while ( ( range = rangeIterator.getNextRange() ) && ++index ) { var boundaryNodes = range.getBoundaryNodes(), startNode = boundaryNodes.startNode, endNode = boundaryNodes.endNode; if ( startNode.type == CKEDITOR.NODE_ELEMENT && startNode.getName() == 'td' ) range.setStartAt( boundaryNodes.startNode, CKEDITOR.POSITION_AFTER_START ); if ( endNode.type == CKEDITOR.NODE_ELEMENT && endNode.getName() == 'td' ) range.setEndAt( boundaryNodes.endNode, CKEDITOR.POSITION_BEFORE_END ); var iterator = range.createIterator(), block; iterator.forceBrBreak = ( this.state == CKEDITOR.TRISTATE_OFF ); while ( ( block = iterator.getNextParagraph() ) ) { // Avoid duplicate blocks get processed across ranges. if( block.getCustomData( 'list_block' ) ) continue; else CKEDITOR.dom.element.setMarker( database, block, 'list_block', 1 ); var path = new CKEDITOR.dom.elementPath( block ), pathElements = path.elements, pathElementsCount = pathElements.length, listNode = null, processedFlag = 0, blockLimit = path.blockLimit, element; // First, try to group by a list ancestor. for ( var i = pathElementsCount - 1; i >= 0 && ( element = pathElements[ i ] ); i-- ) { if ( listNodeNames[ element.getName() ] && blockLimit.contains( element ) ) // Don't leak outside block limit (#3940). { // If we've encountered a list inside a block limit // The last group object of the block limit element should // no longer be valid. Since paragraphs after the list // should belong to a different group of paragraphs before // the list. (Bug #1309) blockLimit.removeCustomData( 'list_group_object_' + index ); var groupObj = element.getCustomData( 'list_group_object' ); if ( groupObj ) groupObj.contents.push( block ); else { groupObj = { root : element, contents : [ block ] }; listGroups.push( groupObj ); CKEDITOR.dom.element.setMarker( database, element, 'list_group_object', groupObj ); } processedFlag = 1; break; } } if ( processedFlag ) continue; // No list ancestor? Group by block limit, but don't mix contents from different ranges. var root = blockLimit; if ( root.getCustomData( 'list_group_object_' + index ) ) root.getCustomData( 'list_group_object_' + index ).contents.push( block ); else { groupObj = { root : root, contents : [ block ] }; CKEDITOR.dom.element.setMarker( database, root, 'list_group_object_' + index, groupObj ); listGroups.push( groupObj ); } } } // Now we have two kinds of list groups, groups rooted at a list, and groups rooted at a block limit element. // We either have to build lists or remove lists, for removing a list does not makes sense when we are looking // at the group that's not rooted at lists. So we have three cases to handle. var listsCreated = []; while ( listGroups.length > 0 ) { groupObj = listGroups.shift(); if ( this.state == CKEDITOR.TRISTATE_OFF ) { if ( listNodeNames[ groupObj.root.getName() ] ) changeListType.call( this, editor, groupObj, database, listsCreated ); else createList.call( this, editor, groupObj, listsCreated ); } else if ( this.state == CKEDITOR.TRISTATE_ON && listNodeNames[ groupObj.root.getName() ] ) removeList.call( this, editor, groupObj, database ); } // For all new lists created, merge adjacent, same type lists. for ( i = 0 ; i < listsCreated.length ; i++ ) { listNode = listsCreated[i]; var mergeSibling, listCommand = this; ( mergeSibling = function( rtl ){ var sibling = listNode[ rtl ? 'getPrevious' : 'getNext' ]( CKEDITOR.dom.walker.whitespaces( true ) ); if ( sibling && sibling.getName && sibling.getName() == listCommand.type ) { sibling.remove(); // Move children order by merge direction.(#3820) sibling.moveChildren( listNode, rtl ); } } )(); mergeSibling( 1 ); } // Clean up, restore selection and update toolbar button states. CKEDITOR.dom.element.clearAllMarkers( database ); selection.selectBookmarks( bookmarks ); editor.focus(); } }; var dtd = CKEDITOR.dtd; var tailNbspRegex = /[\t\r\n ]*(?:&nbsp;|\xa0)$/; function indexOfFirstChildElement( element, tagNameList ) { var child, children = element.children, length = children.length; for ( var i = 0 ; i < length ; i++ ) { child = children[ i ]; if ( child.name && ( child.name in tagNameList ) ) return i; } return length; } function getExtendNestedListFilter( isHtmlFilter ) { // An element filter function that corrects nested list start in an empty // list item for better displaying/outputting. (#3165) return function( listItem ) { var children = listItem.children, firstNestedListIndex = indexOfFirstChildElement( listItem, dtd.$list ), firstNestedList = children[ firstNestedListIndex ], nodeBefore = firstNestedList && firstNestedList.previous, tailNbspmatch; if ( nodeBefore && ( nodeBefore.name && nodeBefore.name == 'br' || nodeBefore.value && ( tailNbspmatch = nodeBefore.value.match( tailNbspRegex ) ) ) ) { var fillerNode = nodeBefore; // Always use 'nbsp' as filler node if we found a nested list appear // in front of a list item. if ( !( tailNbspmatch && tailNbspmatch.index ) && fillerNode == children[ 0 ] ) children[ 0 ] = ( isHtmlFilter || CKEDITOR.env.ie ) ? new CKEDITOR.htmlParser.text( '\xa0' ) : new CKEDITOR.htmlParser.element( 'br', {} ); // Otherwise the filler is not needed anymore. else if ( fillerNode.name == 'br' ) children.splice( firstNestedListIndex - 1, 1 ); else fillerNode.value = fillerNode.value.replace( tailNbspRegex, '' ); } }; } var defaultListDataFilterRules = { elements : {} }; for ( var i in dtd.$listItem ) defaultListDataFilterRules.elements[ i ] = getExtendNestedListFilter(); var defaultListHtmlFilterRules = { elements : {} }; for ( i in dtd.$listItem ) defaultListHtmlFilterRules.elements[ i ] = getExtendNestedListFilter( true ); CKEDITOR.plugins.add( 'list', { init : function( editor ) { // Register commands. var numberedListCommand = editor.addCommand( 'numberedlist', new listCommand( 'numberedlist', 'ol' ) ), bulletedListCommand = editor.addCommand( 'bulletedlist', new listCommand( 'bulletedlist', 'ul' ) ); // Register the toolbar button. editor.ui.addButton( 'NumberedList', { label : editor.lang.numberedlist, command : 'numberedlist' } ); editor.ui.addButton( 'BulletedList', { label : editor.lang.bulletedlist, command : 'bulletedlist' } ); // Register the state changing handlers. editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, numberedListCommand ) ); editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, bulletedListCommand ) ); }, afterInit : function ( editor ) { var dataProcessor = editor.dataProcessor; if ( dataProcessor ) { dataProcessor.dataFilter.addRules( defaultListDataFilterRules ); dataProcessor.htmlFilter.addRules( defaultListHtmlFilterRules ); } }, requires : [ 'domiterator' ] } ); })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/list/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { CKEDITOR.plugins.add( 'stylescombo', { requires : [ 'richcombo', 'styles' ], init : function( editor ) { var config = editor.config, lang = editor.lang.stylesCombo, styles = {}, stylesList = []; function loadStylesSet( callback ) { editor.getStylesSet( function( stylesDefinitions ) { if ( !stylesList.length ) { var style, styleName; // Put all styles into an Array. for ( var i = 0, count = stylesDefinitions.length ; i < count ; i++ ) { var styleDefinition = stylesDefinitions[ i ]; styleName = styleDefinition.name; style = styles[ styleName ] = new CKEDITOR.style( styleDefinition ); style._name = styleName; style._.enterMode = config.enterMode; stylesList.push( style ); } // Sorts the Array, so the styles get grouped by type. stylesList.sort( sortStyles ); } callback && callback(); }); } editor.ui.addRichCombo( 'Styles', { label : lang.label, title : lang.panelTitle, className : 'cke_styles', panel : { css : editor.skin.editor.css.concat( config.contentsCss ), multiSelect : true, attributes : { 'aria-label' : lang.panelTitle } }, init : function() { var combo = this; loadStylesSet( function() { var style, styleName; // Loop over the Array, adding all items to the // combo. var lastType; for ( var i = 0, count = stylesList.length ; i < count ; i++ ) { style = stylesList[ i ]; styleName = style._name; var type = style.type; if ( type != lastType ) { combo.startGroup( lang[ 'panelTitle' + String( type ) ] ); lastType = type; } combo.add( styleName, style.type == CKEDITOR.STYLE_OBJECT ? styleName : style.buildPreview(), styleName ); } combo.commit(); combo.onOpen(); }); }, onClick : function( value ) { editor.focus(); editor.fire( 'saveSnapshot' ); var style = styles[ value ], selection = editor.getSelection(); var elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() ); style[ style.checkActive( elementPath ) ? 'remove' : 'apply' ]( editor.document ); editor.fire( 'saveSnapshot' ); }, onRender : function() { editor.on( 'selectionChange', function( ev ) { var currentValue = this.getValue(); var elementPath = ev.data.path, elements = elementPath.elements; // For each element into the elements path. for ( var i = 0, count = elements.length, element ; i < count ; i++ ) { element = elements[i]; // Check if the element is removable by any of // the styles. for ( var value in styles ) { if ( styles[ value ].checkElementRemovable( element, true ) ) { if ( value != currentValue ) this.setValue( value ); return; } } } // If no styles match, just empty it. this.setValue( '' ); }, this); }, onOpen : function() { if ( CKEDITOR.env.ie || CKEDITOR.env.webkit ) editor.focus(); var selection = editor.getSelection(), element = selection.getSelectedElement(), elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() ); var counter = [ 0, 0, 0, 0 ]; this.showAll(); this.unmarkAll(); for ( var name in styles ) { var style = styles[ name ], type = style.type; if ( style.checkActive( elementPath ) ) this.mark( name ); else if ( type == CKEDITOR.STYLE_OBJECT && !style.checkApplicable( elementPath ) ) { this.hideItem( name ); counter[ type ]--; } counter[ type ]++; } if ( !counter[ CKEDITOR.STYLE_BLOCK ] ) this.hideGroup( lang[ 'panelTitle' + String( CKEDITOR.STYLE_BLOCK ) ] ); if ( !counter[ CKEDITOR.STYLE_INLINE ] ) this.hideGroup( lang[ 'panelTitle' + String( CKEDITOR.STYLE_INLINE ) ] ); if ( !counter[ CKEDITOR.STYLE_OBJECT ] ) this.hideGroup( lang[ 'panelTitle' + String( CKEDITOR.STYLE_OBJECT ) ] ); } }); editor.on( 'instanceReady', function() { loadStylesSet(); } ); } }); function sortStyles( styleA, styleB ) { var typeA = styleA.type, typeB = styleB.type; return typeA == typeB ? 0 : typeA == CKEDITOR.STYLE_OBJECT ? -1 : typeB == CKEDITOR.STYLE_OBJECT ? 1 : typeB == CKEDITOR.STYLE_BLOCK ? 1 : -1; } })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/stylescombo/plugin.js
plugin.js
/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.addStylesSet( 'default', [ /* Block Styles */ // These styles are already available in the "Format" combo, so they are // not needed here by default. You may enable them to avoid placing the // "Format" combo in the toolbar, maintaining the same features. /* { name : 'Paragraph' , element : 'p' }, { name : 'Heading 1' , element : 'h1' }, { name : 'Heading 2' , element : 'h2' }, { name : 'Heading 3' , element : 'h3' }, { name : 'Heading 4' , element : 'h4' }, { name : 'Heading 5' , element : 'h5' }, { name : 'Heading 6' , element : 'h6' }, { name : 'Preformatted Text', element : 'pre' }, { name : 'Address' , element : 'address' }, */ { name : 'Blue Title' , element : 'h3', styles : { 'color' : 'Blue' } }, { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } }, /* Inline Styles */ // These are core styles available as toolbar buttons. You may opt enabling // some of them in the Styles combo, removing them from the toolbar. /* { name : 'Strong' , element : 'strong', overrides : 'b' }, { name : 'Emphasis' , element : 'em' , overrides : 'i' }, { name : 'Underline' , element : 'u' }, { name : 'Strikethrough' , element : 'strike' }, { name : 'Subscript' , element : 'sub' }, { name : 'Superscript' , element : 'sup' }, */ { name : 'Marker: Yellow' , element : 'span', styles : { 'background-color' : 'Yellow' } }, { name : 'Marker: Green' , element : 'span', styles : { 'background-color' : 'Lime' } }, { name : 'Big' , element : 'big' }, { name : 'Small' , element : 'small' }, { name : 'Typewriter' , element : 'tt' }, { name : 'Computer Code' , element : 'code' }, { name : 'Keyboard Phrase' , element : 'kbd' }, { name : 'Sample Text' , element : 'samp' }, { name : 'Variable' , element : 'var' }, { name : 'Deleted Text' , element : 'del' }, { name : 'Inserted Text' , element : 'ins' }, { name : 'Cited Work' , element : 'cite' }, { name : 'Inline Quotation' , element : 'q' }, { name : 'Language: RTL' , element : 'span', attributes : { 'dir' : 'rtl' } }, { name : 'Language: LTR' , element : 'span', attributes : { 'dir' : 'ltr' } }, /* Object Styles */ { name : 'Image on Left', element : 'img', attributes : { 'style' : 'padding: 5px; margin-right: 5px', 'border' : '2', 'align' : 'left' } }, { name : 'Image on Right', element : 'img', attributes : { 'style' : 'padding: 5px; margin-left: 5px', 'border' : '2', 'align' : 'right' } } ]);
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/stylescombo/styles/default.js
default.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @file Horizontal Page Break */ // Register a plugin named "pagebreak". CKEDITOR.plugins.add( 'pagebreak', { init : function( editor ) { // Register the command. editor.addCommand( 'pagebreak', CKEDITOR.plugins.pagebreakCmd ); // Register the toolbar button. editor.ui.addButton( 'PageBreak', { label : editor.lang.pagebreak, command : 'pagebreak' }); // Add the style that renders our placeholder. editor.addCss( 'img.cke_pagebreak' + '{' + 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/pagebreak.gif' ) + ');' + 'background-position: center center;' + 'background-repeat: no-repeat;' + 'clear: both;' + 'display: block;' + 'float: none;' + 'width:100% !important; _width:99.9% !important;' + 'border-top: #999999 1px dotted;' + 'border-bottom: #999999 1px dotted;' + 'height: 5px !important;' + 'page-break-after: always;' + '}' ); }, afterInit : function( editor ) { // Register a filter to displaying placeholders after mode change. var dataProcessor = editor.dataProcessor, dataFilter = dataProcessor && dataProcessor.dataFilter; if ( dataFilter ) { dataFilter.addRules( { elements : { div : function( element ) { var attributes = element.attributes, style = attributes && attributes.style, child = style && element.children.length == 1 && element.children[ 0 ], childStyle = child && ( child.name == 'span' ) && child.attributes.style; if ( childStyle && ( /page-break-after\s*:\s*always/i ).test( style ) && ( /display\s*:\s*none/i ).test( childStyle ) ) { var fakeImg = editor.createFakeParserElement( element, 'cke_pagebreak', 'div' ); var label = editor.lang.pagebreakAlt; fakeImg.attributes[ 'alt' ] = label; fakeImg.attributes[ 'aria-label' ] = label; return fakeImg; } } } }); } }, requires : [ 'fakeobjects' ] }); CKEDITOR.plugins.pagebreakCmd = { exec : function( editor ) { // Create the element that represents a print break. var label = editor.lang.pagebreakAlt; var breakObject = CKEDITOR.dom.element.createFromHtml( '<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>' ); // Creates the fake image used for this element. breakObject = editor.createFakeElement( breakObject, 'cke_pagebreak', 'div' ); breakObject.setAttributes( { alt : label, 'aria-label' : label, title : label } ); var ranges = editor.getSelection().getRanges( true ); editor.fire( 'saveSnapshot' ); for ( var range, i = ranges.length - 1 ; i >= 0; i-- ) { range = ranges[ i ]; if ( i < ranges.length -1 ) breakObject = breakObject.clone( true ); range.splitBlock( 'p' ); range.insertNode( breakObject ); if ( i == ranges.length - 1 ) { range.moveToPosition( breakObject, CKEDITOR.POSITION_AFTER_END ); range.select(); } var previous = breakObject.getPrevious(); if ( previous && CKEDITOR.dtd[ previous.getName() ].div ) breakObject.move( previous ); } editor.fire( 'saveSnapshot' ); } };
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/pagebreak/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'listblock', { requires : [ 'panel' ], onLoad : function() { CKEDITOR.ui.panel.prototype.addListBlock = function( name, definition ) { return this.addBlock( name, new CKEDITOR.ui.listBlock( this.getHolderElement(), definition ) ); }; CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass( { base : CKEDITOR.ui.panel.block, $ : function( blockHolder, blockDefinition ) { blockDefinition = blockDefinition || {}; var attribs = blockDefinition.attributes || ( blockDefinition.attributes = {} ); ( this.multiSelect = !!blockDefinition.multiSelect ) && ( attribs[ 'aria-multiselectable' ] = true ); // Provide default role of 'listbox'. !attribs.role && ( attribs.role = 'listbox' ); // Call the base contructor. this.base.apply( this, arguments ); var keys = this.keys; keys[ 40 ] = 'next'; // ARROW-DOWN keys[ 9 ] = 'next'; // TAB keys[ 38 ] = 'prev'; // ARROW-UP keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB keys[ 32 ] = 'click'; // SPACE this._.pendingHtml = []; this._.items = {}; this._.groups = {}; }, _ : { close : function() { if ( this._.started ) { this._.pendingHtml.push( '</ul>' ); delete this._.started; } }, getClick : function() { if ( !this._.click ) { this._.click = CKEDITOR.tools.addFunction( function( value ) { var marked = true; if ( this.multiSelect ) marked = this.toggle( value ); else this.mark( value ); if ( this.onClick ) this.onClick( value, marked ); }, this ); } return this._.click; } }, proto : { add : function( value, html, title ) { var pendingHtml = this._.pendingHtml, id = CKEDITOR.tools.getNextId(); if ( !this._.started ) { pendingHtml.push( '<ul role="presentation" class=cke_panel_list>' ); this._.started = 1; this._.size = this._.size || 0; } this._.items[ value ] = id; pendingHtml.push( '<li id=', id, ' class=cke_panel_listItem role=presentation>' + '<a id="', id, '_option" _cke_focus=1 hidefocus=true' + ' title="', title || value, '"' + ' href="javascript:void(\'', value, '\')"' + ' onclick="CKEDITOR.tools.callFunction(', this._.getClick(), ',\'', value, '\'); return false;"', ' role="option"' + ' aria-posinset="' + ++this._.size + '">', html || value, '</a>' + '</li>' ); }, startGroup : function( title ) { this._.close(); var id = CKEDITOR.tools.getNextId(); this._.groups[ title ] = id; this._.pendingHtml.push( '<h1 role="presentation" id=', id, ' class=cke_panel_grouptitle>', title, '</h1>' ); }, commit : function() { this._.close(); this.element.appendHtml( this._.pendingHtml.join( '' ) ); var items = this._.items, doc = this.element.getDocument(); for ( var value in items ) doc.getById( items[ value ] + '_option' ).setAttribute( 'aria-setsize', this._.size ); delete this._.size; this._.pendingHtml = []; }, toggle : function( value ) { var isMarked = this.isMarked( value ); if ( isMarked ) this.unmark( value ); else this.mark( value ); return !isMarked; }, hideGroup : function( groupTitle ) { var group = this.element.getDocument().getById( this._.groups[ groupTitle ] ), list = group && group.getNext(); if ( group ) { group.setStyle( 'display', 'none' ); if ( list && list.getName() == 'ul' ) list.setStyle( 'display', 'none' ); } }, hideItem : function( value ) { this.element.getDocument().getById( this._.items[ value ] ).setStyle( 'display', 'none' ); }, showAll : function() { var items = this._.items, groups = this._.groups, doc = this.element.getDocument(); for ( var value in items ) { doc.getById( items[ value ] ).setStyle( 'display', '' ); } for ( var title in groups ) { var group = doc.getById( groups[ title ] ), list = group.getNext(); group.setStyle( 'display', '' ); if ( list && list.getName() == 'ul' ) list.setStyle( 'display', '' ); } }, mark : function( value ) { if ( !this.multiSelect ) this.unmarkAll(); var itemId = this._.items[ value ], item = this.element.getDocument().getById( itemId ); item.addClass( 'cke_selected' ); this.element.getDocument().getById( itemId + '_option' ).setAttribute( 'aria-selected', true ); this.element.setAttribute( 'aria-activedescendant', itemId + '_option' ); this.onMark && this.onMark( item ); }, unmark : function( value ) { this.element.getDocument().getById( this._.items[ value ] ).removeClass( 'cke_selected' ); this.onUnmark && this.onUnmark( this._.items[ value ] ); }, unmarkAll : function() { var items = this._.items, doc = this.element.getDocument(); for ( var value in items ) { doc.getById( items[ value ] ).removeClass( 'cke_selected' ); } this.onUnmark && this.onUnmark(); }, isMarked : function( value ) { return this.element.getDocument().getById( this._.items[ value ] ).hasClass( 'cke_selected' ); }, focus : function( value ) { this._.focusIndex = -1; if ( value ) { var selected = this.element.getDocument().getById( this._.items[ value ] ).getFirst(); var links = this.element.getElementsByTag( 'a' ), link, i = -1; while ( ( link = links.getItem( ++i ) ) ) { if ( link.equals( selected ) ) { this._.focusIndex = i; break; } } setTimeout( function() { selected.focus(); }, 0 ); } } } }); } });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/listblock/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'uicolor', function( editor ) { var dialog, picker, pickerContents, // Actual UI color value. uiColor = editor.getUiColor(), pickerId = 'cke_uicolor_picker' + CKEDITOR.tools.getNextNumber(); function setNewPickerColor( color ) { // Convert HEX representation to RGB, stripping # char. if ( /^#/.test( color ) ) color = window.YAHOO.util.Color.hex2rgb( color.substr( 1 ) ); picker.setValue( color, true ); // Refresh picker UI. picker.refresh( pickerId ); } function setNewUiColor( color, force ) { if ( force || dialog._.contents.tab1.livePeview.getValue() ) editor.setUiColor( color ); // Write new config string into textbox. dialog._.contents.tab1.configBox.setValue( 'config.uiColor = "#' + picker.get( "hex" ) + '"' ); } pickerContents = { id : 'yuiColorPicker', type : 'html', html : "<div id='" + pickerId + "' class='cke_uicolor_picker' style='width: 360px; height: 200px; position: relative;'></div>", onLoad : function( event ) { var url = CKEDITOR.getUrl( '_source/' + // @Packager.RemoveLine 'plugins/uicolor/yui/' ); // Create new color picker widget. picker = new window.YAHOO.widget.ColorPicker( pickerId, { showhsvcontrols : true, showhexcontrols : true, images : { PICKER_THUMB : url + "assets/picker_thumb.png", HUE_THUMB : url + "assets/hue_thumb.png" } }); // Set actual UI color to the picker. if ( uiColor ) setNewPickerColor( uiColor ); // Subscribe to the rgbChange event. picker.on( "rgbChange", function() { // Reset predefined box. dialog._.contents.tab1.predefined.setValue( '' ); setNewUiColor( '#' + picker.get( 'hex' ) ); }); // Fix input class names. var inputs = new CKEDITOR.dom.nodeList( picker.getElementsByTagName( 'input' ) ); for ( var i = 0; i < inputs.count() ; i++ ) inputs.getItem( i ).addClass( 'cke_dialog_ui_input_text' ); } }; var skipPreviewChange = true; return { title : editor.lang.uicolor.title, minWidth : 360, minHeight : 320, onLoad : function() { dialog = this; this.setupContent(); // #3808 if ( CKEDITOR.env.ie7Compat ) dialog.parts.contents.setStyle( 'overflow', 'hidden' ); }, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ pickerContents, { id : 'tab1', type : 'vbox', children : [ { id : 'livePeview', type : 'checkbox', label : editor.lang.uicolor.preview, 'default' : 1, onLoad : function() { skipPreviewChange = true; }, onChange : function() { if ( skipPreviewChange ) return; var on = this.getValue(), color = on ? '#' + picker.get( 'hex' ) : uiColor; setNewUiColor( color, true ); } }, { type : 'hbox', children : [ { id : 'predefined', type : 'select', 'default' : '', label : editor.lang.uicolor.predefined, items : [ [ '' ], [ 'Light blue', '#9AB8F3' ], [ 'Sand', '#D2B48C' ], [ 'Metallic', '#949AAA' ], [ 'Purple', '#C2A3C7' ], [ 'Olive', '#A2C980' ], [ 'Happy green', '#9BD446' ], [ 'Jezebel Blue', '#14B8C4' ], [ 'Burn', '#FF893A' ], [ 'Easy red', '#FF6969' ], [ 'Pisces 3', '#48B4F2' ], [ 'Aquarius 5', '#487ED4' ], [ 'Absinthe', '#A8CF76' ], [ 'Scrambled Egg', '#C7A622' ], [ 'Hello monday', '#8E8D80' ], [ 'Lovely sunshine', '#F1E8B1' ], [ 'Recycled air', '#B3C593' ], [ 'Down', '#BCBCA4' ], [ 'Mark Twain', '#CFE91D' ], [ 'Specks of dust', '#D1B596' ], [ 'Lollipop', '#F6CE23' ] ], onChange : function() { var color = this.getValue(); if ( color ) { setNewPickerColor( color ); setNewUiColor( color ); // Refresh predefined preview box. CKEDITOR.document.getById( 'predefinedPreview' ).setStyle( 'background', color ); } else CKEDITOR.document.getById( 'predefinedPreview' ).setStyle( 'background', '' ); }, onShow : function() { var color = editor.getUiColor(); if ( color ) this.setValue( color ); } }, { id : 'predefinedPreview', type : 'html', html : '<div id="cke_uicolor_preview" style="border: 1px solid black; padding: 3px; width: 30px;">' + '<div id="predefinedPreview" style="width: 30px; height: 30px;">&nbsp;</div>' + '</div>' } ] }, { id : 'configBox', type : 'text', label : editor.lang.uicolor.config, onShow : function() { var color = editor.getUiColor(); if ( color ) this.setValue( 'config.uiColor = "' + color + '"' ); } } ] } ] } ], buttons : [ CKEDITOR.dialog.okButton ] }; } );
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/uicolor/dialogs/uicolor.js
uicolor.js
/*jsl:ignoreall*/ /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1796"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G}); },_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B); }else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN]; I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E); }else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.7.0", build: "1796"}); /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue; }if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id); }return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D); }this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ (function(){var B=YAHOO.util.Dom.getXY,A=YAHOO.util.Event,D=Array.prototype.slice;function C(G,E,F,H){C.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(G){this.init(G,E,true);this.initSlider(H);this.initThumb(F);}}YAHOO.lang.augmentObject(C,{getHorizSlider:function(F,G,I,H,E){return new C(F,F,new YAHOO.widget.SliderThumb(G,F,I,H,0,0,E),"horiz");},getVertSlider:function(G,H,E,I,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,0,0,E,I,F),"vert");},getSliderRegion:function(G,H,J,I,E,K,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,J,I,E,K,F),"region");},SOURCE_UI_EVENT:1,SOURCE_SET_VALUE:2,SOURCE_KEY_EVENT:3,ANIM_AVAIL:false},true);YAHOO.extend(C,YAHOO.util.DragDrop,{_mouseDown:false,dragOnly:true,initSlider:function(E){this.type=E;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=C.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(F){var E=this;this.thumb=F;F.cacheBetweenDrags=true;if(F._isHoriz&&F.xTicks&&F.xTicks.length){this.tickPause=Math.round(360/F.xTicks.length);}else{if(F.yTicks&&F.yTicks.length){this.tickPause=Math.round(360/F.yTicks.length);}}F.onAvailable=function(){return E.setStartSliderState();};F.onMouseDown=function(){E._mouseDown=true;return E.focus();};F.startDrag=function(){E._slideStart();};F.onDrag=function(){E.fireEvents(true);};F.onMouseUp=function(){E.thumbMouseUp();};},onAvailable:function(){this._bindKeyEvents();},_bindKeyEvents:function(){A.on(this.id,"keydown",this.handleKeyDown,this,true);A.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(F){if(this.enableKeys){var E=A.getCharCode(F);switch(E){case 37:case 38:case 39:case 40:case 36:case 35:A.preventDefault(F);break;default:}}},handleKeyDown:function(J){if(this.enableKeys){var G=A.getCharCode(J),F=this.thumb,H=this.getXValue(),E=this.getYValue(),I=true;switch(G){case 37:H-=this.keyIncrement;break;case 38:E-=this.keyIncrement;break;case 39:H+=this.keyIncrement;break;case 40:E+=this.keyIncrement;break;case 36:H=F.leftConstraint;E=F.topConstraint;break;case 35:H=F.rightConstraint;E=F.bottomConstraint;break;default:I=false;}if(I){if(F._isRegion){this._setRegionValue(C.SOURCE_KEY_EVENT,H,E,true);}else{this._setValue(C.SOURCE_KEY_EVENT,(F._isHoriz?H:E),true);}A.stopEvent(J);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=B(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this._setRegionValue.apply(this,this.deferredSetRegionValue);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this._setValue.apply(this,this.deferredSetValue);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var E=this.thumb.getEl();if(E){this.thumbCenterPoint={x:parseInt(E.offsetWidth/2,10),y:parseInt(E.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){this._mouseDown=false;if(!this.isLocked()&&!this.moveComplete){this.endMove();}},onMouseUp:function(){this._mouseDown=false;if(this.backgroundEnabled&&!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=C.SOURCE_UI_EVENT;var E=this.getEl();if(E.focus){try{E.focus();}catch(F){}}this.verifyOffset();return !this.isLocked();},onChange:function(E,F){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},setValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setValue.apply(this,E);},_setValue:function(I,L,G,H,E){var F=this.thumb,K,J;if(!F.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!H){return false;}if(isNaN(L)){return false;}if(F._isRegion){return false;}this._silent=E;this.valueChangeSource=I||C.SOURCE_SET_VALUE;F.lastOffset=[L,L];this.verifyOffset(true);this._slideStart();if(F._isHoriz){K=F.initPageX+L+this.thumbCenterPoint.x;this.moveThumb(K,F.initPageY,G);}else{J=F.initPageY+L+this.thumbCenterPoint.y;this.moveThumb(F.initPageX,J,G);}return true;},setRegionValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setRegionValue.apply(this,E);},_setRegionValue:function(F,J,H,I,G,K){var L=this.thumb,E,M;if(!L.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!G){return false;}if(isNaN(J)){return false;}if(!L._isRegion){return false;}this._silent=K;this.valueChangeSource=F||C.SOURCE_SET_VALUE;L.lastOffset=[J,H];this.verifyOffset(true);this._slideStart();E=L.initPageX+J+this.thumbCenterPoint.x;M=L.initPageY+H+this.thumbCenterPoint.y;this.moveThumb(E,M,I);return true;},verifyOffset:function(F){var G=B(this.getEl()),E=this.thumb;if(!this.thumbCenterPoint||!this.thumbCenterPoint.x){this.setThumbCenterPoint();}if(G){if(G[0]!=this.baselinePos[0]||G[1]!=this.baselinePos[1]){this.setInitPosition();this.baselinePos=G;E.initPageX=this.initPageX+E.startOffset[0];E.initPageY=this.initPageY+E.startOffset[1];E.deltaSetXY=null;this.resetThumbConstraints();return false;}}return true;},moveThumb:function(K,J,I,G){var L=this.thumb,M=this,F,E,H;if(!L.available){return;}L.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);E=L.getTargetCoord(K,J);F=[Math.round(E.x),Math.round(E.y)];if(this.animate&&L._graduated&&!I){this.lock();this.curCoord=B(this.thumb.getEl());this.curCoord=[Math.round(this.curCoord[0]),Math.round(this.curCoord[1])];setTimeout(function(){M.moveOneTick(F); },this.tickPause);}else{if(this.animate&&C.ANIM_AVAIL&&!I){this.lock();H=new YAHOO.util.Motion(L.id,{points:{to:F}},this.animationDuration,YAHOO.util.Easing.easeOut);H.onComplete.subscribe(function(){M.unlock();if(!M._mouseDown){M.endMove();}});H.animate();}else{L.setDragElPos(K,J);if(!G&&!this._mouseDown){this.endMove();}}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();this.fireEvent("slideStart");}this._sliding=true;}},_slideEnd:function(){if(this._sliding&&this.moveComplete){var E=this._silent;this._sliding=false;this._silent=false;this.moveComplete=false;if(!E){this.onSlideEnd();this.fireEvent("slideEnd");}}},moveOneTick:function(F){var H=this.thumb,G=this,I=null,E,J;if(H._isRegion){I=this._getNextX(this.curCoord,F);E=(I!==null)?I[0]:this.curCoord[0];I=this._getNextY(this.curCoord,F);J=(I!==null)?I[1]:this.curCoord[1];I=E!==this.curCoord[0]||J!==this.curCoord[1]?[E,J]:null;}else{if(H._isHoriz){I=this._getNextX(this.curCoord,F);}else{I=this._getNextY(this.curCoord,F);}}if(I){this.curCoord=I;this.thumb.alignElWithMouse(H.getEl(),I[0]+this.thumbCenterPoint.x,I[1]+this.thumbCenterPoint.y);if(!(I[0]==F[0]&&I[1]==F[1])){setTimeout(function(){G.moveOneTick(F);},this.tickPause);}else{this.unlock();if(!this._mouseDown){this.endMove();}}}else{this.unlock();if(!this._mouseDown){this.endMove();}}},_getNextX:function(E,F){var H=this.thumb,J,G=[],I=null;if(E[0]>F[0]){J=H.tickSize-this.thumbCenterPoint.x;G=H.getTargetCoord(E[0]-J,E[1]);I=[G.x,G.y];}else{if(E[0]<F[0]){J=H.tickSize+this.thumbCenterPoint.x;G=H.getTargetCoord(E[0]+J,E[1]);I=[G.x,G.y];}else{}}return I;},_getNextY:function(E,F){var H=this.thumb,J,G=[],I=null;if(E[1]>F[1]){J=H.tickSize-this.thumbCenterPoint.y;G=H.getTargetCoord(E[0],E[1]-J);I=[G.x,G.y];}else{if(E[1]<F[1]){J=H.tickSize+this.thumbCenterPoint.y;G=H.getTargetCoord(E[0],E[1]+J);I=[G.x,G.y];}else{}}return I;},b4MouseDown:function(E){if(!this.backgroundEnabled){return false;}this.thumb.autoOffset();this.resetThumbConstraints();},onMouseDown:function(F){if(!this.backgroundEnabled||this.isLocked()){return false;}this._mouseDown=true;var E=A.getPageX(F),G=A.getPageY(F);this.focus();this._slideStart();this.moveThumb(E,G);},onDrag:function(F){if(this.backgroundEnabled&&!this.isLocked()){var E=A.getPageX(F),G=A.getPageY(F);this.moveThumb(E,G,true,true);this.fireEvents();}},endMove:function(){this.unlock();this.fireEvents();this.moveComplete=true;this._slideEnd();},resetThumbConstraints:function(){var E=this.thumb;E.setXConstraint(E.leftConstraint,E.rightConstraint,E.xTickSize);E.setYConstraint(E.topConstraint,E.bottomConstraint,E.xTickSize);},fireEvents:function(G){var F=this.thumb,I,H,E;if(!G){F.cachePosition();}if(!this.isLocked()){if(F._isRegion){I=F.getXValue();H=F.getYValue();if(I!=this.previousX||H!=this.previousY){if(!this._silent){this.onChange(I,H);this.fireEvent("change",{x:I,y:H});}}this.previousX=I;this.previousY=H;}else{E=F.getValue();if(E!=this.previousVal){if(!this._silent){this.onChange(E);this.fireEvent("change",E);}}this.previousVal=E;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.lang.augmentProto(C,YAHOO.util.EventProvider);YAHOO.widget.Slider=C;})();YAHOO.widget.SliderThumb=function(G,B,E,D,A,F,C){if(G){YAHOO.widget.SliderThumb.superclass.constructor.call(this,G,B);this.parentElId=B;}this.isTarget=false;this.tickSize=C;this.maintainOffset=true;this.initSlider(E,D,A,F,C);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,dragOnly:true,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(C){var A=YAHOO.util.Dom.getXY(this.getEl()),B=C||YAHOO.util.Dom.getXY(this.parentElId);return[(A[0]-B[0]),(A[1]-B[1])];},getOffsetFromParent:function(H){var A=this.getEl(),E,I,F,B,K,D,C,J,G;if(!this.deltaOffset){I=YAHOO.util.Dom.getXY(A);F=H||YAHOO.util.Dom.getXY(this.parentElId);E=[(I[0]-F[0]),(I[1]-F[1])];B=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);K=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);D=B-E[0];C=K-E[1];if(isNaN(D)||isNaN(C)){}else{this.deltaOffset=[D,C];}}else{J=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);G=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);E=[J+this.deltaOffset[0],G+this.deltaOffset[1]];}return E;},initSlider:function(D,C,A,E,B){this.initLeft=D;this.initRight=C;this.initUp=A;this.initDown=E;this.setXConstraint(D,C,B);this.setYConstraint(A,E,B);if(B&&B>1){this._graduated=true;}this._isHoriz=(D||C);this._isVert=(A||E);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[0])){this.lastOffset=A;return(A[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[1])){this.lastOffset=A;return(A[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(A,B){}});(function(){var A=YAHOO.util.Event,B=YAHOO.widget;function C(I,F,H,D){var G=this,J={min:false,max:false},E,K;this.minSlider=I;this.maxSlider=F;this.activeSlider=I;this.isHoriz=I.thumb._isHoriz;E=this.minSlider.thumb.onMouseDown;K=this.maxSlider.thumb.onMouseDown;this.minSlider.thumb.onMouseDown=function(){G.activeSlider=G.minSlider;E.apply(this,arguments);};this.maxSlider.thumb.onMouseDown=function(){G.activeSlider=G.maxSlider;K.apply(this,arguments);};this.minSlider.thumb.onAvailable=function(){I.setStartSliderState();J.min=true;if(J.max){G.fireEvent("ready",G);}};this.maxSlider.thumb.onAvailable=function(){F.setStartSliderState();J.max=true;if(J.min){G.fireEvent("ready",G);}};I.onMouseDown=F.onMouseDown=function(L){return this.backgroundEnabled&&G._handleMouseDown(L); };I.onDrag=F.onDrag=function(L){G._handleDrag(L);};I.onMouseUp=F.onMouseUp=function(L){G._handleMouseUp(L);};I._bindKeyEvents=function(){G._bindKeyEvents(this);};F._bindKeyEvents=function(){};I.subscribe("change",this._handleMinChange,I,this);I.subscribe("slideStart",this._handleSlideStart,I,this);I.subscribe("slideEnd",this._handleSlideEnd,I,this);F.subscribe("change",this._handleMaxChange,F,this);F.subscribe("slideStart",this._handleSlideStart,F,this);F.subscribe("slideEnd",this._handleSlideEnd,F,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);D=YAHOO.lang.isArray(D)?D:[0,H];D[0]=Math.min(Math.max(parseInt(D[0],10)|0,0),H);D[1]=Math.max(Math.min(parseInt(D[1],10)|0,H),0);if(D[0]>D[1]){D.splice(0,2,D[1],D[0]);}this.minVal=D[0];this.maxVal=D[1];this.minSlider.setValue(this.minVal,true,true,true);this.maxSlider.setValue(this.maxVal,true,true,true);}C.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(E,D){this.fireEvent("slideStart",D);},_handleSlideEnd:function(E,D){this.fireEvent("slideEnd",D);},_handleDrag:function(D){B.Slider.prototype.onDrag.call(this.activeSlider,D);},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},_bindKeyEvents:function(D){A.on(D.id,"keydown",this._handleKeyDown,this,true);A.on(D.id,"keypress",this._handleKeyPress,this,true);},_handleKeyDown:function(D){this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments);},_handleKeyPress:function(D){this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments);},setValues:function(H,K,I,E,J){var F=this.minSlider,M=this.maxSlider,D=F.thumb,L=M.thumb,N=this,G={min:false,max:false};if(D._isHoriz){D.setXConstraint(D.leftConstraint,L.rightConstraint,D.tickSize);L.setXConstraint(D.leftConstraint,L.rightConstraint,L.tickSize);}else{D.setYConstraint(D.topConstraint,L.bottomConstraint,D.tickSize);L.setYConstraint(D.topConstraint,L.bottomConstraint,L.tickSize);}this._oneTimeCallback(F,"slideEnd",function(){G.min=true;if(G.max){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});this._oneTimeCallback(M,"slideEnd",function(){G.max=true;if(G.min){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});F.setValue(H,I,E,false);M.setValue(K,I,E,false);},setMinValue:function(F,H,I,E){var G=this.minSlider,D=this;this.activeSlider=G;D=this;this._oneTimeCallback(G,"slideEnd",function(){D.updateValue(E);setTimeout(function(){D._cleanEvent(G,"slideEnd");},0);});G.setValue(F,H,I);},setMaxValue:function(D,H,I,F){var G=this.maxSlider,E=this;this.activeSlider=G;this._oneTimeCallback(G,"slideEnd",function(){E.updateValue(F);setTimeout(function(){E._cleanEvent(G,"slideEnd");},0);});G.setValue(D,H,I);},updateValue:function(J){var E=this.minSlider.getValue(),K=this.maxSlider.getValue(),F=false,D,M,H,I,L,G;if(E!=this.minVal||K!=this.maxVal){F=true;D=this.minSlider.thumb;M=this.maxSlider.thumb;H=this.isHoriz?"x":"y";G=this.minSlider.thumbCenterPoint[H]+this.maxSlider.thumbCenterPoint[H];I=Math.max(K-G-this.minRange,0);L=Math.min(-E-G-this.minRange,0);if(this.isHoriz){I=Math.min(I,M.rightConstraint);D.setXConstraint(D.leftConstraint,I,D.tickSize);M.setXConstraint(L,M.rightConstraint,M.tickSize);}else{I=Math.min(I,M.bottomConstraint);D.setYConstraint(D.leftConstraint,I,D.tickSize);M.setYConstraint(L,M.bottomConstraint,M.tickSize);}}this.minVal=E;this.maxVal=K;if(F&&!J){this.fireEvent("change",this);}},selectActiveSlider:function(H){var E=this.minSlider,D=this.maxSlider,J=E.isLocked()||!E.backgroundEnabled,G=D.isLocked()||!E.backgroundEnabled,F=YAHOO.util.Event,I;if(J||G){this.activeSlider=J?D:E;}else{if(this.isHoriz){I=F.getPageX(H)-E.thumb.initPageX-E.thumbCenterPoint.x;}else{I=F.getPageY(H)-E.thumb.initPageY-E.thumbCenterPoint.y;}this.activeSlider=I*2>D.getValue()+E.getValue()?D:E;}},_handleMouseDown:function(D){if(!D._handled){D._handled=true;this.selectActiveSlider(D);return B.Slider.prototype.onMouseDown.call(this.activeSlider,D);}else{return false;}},_handleMouseUp:function(D){B.Slider.prototype.onMouseUp.apply(this.activeSlider,arguments);},_oneTimeCallback:function(F,D,E){F.subscribe(D,function(){F.unsubscribe(D,arguments.callee);E.apply({},[].slice.apply(arguments));});},_cleanEvent:function(K,E){var J,I,D,G,H,F;if(K.__yui_events&&K.events[E]){for(I=K.__yui_events.length;I>=0;--I){if(K.__yui_events[I].type===E){J=K.__yui_events[I];break;}}if(J){H=J.subscribers;F=[];G=0;for(I=0,D=H.length;I<D;++I){if(H[I]){F[G++]=H[I];}}J.subscribers=F;}}}};YAHOO.lang.augmentProto(C,YAHOO.util.EventProvider);B.Slider.getHorizDualSlider=function(H,J,K,G,F,D){var I=new B.SliderThumb(J,H,0,G,0,0,F),E=new B.SliderThumb(K,H,0,G,0,0,F);return new C(new B.Slider(H,H,I,"horiz"),new B.Slider(H,H,E,"horiz"),G,D);};B.Slider.getVertDualSlider=function(H,J,K,G,F,D){var I=new B.SliderThumb(J,H,0,0,0,G,F),E=new B.SliderThumb(K,H,0,0,0,G,F);return new B.DualSlider(new B.Slider(H,H,I,"vert"),new B.Slider(H,H,E,"vert"),G,D);};YAHOO.widget.DualSlider=C;})();YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name);}return A;},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};if(C){this._written=false;}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null;}return B.getValue();},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B;}}return C;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,C=YAHOO.util.AttributeProvider;var A=function(D,E){this.init.apply(this,arguments);};A.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true,"change":true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(F,D){var E=this.get("element");if(E){E[D]=F;}},DEFAULT_HTML_GETTER:function(D){var E=this.get("element"),F;if(E){F=E[D];}return F;},appendChild:function(D){D=D.get?D.get("element"):D;return this.get("element").appendChild(D);},getElementsByTagName:function(D){return this.get("element").getElementsByTagName(D);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(D,E){D=D.get?D.get("element"):D;E=(E&&E.get)?E.get("element"):E;return this.get("element").insertBefore(D,E);},removeChild:function(D){D=D.get?D.get("element"):D;return this.get("element").removeChild(D);},replaceChild:function(D,E){D=D.get?D.get("element"):D;E=E.get?E.get("element"):E;return this.get("element").replaceChild(D,E);},initAttributes:function(D){},addListener:function(H,G,I,F){var E=this.get("element")||this.get("id");F=F||this;var D=this;if(!this._events[H]){if(E&&this.DOM_EVENTS[H]){YAHOO.util.Event.addListener(E,H,function(J){if(J.srcElement&&!J.target){J.target=J.srcElement;}D.fireEvent(H,J);},I,F);}this.createEvent(H,this);}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){return this.addListener.apply(this,arguments);},subscribe:function(){return this.addListener.apply(this,arguments);},removeListener:function(E,D){return this.unsubscribe.apply(this,arguments);},addClass:function(D){B.addClass(this.get("element"),D);},getElementsByClassName:function(E,D){return B.getElementsByClassName(E,D,this.get("element"));},hasClass:function(D){return B.hasClass(this.get("element"),D);},removeClass:function(D){return B.removeClass(this.get("element"),D);},replaceClass:function(E,D){return B.replaceClass(this.get("element"),E,D);},setStyle:function(E,D){return B.setStyle(this.get("element"),E,D);},getStyle:function(D){return B.getStyle(this.get("element"),D);},fireQueue:function(){var E=this._queue;for(var F=0,D=E.length;F<D;++F){this[E[F][0]].apply(this,E[F][1]);}},appendTo:function(E,F){E=(E.get)?E.get("element"):B.get(E);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:E}); F=(F&&F.get)?F.get("element"):B.get(F);var D=this.get("element");if(!D){return false;}if(!E){return false;}if(D.parent!=E){if(F){E.insertBefore(D,F);}else{E.appendChild(D);}}this.fireEvent("appendTo",{type:"appendTo",target:E});return D;},get:function(D){var F=this._configs||{},E=F.element;if(E&&!F[D]&&!YAHOO.lang.isUndefined(E.value[D])){this._setHTMLAttrConfig(D);}return C.prototype.get.call(this,D);},setAttributes:function(J,G){var E={},H=this._configOrder;for(var I=0,D=H.length;I<D;++I){if(J[H[I]]!==undefined){E[H[I]]=true;this.set(H[I],J[H[I]],G);}}for(var F in J){if(J.hasOwnProperty(F)&&!E[F]){this.set(F,J[F],G);}}},set:function(E,G,D){var F=this.get("element");if(!F){this._queue[this._queue.length]=["set",arguments];if(this._configs[E]){this._configs[E].value=G;}return;}if(!this._configs[E]&&!YAHOO.lang.isUndefined(F[E])){this._setHTMLAttrConfig(E);}return C.prototype.set.apply(this,arguments);},setAttributeConfig:function(D,E,F){this._configOrder.push(D);C.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(E,D){this._events[E]=true;return C.prototype.createEvent.apply(this,arguments);},init:function(E,D){this._initElement(E,D);},destroy:function(){var D=this.get("element");YAHOO.util.Event.purgeElement(D,true);this.unsubscribeAll();if(D&&D.parentNode){D.parentNode.removeChild(D);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(F,E){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];E=E||{};E.element=E.element||F||null;var H=false;var D=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var G in D){if(D.hasOwnProperty(G)){this.DOM_EVENTS[G]=D[G];}}if(typeof E.element==="string"){this._setHTMLAttrConfig("id",{value:E.element});}if(B.get(E.element)){H=true;this._initHTMLElement(E);this._initContent(E);}YAHOO.util.Event.onAvailable(E.element,function(){if(!H){this._initHTMLElement(E);}this.fireEvent("available",{type:"available",target:B.get(E.element)});},this,true);YAHOO.util.Event.onContentReady(E.element,function(){if(!H){this._initContent(E);}this.fireEvent("contentReady",{type:"contentReady",target:B.get(E.element)});},this,true);},_initHTMLElement:function(D){this.setAttributeConfig("element",{value:B.get(D.element),readOnly:true});},_initContent:function(D){this.initAttributes(D);this.setAttributes(D,true);this.fireQueue();},_setHTMLAttrConfig:function(D,F){var E=this.get("element");F=F||{};F.name=D;F.setter=F.setter||this.DEFAULT_HTML_SETTER;F.getter=F.getter||this.DEFAULT_HTML_GETTER;F.value=F.value||E[D];this._configs[D]=new YAHOO.util.Attribute(F,this);}};YAHOO.augment(A,C);YAHOO.util.Element=A;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.7.0",build:"1796"});/* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ YAHOO.util.Color=function(){var A="0",B=YAHOO.lang.isArray,C=YAHOO.lang.isNumber;return{real2dec:function(D){return Math.min(255,Math.round(D*256));},hsv2rgb:function(H,O,M){if(B(H)){return this.hsv2rgb.call(this,H[0],H[1],H[2]);}var D,I,L,G=Math.floor((H/60)%6),J=(H/60)-G,F=M*(1-O),E=M*(1-J*O),N=M*(1-(1-J)*O),K;switch(G){case 0:D=M;I=N;L=F;break;case 1:D=E;I=M;L=F;break;case 2:D=F;I=M;L=N;break;case 3:D=F;I=E;L=M;break;case 4:D=N;I=F;L=M;break;case 5:D=M;I=F;L=E;break;}K=this.real2dec;return[K(D),K(I),K(L)];},rgb2hsv:function(D,H,I){if(B(D)){return this.rgb2hsv.apply(this,D);}D/=255;H/=255;I/=255;var G,L,E=Math.min(Math.min(D,H),I),J=Math.max(Math.max(D,H),I),K=J-E,F;switch(J){case E:G=0;break;case D:G=60*(H-I)/K;if(H<I){G+=360;}break;case H:G=(60*(I-D)/K)+120;break;case I:G=(60*(D-H)/K)+240;break;}L=(J===0)?0:1-(E/J);F=[Math.round(G),L,J];return F;},rgb2hex:function(F,E,D){if(B(F)){return this.rgb2hex.apply(this,F);}var G=this.dec2hex;return G(F)+G(E)+G(D);},dec2hex:function(D){D=parseInt(D,10)|0;D=(D>255||D<0)?0:D;return(A+D.toString(16)).slice(-2).toUpperCase();},hex2dec:function(D){return parseInt(D,16);},hex2rgb:function(D){var E=this.hex2dec;return[E(D.slice(0,2)),E(D.slice(2,4)),E(D.slice(4,6))];},websafe:function(F,E,D){if(B(F)){return this.websafe.apply(this,F);}var G=function(H){if(C(H)){H=Math.min(Math.max(0,H),255);var I,J;for(I=0;I<256;I=I+51){J=I+51;if(H>=I&&H<=J){return(H-I>25)?J:I;}}}return H;};return[G(F),G(E),G(D)];}};}();(function(){var J=0,F=YAHOO.util,C=YAHOO.lang,D=YAHOO.widget.Slider,B=F.Color,E=F.Dom,I=F.Event,A=C.substitute,H="yui-picker";function G(L,K){J=J+1;K=K||{};if(arguments.length===1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element||null;}if(!L&&!K.element){L=this._createHostElement(K);}G.superclass.constructor.call(this,L,K);this.initPicker();}YAHOO.extend(G,YAHOO.util.Element,{ID:{R:H+"-r",R_HEX:H+"-rhex",G:H+"-g",G_HEX:H+"-ghex",B:H+"-b",B_HEX:H+"-bhex",H:H+"-h",S:H+"-s",V:H+"-v",PICKER_BG:H+"-bg",PICKER_THUMB:H+"-thumb",HUE_BG:H+"-hue-bg",HUE_THUMB:H+"-hue-thumb",HEX:H+"-hex",SWATCH:H+"-swatch",WEBSAFE_SWATCH:H+"-websafe-swatch",CONTROLS:H+"-controls",RGB_CONTROLS:H+"-rgb-controls",HSV_CONTROLS:H+"-hsv-controls",HEX_CONTROLS:H+"-hex-controls",HEX_SUMMARY:H+"-hex-summary",CONTROLS_LABEL:H+"-controls-label"},TXT:{ILLEGAL_HEX:"Illegal hex value entered",SHOW_CONTROLS:"Show color details",HIDE_CONTROLS:"Hide color details",CURRENT_COLOR:"Currently selected color: {rgb}",CLOSEST_WEBSAFE:"Closest websafe color: {rgb}. Click to select.",R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"},IMAGE:{PICKER_THUMB:"../../build/colorpicker/assets/picker_thumb.png",HUE_THUMB:"../../build/colorpicker/assets/hue_thumb.png"},DEFAULT:{PICKER_SIZE:180},OPT:{HUE:"hue",SATURATION:"saturation",VALUE:"value",RED:"red",GREEN:"green",BLUE:"blue",HSV:"hsv",RGB:"rgb",WEBSAFE:"websafe",HEX:"hex",PICKER_SIZE:"pickersize",SHOW_CONTROLS:"showcontrols",SHOW_RGB_CONTROLS:"showrgbcontrols",SHOW_HSV_CONTROLS:"showhsvcontrols",SHOW_HEX_CONTROLS:"showhexcontrols",SHOW_HEX_SUMMARY:"showhexsummary",SHOW_WEBSAFE:"showwebsafe",CONTAINER:"container",IDS:"ids",ELEMENTS:"elements",TXT:"txt",IMAGES:"images",ANIMATE:"animate"},skipAnim:true,_createHostElement:function(){var K=document.createElement("div");if(this.CSS.BASE){K.className=this.CSS.BASE;}return K;},_updateHueSlider:function(){var K=this.get(this.OPT.PICKER_SIZE),L=this.get(this.OPT.HUE);L=K-Math.round(L/360*K);if(L===K){L=0;}this.hueSlider.setValue(L,this.skipAnim);},_updatePickerSlider:function(){var L=this.get(this.OPT.PICKER_SIZE),M=this.get(this.OPT.SATURATION),K=this.get(this.OPT.VALUE);M=Math.round(M*L/100);K=Math.round(L-(K*L/100));this.pickerSlider.setRegionValue(M,K,this.skipAnim);},_updateSliders:function(){this._updateHueSlider();this._updatePickerSlider();},setValue:function(L,K){K=(K)||false;this.set(this.OPT.RGB,L,K);this._updateSliders();},hueSlider:null,pickerSlider:null,_getH:function(){var K=this.get(this.OPT.PICKER_SIZE),L=(K-this.hueSlider.getValue())/K;L=Math.round(L*360);return(L===360)?0:L;},_getS:function(){return this.pickerSlider.getXValue()/this.get(this.OPT.PICKER_SIZE);},_getV:function(){var K=this.get(this.OPT.PICKER_SIZE);return(K-this.pickerSlider.getYValue())/K;},_updateSwatch:function(){var M=this.get(this.OPT.RGB),O=this.get(this.OPT.WEBSAFE),N=this.getElement(this.ID.SWATCH),L=M.join(","),K=this.get(this.OPT.TXT);E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CURRENT_COLOR,{"rgb":"#"+this.get(this.OPT.HEX)});N=this.getElement(this.ID.WEBSAFE_SWATCH);L=O.join(",");E.setStyle(N,"background-color","rgb("+L+")");N.title=A(K.CLOSEST_WEBSAFE,{"rgb":"#"+B.rgb2hex(O)});},_getValuesFromSliders:function(){this.set(this.OPT.RGB,B.hsv2rgb(this._getH(),this._getS(),this._getV()));},_updateFormFields:function(){this.getElement(this.ID.H).value=this.get(this.OPT.HUE);this.getElement(this.ID.S).value=this.get(this.OPT.SATURATION);this.getElement(this.ID.V).value=this.get(this.OPT.VALUE);this.getElement(this.ID.R).value=this.get(this.OPT.RED);this.getElement(this.ID.R_HEX).innerHTML=B.dec2hex(this.get(this.OPT.RED));this.getElement(this.ID.G).value=this.get(this.OPT.GREEN);this.getElement(this.ID.G_HEX).innerHTML=B.dec2hex(this.get(this.OPT.GREEN));this.getElement(this.ID.B).value=this.get(this.OPT.BLUE);this.getElement(this.ID.B_HEX).innerHTML=B.dec2hex(this.get(this.OPT.BLUE));this.getElement(this.ID.HEX).value=this.get(this.OPT.HEX);},_onHueSliderChange:function(N){var L=this._getH(),K=B.hsv2rgb(L,1,1),M="rgb("+K.join(",")+")";this.set(this.OPT.HUE,L,true);E.setStyle(this.getElement(this.ID.PICKER_BG),"background-color",M);if(this.hueSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders();}this._updateFormFields();this._updateSwatch();},_onPickerSliderChange:function(M){var L=this._getS(),K=this._getV();this.set(this.OPT.SATURATION,Math.round(L*100),true);this.set(this.OPT.VALUE,Math.round(K*100),true);if(this.pickerSlider.valueChangeSource!==D.SOURCE_SET_VALUE){this._getValuesFromSliders(); }this._updateFormFields();this._updateSwatch();},_getCommand:function(K){var L=I.getCharCode(K);if(L===38){return 3;}else{if(L===13){return 6;}else{if(L===40){return 4;}else{if(L>=48&&L<=57){return 1;}else{if(L>=97&&L<=102){return 2;}else{if(L>=65&&L<=70){return 2;}else{if("8, 9, 13, 27, 37, 39".indexOf(L)>-1||K.ctrlKey||K.metaKey){return 5;}else{return 0;}}}}}}}},_useFieldValue:function(L,K,N){var M=K.value;if(N!==this.OPT.HEX){M=parseInt(M,10);}if(M!==this.get(N)){this.set(N,M);}},_rgbFieldKeypress:function(M,K,O){var N=this._getCommand(M),L=(M.shiftKey)?10:1;switch(N){case 6:this._useFieldValue.apply(this,arguments);break;case 3:this.set(O,Math.min(this.get(O)+L,255));this._updateFormFields();break;case 4:this.set(O,Math.max(this.get(O)-L,0));this._updateFormFields();break;default:}},_hexFieldKeypress:function(L,K,N){var M=this._getCommand(L);if(M===6){this._useFieldValue.apply(this,arguments);}},_hexOnly:function(L,K){var M=this._getCommand(L);switch(M){case 6:case 5:case 1:break;case 2:if(K!==true){break;}default:I.stopEvent(L);return false;}},_numbersOnly:function(K){return this._hexOnly(K,true);},getElement:function(K){return this.get(this.OPT.ELEMENTS)[this.get(this.OPT.IDS)[K]];},_createElements:function(){var N,M,P,O,L,K=this.get(this.OPT.IDS),Q=this.get(this.OPT.TXT),S=this.get(this.OPT.IMAGES),R=function(U,V){var W=document.createElement(U);if(V){C.augmentObject(W,V,true);}return W;},T=function(U,V){var W=C.merge({autocomplete:"off",value:"0",size:3,maxlength:3},V);W.name=W.id;return new R(U,W);};L=this.get("element");N=new R("div",{id:K[this.ID.PICKER_BG],className:"yui-picker-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.PICKER_THUMB],className:"yui-picker-thumb"});P=new R("img",{src:S.PICKER_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HUE_BG],className:"yui-picker-hue-bg",tabIndex:-1,hideFocus:true});M=new R("div",{id:K[this.ID.HUE_THUMB],className:"yui-picker-hue-thumb"});P=new R("img",{src:S.HUE_THUMB});M.appendChild(P);N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.CONTROLS],className:"yui-picker-controls"});L.appendChild(N);L=N;N=new R("div",{className:"hd"});M=new R("a",{id:K[this.ID.CONTROLS_LABEL],href:"#"});N.appendChild(M);L.appendChild(N);N=new R("div",{className:"bd"});L.appendChild(N);L=N;N=new R("ul",{id:K[this.ID.RGB_CONTROLS],className:"yui-picker-rgb-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.R+" "));O=new T("input",{id:K[this.ID.R],className:"yui-picker-r"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.G+" "));O=new T("input",{id:K[this.ID.G],className:"yui-picker-g"});M.appendChild(O);N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.B+" "));O=new T("input",{id:K[this.ID.B],className:"yui-picker-b"});M.appendChild(O);N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HSV_CONTROLS],className:"yui-picker-hsv-controls"});M=new R("li");M.appendChild(document.createTextNode(Q.H+" "));O=new T("input",{id:K[this.ID.H],className:"yui-picker-h"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.DEG));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.S+" "));O=new T("input",{id:K[this.ID.S],className:"yui-picker-s"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);M=new R("li");M.appendChild(document.createTextNode(Q.V+" "));O=new T("input",{id:K[this.ID.V],className:"yui-picker-v"});M.appendChild(O);M.appendChild(document.createTextNode(" "+Q.PERCENT));N.appendChild(M);L.appendChild(N);N=new R("ul",{id:K[this.ID.HEX_SUMMARY],className:"yui-picker-hex_summary"});M=new R("li",{id:K[this.ID.R_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.G_HEX]});N.appendChild(M);M=new R("li",{id:K[this.ID.B_HEX]});N.appendChild(M);L.appendChild(N);N=new R("div",{id:K[this.ID.HEX_CONTROLS],className:"yui-picker-hex-controls"});N.appendChild(document.createTextNode(Q.HEX+" "));M=new T("input",{id:K[this.ID.HEX],className:"yui-picker-hex",size:6,maxlength:6});N.appendChild(M);L.appendChild(N);L=this.get("element");N=new R("div",{id:K[this.ID.SWATCH],className:"yui-picker-swatch"});L.appendChild(N);N=new R("div",{id:K[this.ID.WEBSAFE_SWATCH],className:"yui-picker-websafe-swatch"});L.appendChild(N);},_attachRGBHSV:function(L,K){I.on(this.getElement(L),"keydown",function(N,M){M._rgbFieldKeypress(N,this,K);},this);I.on(this.getElement(L),"keypress",this._numbersOnly,this,true);I.on(this.getElement(L),"blur",function(N,M){M._useFieldValue(N,this,K);},this);},_updateRGB:function(){var K=[this.get(this.OPT.RED),this.get(this.OPT.GREEN),this.get(this.OPT.BLUE)];this.set(this.OPT.RGB,K);this._updateSliders();},_initElements:function(){var O=this.OPT,N=this.get(O.IDS),L=this.get(O.ELEMENTS),K,M,P;for(K in this.ID){if(C.hasOwnProperty(this.ID,K)){N[this.ID[K]]=N[K];}}M=E.get(N[this.ID.PICKER_BG]);if(!M){this._createElements();}else{}for(K in N){if(C.hasOwnProperty(N,K)){M=E.get(N[K]);P=E.generateId(M);N[K]=P;N[N[K]]=P;L[P]=M;}}},initPicker:function(){this._initSliders();this._bindUI();this.syncUI(true);},_initSliders:function(){var K=this.ID,L=this.get(this.OPT.PICKER_SIZE);this.hueSlider=D.getVertSlider(this.getElement(K.HUE_BG),this.getElement(K.HUE_THUMB),0,L);this.pickerSlider=D.getSliderRegion(this.getElement(K.PICKER_BG),this.getElement(K.PICKER_THUMB),0,L,0,L);this.set(this.OPT.ANIMATE,this.get(this.OPT.ANIMATE));},_bindUI:function(){var K=this.ID,L=this.OPT;this.hueSlider.subscribe("change",this._onHueSliderChange,this,true);this.pickerSlider.subscribe("change",this._onPickerSliderChange,this,true);I.on(this.getElement(K.WEBSAFE_SWATCH),"click",function(M){this.setValue(this.get(L.WEBSAFE));},this,true);I.on(this.getElement(K.CONTROLS_LABEL),"click",function(M){this.set(L.SHOW_CONTROLS,!this.get(L.SHOW_CONTROLS));I.preventDefault(M);},this,true);this._attachRGBHSV(K.R,L.RED);this._attachRGBHSV(K.G,L.GREEN);this._attachRGBHSV(K.B,L.BLUE);this._attachRGBHSV(K.H,L.HUE); this._attachRGBHSV(K.S,L.SATURATION);this._attachRGBHSV(K.V,L.VALUE);I.on(this.getElement(K.HEX),"keydown",function(N,M){M._hexFieldKeypress(N,this,L.HEX);},this);I.on(this.getElement(this.ID.HEX),"keypress",this._hexOnly,this,true);I.on(this.getElement(this.ID.HEX),"blur",function(N,M){M._useFieldValue(N,this,L.HEX);},this);},syncUI:function(K){this.skipAnim=K;this._updateRGB();this.skipAnim=false;},_updateRGBFromHSV:function(){var L=[this.get(this.OPT.HUE),this.get(this.OPT.SATURATION)/100,this.get(this.OPT.VALUE)/100],K=B.hsv2rgb(L);this.set(this.OPT.RGB,K);this._updateSliders();},_updateHex:function(){var N=this.get(this.OPT.HEX),K=N.length,O,M,L;if(K===3){O=N.split("");for(M=0;M<K;M=M+1){O[M]=O[M]+O[M];}N=O.join("");}if(N.length!==6){return false;}L=B.hex2rgb(N);this.setValue(L);},_hideShowEl:function(M,K){var L=(C.isString(M)?this.getElement(M):M);E.setStyle(L,"display",(K)?"":"none");},initAttributes:function(K){K=K||{};G.superclass.initAttributes.call(this,K);this.setAttributeConfig(this.OPT.PICKER_SIZE,{value:K.size||this.DEFAULT.PICKER_SIZE});this.setAttributeConfig(this.OPT.HUE,{value:K.hue||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.SATURATION,{value:K.saturation||0,validator:C.isNumber});this.setAttributeConfig(this.OPT.VALUE,{value:C.isNumber(K.value)?K.value:100,validator:C.isNumber});this.setAttributeConfig(this.OPT.RED,{value:C.isNumber(K.red)?K.red:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.GREEN,{value:C.isNumber(K.green)?K.green:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.BLUE,{value:C.isNumber(K.blue)?K.blue:255,validator:C.isNumber});this.setAttributeConfig(this.OPT.HEX,{value:K.hex||"FFFFFF",validator:C.isString});this.setAttributeConfig(this.OPT.RGB,{value:K.rgb||[255,255,255],method:function(O){this.set(this.OPT.RED,O[0],true);this.set(this.OPT.GREEN,O[1],true);this.set(this.OPT.BLUE,O[2],true);var Q=B.websafe(O),P=B.rgb2hex(O),N=B.rgb2hsv(O);this.set(this.OPT.WEBSAFE,Q,true);this.set(this.OPT.HEX,P,true);if(N[1]){this.set(this.OPT.HUE,N[0],true);}this.set(this.OPT.SATURATION,Math.round(N[1]*100),true);this.set(this.OPT.VALUE,Math.round(N[2]*100),true);},readonly:true});this.setAttributeConfig(this.OPT.CONTAINER,{value:null,method:function(N){if(N){N.showEvent.subscribe(function(){this.pickerSlider.focus();},this,true);}}});this.setAttributeConfig(this.OPT.WEBSAFE,{value:K.websafe||[255,255,255]});var M=K.ids||C.merge({},this.ID),L;if(!K.ids&&J>1){for(L in M){if(C.hasOwnProperty(M,L)){M[L]=M[L]+J;}}}this.setAttributeConfig(this.OPT.IDS,{value:M,writeonce:true});this.setAttributeConfig(this.OPT.TXT,{value:K.txt||this.TXT,writeonce:true});this.setAttributeConfig(this.OPT.IMAGES,{value:K.images||this.IMAGE,writeonce:true});this.setAttributeConfig(this.OPT.ELEMENTS,{value:{},readonly:true});this.setAttributeConfig(this.OPT.SHOW_CONTROLS,{value:C.isBoolean(K.showcontrols)?K.showcontrols:true,method:function(N){var O=E.getElementsByClassName("bd","div",this.getElement(this.ID.CONTROLS))[0];this._hideShowEl(O,N);this.getElement(this.ID.CONTROLS_LABEL).innerHTML=(N)?this.get(this.OPT.TXT).HIDE_CONTROLS:this.get(this.OPT.TXT).SHOW_CONTROLS;}});this.setAttributeConfig(this.OPT.SHOW_RGB_CONTROLS,{value:C.isBoolean(K.showrgbcontrols)?K.showrgbcontrols:true,method:function(N){this._hideShowEl(this.ID.RGB_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_HSV_CONTROLS,{value:C.isBoolean(K.showhsvcontrols)?K.showhsvcontrols:false,method:function(N){this._hideShowEl(this.ID.HSV_CONTROLS,N);if(N&&this.get(this.OPT.SHOW_HEX_SUMMARY)){this.set(this.OPT.SHOW_HEX_SUMMARY,false);}}});this.setAttributeConfig(this.OPT.SHOW_HEX_CONTROLS,{value:C.isBoolean(K.showhexcontrols)?K.showhexcontrols:false,method:function(N){this._hideShowEl(this.ID.HEX_CONTROLS,N);}});this.setAttributeConfig(this.OPT.SHOW_WEBSAFE,{value:C.isBoolean(K.showwebsafe)?K.showwebsafe:true,method:function(N){this._hideShowEl(this.ID.WEBSAFE_SWATCH,N);}});this.setAttributeConfig(this.OPT.SHOW_HEX_SUMMARY,{value:C.isBoolean(K.showhexsummary)?K.showhexsummary:true,method:function(N){this._hideShowEl(this.ID.HEX_SUMMARY,N);if(N&&this.get(this.OPT.SHOW_HSV_CONTROLS)){this.set(this.OPT.SHOW_HSV_CONTROLS,false);}}});this.setAttributeConfig(this.OPT.ANIMATE,{value:C.isBoolean(K.animate)?K.animate:true,method:function(N){if(this.pickerSlider){this.pickerSlider.animate=N;this.hueSlider.animate=N;}}});this.on(this.OPT.HUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.SATURATION+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.VALUE+"Change",this._updateRGBFromHSV,this,true);this.on(this.OPT.RED+"Change",this._updateRGB,this,true);this.on(this.OPT.GREEN+"Change",this._updateRGB,this,true);this.on(this.OPT.BLUE+"Change",this._updateRGB,this,true);this.on(this.OPT.HEX+"Change",this._updateHex,this,true);this._initElements();}});YAHOO.widget.ColorPicker=G;})();YAHOO.register("colorpicker",YAHOO.widget.ColorPicker,{version:"2.7.0",build:"1796"}); /* Copyright (c) 2009, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ (function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,F,E){var D=this.getEl();if(this.patterns.noNegatives.test(C)){F=(F>0)?F:0;}if("style" in D){B.Dom.setStyle(D,C,F+E);}else{if(C in D){D[C]=F;}}},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if("style" in E){if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}}else{if(C in E){G=E[C];}}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]; }return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I);});if(F){I=C.Dom.getStyle(F,E);}else{I=A.DEFAULT_BGCOLOR;}}}else{I=D.getAttribute.call(this,E);}return I;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})(); /* TERMS OF USE - EASING EQUATIONS Open source under the BSD License. Copyright 2001 Robert Penner All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]); }else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.7.0",build:"1799"});
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/uicolor/yui/yui.js
yui.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'styles', { requires : [ 'selection' ], init : function( editor ) { // This doesn't look like correct, but it's the safest way to proper // pass the disableReadonlyStyling configuration to the style system // without having to change any method signature in the API. (#6103) editor.on( 'contentDom', function() { editor.document.setCustomData( 'cke_includeReadonly', !editor.config.disableReadonlyStyling ); }); } }); /** * Registers a function to be called whenever a style changes its state in the * editing area. The current state is passed to the function. The possible * states are {@link CKEDITOR.TRISTATE_ON} and {@link CKEDITOR.TRISTATE_OFF}. * @param {CKEDITOR.style} style The style to be watched. * @param {Function} callback The function to be called when the style state changes. * @example * // Create a style object for the &lt;b&gt; element. * var style = new CKEDITOR.style( { element : 'b' } ); * var editor = CKEDITOR.instances.editor1; * editor.attachStyleStateChange( style, function( state ) * { * if ( state == CKEDITOR.TRISTATE_ON ) * alert( 'The current state for the B element is ON' ); * else * alert( 'The current state for the B element is OFF' ); * }); */ CKEDITOR.editor.prototype.attachStyleStateChange = function( style, callback ) { // Try to get the list of attached callbacks. var styleStateChangeCallbacks = this._.styleStateChangeCallbacks; // If it doesn't exist, it means this is the first call. So, let's create // all the structure to manage the style checks and the callback calls. if ( !styleStateChangeCallbacks ) { // Create the callbacks array. styleStateChangeCallbacks = this._.styleStateChangeCallbacks = []; // Attach to the selectionChange event, so we can check the styles at // that point. this.on( 'selectionChange', function( ev ) { // Loop throw all registered callbacks. for ( var i = 0 ; i < styleStateChangeCallbacks.length ; i++ ) { var callback = styleStateChangeCallbacks[ i ]; // Check the current state for the style defined for that // callback. var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF; // If the state changed since the last check. if ( callback.state !== currentState ) { // Call the callback function, passing the current // state to it. callback.fn.call( this, currentState ); // Save the current state, so it can be compared next // time. callback.state = currentState; } } }); } // Save the callback info, so it can be checked on the next occurrence of // selectionChange. styleStateChangeCallbacks.push( { style : style, fn : callback } ); }; CKEDITOR.STYLE_BLOCK = 1; CKEDITOR.STYLE_INLINE = 2; CKEDITOR.STYLE_OBJECT = 3; (function() { var blockElements = { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 }; var objectElements = { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1}; var semicolonFixRegex = /\s*(?:;\s*|$)/; var notBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ); CKEDITOR.style = function( styleDefinition, variablesValues ) { if ( variablesValues ) { styleDefinition = CKEDITOR.tools.clone( styleDefinition ); replaceVariables( styleDefinition.attributes, variablesValues ); replaceVariables( styleDefinition.styles, variablesValues ); } var element = this.element = ( styleDefinition.element || '*' ).toLowerCase(); this.type = ( element == '#' || blockElements[ element ] ) ? CKEDITOR.STYLE_BLOCK : objectElements[ element ] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE; this._ = { definition : styleDefinition }; }; CKEDITOR.style.prototype = { apply : function( document ) { applyStyle.call( this, document, false ); }, remove : function( document ) { applyStyle.call( this, document, true ); }, applyToRange : function( range ) { return ( this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? applyInlineStyle : this.type == CKEDITOR.STYLE_BLOCK ? applyBlockStyle : this.type == CKEDITOR.STYLE_OBJECT ? applyObjectStyle : null ).call( this, range ); }, removeFromRange : function( range ) { return ( this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? removeInlineStyle : this.type == CKEDITOR.STYLE_BLOCK ? removeBlockStyle : this.type == CKEDITOR.STYLE_OBJECT ? removeObjectStyle : null ).call( this, range ); }, applyToObject : function( element ) { setupElement( element, this ); }, /** * Get the style state inside an element path. Returns "true" if the * element is active in the path. */ checkActive : function( elementPath ) { switch ( this.type ) { case CKEDITOR.STYLE_BLOCK : return this.checkElementRemovable( elementPath.block || elementPath.blockLimit, true ); case CKEDITOR.STYLE_OBJECT : case CKEDITOR.STYLE_INLINE : var elements = elementPath.elements; for ( var i = 0, element ; i < elements.length ; i++ ) { element = elements[ i ]; if ( this.type == CKEDITOR.STYLE_INLINE && ( element == elementPath.block || element == elementPath.blockLimit ) ) continue; if( this.type == CKEDITOR.STYLE_OBJECT && !( element.getName() in objectElements ) ) continue; if ( this.checkElementRemovable( element, true ) ) return true; } } return false; }, /** * Whether this style can be applied at the element path. * @param elementPath */ checkApplicable : function( elementPath ) { switch ( this.type ) { case CKEDITOR.STYLE_INLINE : case CKEDITOR.STYLE_BLOCK : break; case CKEDITOR.STYLE_OBJECT : return elementPath.lastElement.getAscendant( this.element, true ); } return true; }, // Checks if an element, or any of its attributes, is removable by the // current style definition. checkElementRemovable : function( element, fullMatch ) { if ( !element ) return false; var def = this._.definition, attribs; // If the element name is the same as the style name. if ( element.getName() == this.element ) { // If no attributes are defined in the element. if ( !fullMatch && !element.hasAttributes() ) return true; attribs = getAttributesForComparison( def ); if ( attribs._length ) { for ( var attName in attribs ) { if ( attName == '_length' ) continue; var elementAttr = element.getAttribute( attName ) || ''; // Special treatment for 'style' attribute is required. if ( attName == 'style' ? compareCssText( attribs[ attName ], normalizeCssText( elementAttr, false ) ) : attribs[ attName ] == elementAttr ) { if ( !fullMatch ) return true; } else if ( fullMatch ) return false; } if ( fullMatch ) return true; } else return true; } // Check if the element can be somehow overriden. var override = getOverrides( this )[ element.getName() ] ; if ( override ) { // If no attributes have been defined, remove the element. if ( !( attribs = override.attributes ) ) return true; for ( var i = 0 ; i < attribs.length ; i++ ) { attName = attribs[i][0]; var actualAttrValue = element.getAttribute( attName ); if ( actualAttrValue ) { var attValue = attribs[i][1]; // Remove the attribute if: // - The override definition value is null; // - The override definition value is a string that // matches the attribute value exactly. // - The override definition value is a regex that // has matches in the attribute value. if ( attValue === null || ( typeof attValue == 'string' && actualAttrValue == attValue ) || attValue.test( actualAttrValue ) ) return true; } } } return false; }, // Builds the preview HTML based on the styles definition. buildPreview : function() { var styleDefinition = this._.definition, html = [], elementName = styleDefinition.element; // Avoid <bdo> in the preview. if ( elementName == 'bdo' ) elementName = 'span'; html = [ '<', elementName ]; // Assign all defined attributes. var attribs = styleDefinition.attributes; if ( attribs ) { for ( var att in attribs ) { html.push( ' ', att, '="', attribs[ att ], '"' ); } } // Assign the style attribute. var cssStyle = CKEDITOR.style.getStyleText( styleDefinition ); if ( cssStyle ) html.push( ' style="', cssStyle, '"' ); html.push( '>', styleDefinition.name, '</', elementName, '>' ); return html.join( '' ); } }; // Build the cssText based on the styles definition. CKEDITOR.style.getStyleText = function( styleDefinition ) { // If we have already computed it, just return it. var stylesDef = styleDefinition._ST; if ( stylesDef ) return stylesDef; stylesDef = styleDefinition.styles; // Builds the StyleText. var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '', specialStylesText = ''; if ( stylesText.length ) stylesText = stylesText.replace( semicolonFixRegex, ';' ); for ( var style in stylesDef ) { var styleVal = stylesDef[ style ], text = ( style + ':' + styleVal ).replace( semicolonFixRegex, ';' ); // Some browsers don't support 'inherit' property value, leave them intact. (#5242) if ( styleVal == 'inherit' ) specialStylesText += text; else stylesText += text; } // Browsers make some changes to the style when applying them. So, here // we normalize it to the browser format. if ( stylesText.length ) stylesText = normalizeCssText( stylesText ); stylesText += specialStylesText; // Return it, saving it to the next request. return ( styleDefinition._ST = stylesText ); }; // Gets the parent element which blocks the styling for an element. This // can be done through read-only elements (contenteditable=false) or // elements with the "data-nostyle" attribute. function getUnstylableParent( element ) { var unstylable, editable; while ( ( element = element.getParent() ) ) { if ( element.getName() == 'body' ) break; if ( element.getAttribute( 'data-nostyle' ) ) unstylable = element; else if ( !editable ) { var contentEditable = element.getAttribute( 'contentEditable' ); if ( contentEditable == 'false' ) unstylable = element; else if ( contentEditable == 'true' ) editable = 1; } } return unstylable; } function applyInlineStyle( range ) { var document = range.document; if ( range.collapsed ) { // Create the element to be inserted in the DOM. var collapsedElement = getElement( this, document ); // Insert the empty element into the DOM at the range position. range.insertNode( collapsedElement ); // Place the selection right inside the empty element. range.moveToPosition( collapsedElement, CKEDITOR.POSITION_BEFORE_END ); return; } var elementName = this.element; var def = this._.definition; var isUnknownElement; // Indicates that fully selected read-only elements are to be included in the styling range. var includeReadonly = def.includeReadonly; // If the read-only inclusion is not available in the definition, try // to get it from the document data. if ( includeReadonly == undefined ) includeReadonly = document.getCustomData( 'cke_includeReadonly' ); // Get the DTD definition for the element. Defaults to "span". var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span ); // Expand the range. range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); range.trim(); // Get the first node to be processed and the last, which concludes the // processing. var boundaryNodes = range.createBookmark(), firstNode = boundaryNodes.startNode, lastNode = boundaryNodes.endNode; var currentNode = firstNode; var styleRange; // Check if the boundaries are inside non stylable elements. var firstUnstylable = getUnstylableParent( firstNode ), lastUnstylable = getUnstylableParent( lastNode ); // If the first element can't be styled, we'll start processing right // after its unstylable root. if ( firstUnstylable ) currentNode = firstUnstylable.getNextSourceNode( true ); // If the last element can't be styled, we'll stop processing on its // unstylable root. if ( lastUnstylable ) lastNode = lastUnstylable; // Do nothing if the current node now follows the last node to be processed. if ( currentNode.getPosition( lastNode ) == CKEDITOR.POSITION_FOLLOWING ) currentNode = 0; while ( currentNode ) { var applyStyle = false; if ( currentNode.equals( lastNode ) ) { currentNode = null; applyStyle = true; } else { var nodeType = currentNode.type; var nodeName = nodeType == CKEDITOR.NODE_ELEMENT ? currentNode.getName() : null; var nodeIsReadonly = nodeName && ( currentNode.getAttribute( 'contentEditable' ) == 'false' ); var nodeIsNoStyle = nodeName && currentNode.getAttribute( 'data-nostyle' ); if ( nodeName && currentNode.data( 'cke-bookmark' ) ) { currentNode = currentNode.getNextSourceNode( true ); continue; } // Check if the current node can be a child of the style element. if ( !nodeName || ( dtd[ nodeName ] && !nodeIsNoStyle && ( !nodeIsReadonly || includeReadonly ) && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) && ( !def.childRule || def.childRule( currentNode ) ) ) ) { var currentParent = currentNode.getParent(); // Check if the style element can be a child of the current // node parent or if the element is not defined in the DTD. if ( currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) && ( !def.parentRule || def.parentRule( currentParent ) ) ) { // This node will be part of our range, so if it has not // been started, place its start right before the node. // In the case of an element node, it will be included // only if it is entirely inside the range. if ( !styleRange && ( !nodeName || !CKEDITOR.dtd.$removeEmpty[ nodeName ] || ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) ) { styleRange = new CKEDITOR.dom.range( document ); styleRange.setStartBefore( currentNode ); } // Non element nodes, readonly elements, or empty // elements can be added completely to the range. if ( nodeType == CKEDITOR.NODE_TEXT || nodeIsReadonly || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() ) ) { var includedNode = currentNode; var parentNode; // This node is about to be included completelly, but, // if this is the last node in its parent, we must also // check if the parent itself can be added completelly // to the range, otherwise apply the style immediately. while ( ( applyStyle = !includedNode.getNext( notBookmark ) ) && ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] ) && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) && ( !def.childRule || def.childRule( parentNode ) ) ) { includedNode = parentNode; } styleRange.setEndAfter( includedNode ); } } else applyStyle = true; } else applyStyle = true; // Get the next node to be processed. currentNode = currentNode.getNextSourceNode( nodeIsNoStyle || nodeIsReadonly ); } // Apply the style if we have something to which apply it. if ( applyStyle && styleRange && !styleRange.collapsed ) { // Build the style element, based on the style object definition. var styleNode = getElement( this, document ), styleHasAttrs = styleNode.hasAttributes(); // Get the element that holds the entire range. var parent = styleRange.getCommonAncestor(); var removeList = { styles : {}, attrs : {}, // Styles cannot be removed. blockedStyles : {}, // Attrs cannot be removed. blockedAttrs : {} }; var attName, styleName, value; // Loop through the parents, removing the redundant attributes // from the element to be applied. while ( styleNode && parent ) { if ( parent.getName() == elementName ) { for ( attName in def.attributes ) { if ( removeList.blockedAttrs[ attName ] || !( value = parent.getAttribute( styleName ) ) ) continue; if ( styleNode.getAttribute( attName ) == value ) removeList.attrs[ attName ] = 1; else removeList.blockedAttrs[ attName ] = 1; } for ( styleName in def.styles ) { if ( removeList.blockedStyles[ styleName ] || !( value = parent.getStyle( styleName ) ) ) continue; if ( styleNode.getStyle( styleName ) == value ) removeList.styles[ styleName ] = 1; else removeList.blockedStyles[ styleName ] = 1; } } parent = parent.getParent(); } for ( attName in removeList.attrs ) styleNode.removeAttribute( attName ); for ( styleName in removeList.styles ) styleNode.removeStyle( styleName ); if ( styleHasAttrs && !styleNode.hasAttributes() ) styleNode = null; if ( styleNode ) { // Move the contents of the range to the style element. styleRange.extractContents().appendTo( styleNode ); // Here we do some cleanup, removing all duplicated // elements from the style element. removeFromInsideElement( this, styleNode ); // Insert it into the range position (it is collapsed after // extractContents. styleRange.insertNode( styleNode ); // Let's merge our new style with its neighbors, if possible. styleNode.mergeSiblings(); // As the style system breaks text nodes constantly, let's normalize // things for performance. // With IE, some paragraphs get broken when calling normalize() // repeatedly. Also, for IE, we must normalize body, not documentElement. // IE is also known for having a "crash effect" with normalize(). // We should try to normalize with IE too in some way, somewhere. if ( !CKEDITOR.env.ie ) styleNode.$.normalize(); } // Style already inherit from parents, left just to clear up any internal overrides. (#5931) else { styleNode = new CKEDITOR.dom.element( 'span' ); styleRange.extractContents().appendTo( styleNode ); styleRange.insertNode( styleNode ); removeFromInsideElement( this, styleNode ); styleNode.remove( true ); } // Style applied, let's release the range, so it gets // re-initialization in the next loop. styleRange = null; } } // Remove the bookmark nodes. range.moveToBookmark( boundaryNodes ); // Minimize the result range to exclude empty text nodes. (#5374) range.shrink( CKEDITOR.SHRINK_TEXT ); } function removeInlineStyle( range ) { /* * Make sure our range has included all "collpased" parent inline nodes so * that our operation logic can be simpler. */ range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); var bookmark = range.createBookmark(), startNode = bookmark.startNode; if ( range.collapsed ) { var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ), // The topmost element in elementspatch which we should jump out of. boundaryElement; for ( var i = 0, element ; i < startPath.elements.length && ( element = startPath.elements[i] ) ; i++ ) { /* * 1. If it's collaped inside text nodes, try to remove the style from the whole element. * * 2. Otherwise if it's collapsed on element boundaries, moving the selection * outside the styles instead of removing the whole tag, * also make sure other inner styles were well preserverd.(#3309) */ if ( element == startPath.block || element == startPath.blockLimit ) break; if ( this.checkElementRemovable( element ) ) { var isStart; if ( range.collapsed && ( range.checkBoundaryOfElement( element, CKEDITOR.END ) || ( isStart = range.checkBoundaryOfElement( element, CKEDITOR.START ) ) ) ) { boundaryElement = element; boundaryElement.match = isStart ? 'start' : 'end'; } else { /* * Before removing the style node, there may be a sibling to the style node * that's exactly the same to the one to be removed. To the user, it makes * no difference that they're separate entities in the DOM tree. So, merge * them before removal. */ element.mergeSiblings(); removeFromElement( this, element ); } } } // Re-create the style tree after/before the boundary element, // the replication start from bookmark start node to define the // new range. if ( boundaryElement ) { var clonedElement = startNode; for ( i = 0 ;; i++ ) { var newElement = startPath.elements[ i ]; if ( newElement.equals( boundaryElement ) ) break; // Avoid copying any matched element. else if ( newElement.match ) continue; else newElement = newElement.clone(); newElement.append( clonedElement ); clonedElement = newElement; } clonedElement[ boundaryElement.match == 'start' ? 'insertBefore' : 'insertAfter' ]( boundaryElement ); } } else { /* * Now our range isn't collapsed. Lets walk from the start node to the end * node via DFS and remove the styles one-by-one. */ var endNode = bookmark.endNode, me = this; /* * Find out the style ancestor that needs to be broken down at startNode * and endNode. */ function breakNodes() { var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() ), endPath = new CKEDITOR.dom.elementPath( endNode.getParent() ), breakStart = null, breakEnd = null; for ( var i = 0 ; i < startPath.elements.length ; i++ ) { var element = startPath.elements[ i ]; if ( element == startPath.block || element == startPath.blockLimit ) break; if ( me.checkElementRemovable( element ) ) breakStart = element; } for ( i = 0 ; i < endPath.elements.length ; i++ ) { element = endPath.elements[ i ]; if ( element == endPath.block || element == endPath.blockLimit ) break; if ( me.checkElementRemovable( element ) ) breakEnd = element; } if ( breakEnd ) endNode.breakParent( breakEnd ); if ( breakStart ) startNode.breakParent( breakStart ); } breakNodes(); // Now, do the DFS walk. var currentNode = startNode.getNext(); while ( !currentNode.equals( endNode ) ) { /* * Need to get the next node first because removeFromElement() can remove * the current node from DOM tree. */ var nextNode = currentNode.getNextSourceNode(); if ( currentNode.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable( currentNode ) ) { // Remove style from element or overriding element. if ( currentNode.getName() == this.element ) removeFromElement( this, currentNode ); else removeOverrides( currentNode, getOverrides( this )[ currentNode.getName() ] ); /* * removeFromElement() may have merged the next node with something before * the startNode via mergeSiblings(). In that case, the nextNode would * contain startNode and we'll have to call breakNodes() again and also * reassign the nextNode to something after startNode. */ if ( nextNode.type == CKEDITOR.NODE_ELEMENT && nextNode.contains( startNode ) ) { breakNodes(); nextNode = startNode.getNext(); } } currentNode = nextNode; } } range.moveToBookmark( bookmark ); } function applyObjectStyle( range ) { var root = range.getCommonAncestor( true, true ), element = root.getAscendant( this.element, true ); element && setupElement( element, this ); } function removeObjectStyle( range ) { var root = range.getCommonAncestor( true, true ), element = root.getAscendant( this.element, true ); if ( !element ) return; var style = this; var def = style._.definition; var attributes = def.attributes; var styles = CKEDITOR.style.getStyleText( def ); // Remove all defined attributes. if ( attributes ) { for ( var att in attributes ) { element.removeAttribute( att, attributes[ att ] ); } } // Assign all defined styles. if ( def.styles ) { for ( var i in def.styles ) { if ( !def.styles.hasOwnProperty( i ) ) continue; element.removeStyle( i ); } } } function applyBlockStyle( range ) { // Serializible bookmarks is needed here since // elements may be merged. var bookmark = range.createBookmark( true ); var iterator = range.createIterator(); iterator.enforceRealBlocks = true; // make recognize <br /> tag as a separator in ENTER_BR mode (#5121) if ( this._.enterMode ) iterator.enlargeBr = ( this._.enterMode != CKEDITOR.ENTER_BR ); var block; var doc = range.document; var previousPreBlock; while ( ( block = iterator.getNextParagraph() ) ) // Only one = { var newBlock = getElement( this, doc, block ); replaceBlock( block, newBlock ); } range.moveToBookmark( bookmark ); } function removeBlockStyle( range ) { // Serializible bookmarks is needed here since // elements may be merged. var bookmark = range.createBookmark( 1 ); var iterator = range.createIterator(); iterator.enforceRealBlocks = true; iterator.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR; var block; while ( ( block = iterator.getNextParagraph() ) ) { if ( this.checkElementRemovable( block ) ) { // <pre> get special treatment. if ( block.is( 'pre' ) ) { var newBlock = this._.enterMode == CKEDITOR.ENTER_BR ? null : range.document.createElement( this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); newBlock && block.copyAttributes( newBlock ); replaceBlock( block, newBlock ); } else removeFromElement( this, block, 1 ); } } range.moveToBookmark( bookmark ); } // Replace the original block with new one, with special treatment // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent // when necessary.(#3188) function replaceBlock( block, newBlock ) { // Block is to be removed, create a temp element to // save contents. var removeBlock = !newBlock; if ( removeBlock ) { newBlock = block.getDocument().createElement( 'div' ); block.copyAttributes( newBlock ); } var newBlockIsPre = newBlock && newBlock.is( 'pre' ); var blockIsPre = block.is( 'pre' ); var isToPre = newBlockIsPre && !blockIsPre; var isFromPre = !newBlockIsPre && blockIsPre; if ( isToPre ) newBlock = toPre( block, newBlock ); else if ( isFromPre ) // Split big <pre> into pieces before start to convert. newBlock = fromPres( removeBlock ? [ block.getHtml() ] : splitIntoPres( block ), newBlock ); else block.moveChildren( newBlock ); newBlock.replace( block ); if ( newBlockIsPre ) { // Merge previous <pre> blocks. mergePre( newBlock ); } else if ( removeBlock ) removeNoAttribsElement( newBlock ); } var nonWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 ); /** * Merge a <pre> block with a previous sibling if available. */ function mergePre( preBlock ) { var previousBlock; if ( !( ( previousBlock = preBlock.getPrevious( nonWhitespaces ) ) && previousBlock.is && previousBlock.is( 'pre') ) ) return; // Merge the previous <pre> block contents into the current <pre> // block. // // Another thing to be careful here is that currentBlock might contain // a '\n' at the beginning, and previousBlock might contain a '\n' // towards the end. These new lines are not normally displayed but they // become visible after merging. var mergedHtml = replace( previousBlock.getHtml(), /\n$/, '' ) + '\n\n' + replace( preBlock.getHtml(), /^\n/, '' ) ; // Krugle: IE normalizes innerHTML from <pre>, breaking whitespaces. if ( CKEDITOR.env.ie ) preBlock.$.outerHTML = '<pre>' + mergedHtml + '</pre>'; else preBlock.setHtml( mergedHtml ); previousBlock.remove(); } /** * Split into multiple <pre> blocks separated by double line-break. * @param preBlock */ function splitIntoPres( preBlock ) { // Exclude the ones at header OR at tail, // and ignore bookmark content between them. var duoBrRegex = /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, blockName = preBlock.getName(), splitedHtml = replace( preBlock.getOuterHtml(), duoBrRegex, function( match, charBefore, bookmark ) { return charBefore + '</pre>' + bookmark + '<pre>'; } ); var pres = []; splitedHtml.replace( /<pre\b.*?>([\s\S]*?)<\/pre>/gi, function( match, preContent ){ pres.push( preContent ); } ); return pres; } // Wrapper function of String::replace without considering of head/tail bookmarks nodes. function replace( str, regexp, replacement ) { var headBookmark = '', tailBookmark = ''; str = str.replace( /(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function( str, m1, m2 ){ m1 && ( headBookmark = m1 ); m2 && ( tailBookmark = m2 ); return ''; } ); return headBookmark + str.replace( regexp, replacement ) + tailBookmark; } /** * Converting a list of <pre> into blocks with format well preserved. */ function fromPres( preHtmls, newBlock ) { var docFrag; if ( preHtmls.length > 1 ) docFrag = new CKEDITOR.dom.documentFragment( newBlock.getDocument() ); for ( var i = 0 ; i < preHtmls.length ; i++ ) { var blockHtml = preHtmls[ i ]; // 1. Trim the first and last line-breaks immediately after and before <pre>, // they're not visible. blockHtml = blockHtml.replace( /(\r\n|\r)/g, '\n' ) ; blockHtml = replace( blockHtml, /^[ \t]*\n/, '' ) ; blockHtml = replace( blockHtml, /\n$/, '' ) ; // 2. Convert spaces or tabs at the beginning or at the end to &nbsp; blockHtml = replace( blockHtml, /^[ \t]+|[ \t]+$/g, function( match, offset, s ) { if ( match.length == 1 ) // one space, preserve it return '&nbsp;' ; else if ( !offset ) // beginning of block return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' '; else // end of block return ' ' + CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ); } ) ; // 3. Convert \n to <BR>. // 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp; blockHtml = blockHtml.replace( /\n/g, '<br>' ) ; blockHtml = blockHtml.replace( /[ \t]{2,}/g, function ( match ) { return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ; } ) ; if ( docFrag ) { var newBlockClone = newBlock.clone(); newBlockClone.setHtml( blockHtml ); docFrag.append( newBlockClone ); } else newBlock.setHtml( blockHtml ); } return docFrag || newBlock; } /** * Converting from a non-PRE block to a PRE block in formatting operations. */ function toPre( block, newBlock ) { var bogus = block.getBogus(); bogus && bogus.remove(); // First trim the block content. var preHtml = block.getHtml(); // 1. Trim head/tail spaces, they're not visible. preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' ); // 2. Delete ANSI whitespaces immediately before and after <BR> because // they are not visible. preHtml = preHtml.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '$1' ); // 3. Compress other ANSI whitespaces since they're only visible as one // single space previously. // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>. preHtml = preHtml.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' ); // 5. Convert any <BR /> to \n. This must not be done earlier because // the \n would then get compressed. preHtml = preHtml.replace( /<br\b[^>]*>/gi, '\n' ); // Krugle: IE normalizes innerHTML to <pre>, breaking whitespaces. if ( CKEDITOR.env.ie ) { var temp = block.getDocument().createElement( 'div' ); temp.append( newBlock ); newBlock.$.outerHTML = '<pre>' + preHtml + '</pre>'; newBlock.copyAttributes( temp.getFirst() ); newBlock = temp.getFirst().remove(); } else newBlock.setHtml( preHtml ); return newBlock; } // Removes a style from an element itself, don't care about its subtree. function removeFromElement( style, element ) { var def = style._.definition, attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ), styles = def.styles, // If the style is only about the element itself, we have to remove the element. removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles ); // Remove definition attributes/style from the elemnt. for ( var attName in attributes ) { // The 'class' element value must match (#1318). if ( ( attName == 'class' || style._.definition.fullMatch ) && element.getAttribute( attName ) != normalizeProperty( attName, attributes[ attName ] ) ) continue; removeEmpty = element.hasAttribute( attName ); element.removeAttribute( attName ); } for ( var styleName in styles ) { // Full match style insist on having fully equivalence. (#5018) if ( style._.definition.fullMatch && element.getStyle( styleName ) != normalizeProperty( styleName, styles[ styleName ], true ) ) continue; removeEmpty = removeEmpty || !!element.getStyle( styleName ); element.removeStyle( styleName ); } if ( removeEmpty ) { !CKEDITOR.dtd.$block[ element.getName() ] || style._.enterMode == CKEDITOR.ENTER_BR && !element.hasAttributes() ? removeNoAttribsElement( element ) : element.renameNode( style._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); } } // Removes a style from inside an element. function removeFromInsideElement( style, element ) { var def = style._.definition, attribs = def.attributes, styles = def.styles, overrides = getOverrides( style ); var innerElements = element.getElementsByTag( style.element ); for ( var i = innerElements.count(); --i >= 0 ; ) removeFromElement( style, innerElements.getItem( i ) ); // Now remove any other element with different name that is // defined to be overriden. for ( var overrideElement in overrides ) { if ( overrideElement != style.element ) { innerElements = element.getElementsByTag( overrideElement ) ; for ( i = innerElements.count() - 1 ; i >= 0 ; i-- ) { var innerElement = innerElements.getItem( i ); removeOverrides( innerElement, overrides[ overrideElement ] ) ; } } } } /** * Remove overriding styles/attributes from the specific element. * Note: Remove the element if no attributes remain. * @param {Object} element * @param {Object} overrides */ function removeOverrides( element, overrides ) { var attributes = overrides && overrides.attributes ; if ( attributes ) { for ( var i = 0 ; i < attributes.length ; i++ ) { var attName = attributes[i][0], actualAttrValue ; if ( ( actualAttrValue = element.getAttribute( attName ) ) ) { var attValue = attributes[i][1] ; // Remove the attribute if: // - The override definition value is null ; // - The override definition valie is a string that // matches the attribute value exactly. // - The override definition value is a regex that // has matches in the attribute value. if ( attValue === null || ( attValue.test && attValue.test( actualAttrValue ) ) || ( typeof attValue == 'string' && actualAttrValue == attValue ) ) element.removeAttribute( attName ) ; } } } removeNoAttribsElement( element ); } // If the element has no more attributes, remove it. function removeNoAttribsElement( element ) { // If no more attributes remained in the element, remove it, // leaving its children. if ( !element.hasAttributes() ) { if ( CKEDITOR.dtd.$block[ element.getName() ] ) { var previous = element.getPrevious( nonWhitespaces ), next = element.getNext( nonWhitespaces ); if ( previous && ( previous.type == CKEDITOR.NODE_TEXT || !previous.isBlockBoundary( { br : 1 } ) ) ) element.append( 'br', 1 ); if ( next && ( next.type == CKEDITOR.NODE_TEXT || !next.isBlockBoundary( { br : 1 } ) ) ) element.append( 'br' ); element.remove( true ); } else { // Removing elements may open points where merging is possible, // so let's cache the first and last nodes for later checking. var firstChild = element.getFirst(); var lastChild = element.getLast(); element.remove( true ); if ( firstChild ) { // Check the cached nodes for merging. firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.mergeSiblings(); if ( lastChild && !firstChild.equals( lastChild ) && lastChild.type == CKEDITOR.NODE_ELEMENT ) lastChild.mergeSiblings(); } } } } function getElement( style, targetDocument, element ) { var el; var def = style._.definition; var elementName = style.element; // The "*" element name will always be a span for this function. if ( elementName == '*' ) elementName = 'span'; // Create the element. el = new CKEDITOR.dom.element( elementName, targetDocument ); // #6226: attributes should be copied before the new ones are applied if ( element ) element.copyAttributes( el ); el = setupElement( el, style ); // Avoid ID duplication. if ( targetDocument.getCustomData( 'doc_processing_style' ) && el.hasAttribute( 'id' ) ) el.removeAttribute( 'id' ); else targetDocument.setCustomData( 'doc_processing_style', 1 ); return el; } function setupElement( el, style ) { var def = style._.definition; var attributes = def.attributes; var styles = CKEDITOR.style.getStyleText( def ); // Assign all defined attributes. if ( attributes ) { for ( var att in attributes ) { el.setAttribute( att, attributes[ att ] ); } } // Assign all defined styles. if( styles ) el.setAttribute( 'style', styles ); return el; } var varRegex = /#\((.+?)\)/g; function replaceVariables( list, variablesValues ) { for ( var item in list ) { list[ item ] = list[ item ].replace( varRegex, function( match, varName ) { return variablesValues[ varName ]; }); } } // Returns an object that can be used for style matching comparison. // Attributes names and values are all lowercased, and the styles get // merged with the style attribute. function getAttributesForComparison( styleDefinition ) { // If we have already computed it, just return it. var attribs = styleDefinition._AC; if ( attribs ) return attribs; attribs = {}; var length = 0; // Loop through all defined attributes. var styleAttribs = styleDefinition.attributes; if ( styleAttribs ) { for ( var styleAtt in styleAttribs ) { length++; attribs[ styleAtt ] = styleAttribs[ styleAtt ]; } } // Includes the style definitions. var styleText = CKEDITOR.style.getStyleText( styleDefinition ); if ( styleText ) { if ( !attribs[ 'style' ] ) length++; attribs[ 'style' ] = styleText; } // Appends the "length" information to the object. attribs._length = length; // Return it, saving it to the next request. return ( styleDefinition._AC = attribs ); } /** * Get the the collection used to compare the elements and attributes, * defined in this style overrides, with other element. All information in * it is lowercased. * @param {CKEDITOR.style} style */ function getOverrides( style ) { if ( style._.overrides ) return style._.overrides; var overrides = ( style._.overrides = {} ), definition = style._.definition.overrides; if ( definition ) { // The override description can be a string, object or array. // Internally, well handle arrays only, so transform it if needed. if ( !CKEDITOR.tools.isArray( definition ) ) definition = [ definition ]; // Loop through all override definitions. for ( var i = 0 ; i < definition.length ; i++ ) { var override = definition[i]; var elementName; var overrideEl; var attrs; // If can be a string with the element name. if ( typeof override == 'string' ) elementName = override.toLowerCase(); // Or an object. else { elementName = override.element ? override.element.toLowerCase() : style.element; attrs = override.attributes; } // We can have more than one override definition for the same // element name, so we attempt to simply append information to // it if it already exists. overrideEl = overrides[ elementName ] || ( overrides[ elementName ] = {} ); if ( attrs ) { // The returning attributes list is an array, because we // could have different override definitions for the same // attribute name. var overrideAttrs = ( overrideEl.attributes = overrideEl.attributes || new Array() ); for ( var attName in attrs ) { // Each item in the attributes array is also an array, // where [0] is the attribute name and [1] is the // override value. overrideAttrs.push( [ attName.toLowerCase(), attrs[ attName ] ] ); } } } } return overrides; } // Make the comparison of attribute value easier by standardizing it. function normalizeProperty( name, value, isStyle ) { var temp = new CKEDITOR.dom.element( 'span' ); temp [ isStyle ? 'setStyle' : 'setAttribute' ]( name, value ); return temp[ isStyle ? 'getStyle' : 'getAttribute' ]( name ); } // Make the comparison of style text easier by standardizing it. function normalizeCssText( unparsedCssText, nativeNormalize ) { var styleText; if ( nativeNormalize !== false ) { // Injects the style in a temporary span object, so the browser parses it, // retrieving its final format. var temp = new CKEDITOR.dom.element( 'span' ); temp.setAttribute( 'style', unparsedCssText ); styleText = temp.getAttribute( 'style' ) || ''; } else styleText = unparsedCssText; // Shrinking white-spaces around colon and semi-colon (#4147). // Compensate tail semi-colon. return styleText.replace( /\s*([;:])\s*/, '$1' ) .replace( /([^\s;])$/, '$1;') // Trimming spaces after comma(#4107), // remove quotations(#6403), // mostly for differences on "font-family". .replace( /,\s+/g, ',' ) .replace( /\"/g,'' ) .toLowerCase(); } // Turn inline style text properties into one hash. function parseStyleText( styleText ) { var retval = {}; styleText .replace( /&quot;/g, '"' ) .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) { retval[ name ] = value; } ); return retval; } /** * Compare two bunch of styles, with the speciality that value 'inherit' * is treated as a wildcard which will match any value. * @param {Object|String} source * @param {Object|String} target */ function compareCssText( source, target ) { typeof source == 'string' && ( source = parseStyleText( source ) ); typeof target == 'string' && ( target = parseStyleText( target ) ); for( var name in source ) { if ( !( name in target && ( target[ name ] == source[ name ] || source[ name ] == 'inherit' || target[ name ] == 'inherit' ) ) ) { return false; } } return true; } function applyStyle( document, remove ) { var selection = document.getSelection(), ranges = selection.getRanges(), func = remove ? this.removeFromRange : this.applyToRange, range; var iterator = ranges.createIterator(); while ( ( range = iterator.getNextRange() ) ) func.call( this, range ); selection.selectRanges( ranges ); document.removeCustomData( 'doc_processing_style' ); } })(); CKEDITOR.styleCommand = function( style ) { this.style = style; }; CKEDITOR.styleCommand.prototype.exec = function( editor ) { editor.focus(); var doc = editor.document; if ( doc ) { if ( this.state == CKEDITOR.TRISTATE_OFF ) this.style.apply( doc ); else if ( this.state == CKEDITOR.TRISTATE_ON ) this.style.remove( doc ); } return !!doc; }; CKEDITOR.stylesSet = new CKEDITOR.resourceManager( '', 'stylesSet' ); // Backward compatibility (#5025). CKEDITOR.addStylesSet = CKEDITOR.tools.bind( CKEDITOR.stylesSet.add, CKEDITOR.stylesSet ); CKEDITOR.loadStylesSet = function( name, url, callback ) { CKEDITOR.stylesSet.addExternal( name, url, '' ); CKEDITOR.stylesSet.load( name, callback ); }; /** * Gets the current styleSet for this instance * @param {Function} callback The function to be called with the styles data. * @example * editor.getStylesSet( function( stylesDefinitions ) {} ); */ CKEDITOR.editor.prototype.getStylesSet = function( callback ) { if ( !this._.stylesDefinitions ) { var editor = this, // Respect the backwards compatible definition entry configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet || 'default'; // #5352 Allow to define the styles directly in the config object if ( configStyleSet instanceof Array ) { editor._.stylesDefinitions = configStyleSet; callback( configStyleSet ); return; } var partsStylesSet = configStyleSet.split( ':' ), styleSetName = partsStylesSet[ 0 ], externalPath = partsStylesSet[ 1 ], pluginPath = CKEDITOR.plugins.registered.styles.path; CKEDITOR.stylesSet.addExternal( styleSetName, externalPath ? partsStylesSet.slice( 1 ).join( ':' ) : pluginPath + 'styles/' + styleSetName + '.js', '' ); CKEDITOR.stylesSet.load( styleSetName, function( stylesSet ) { editor._.stylesDefinitions = stylesSet[ styleSetName ]; callback( editor._.stylesDefinitions ); } ) ; } else callback( this._.stylesDefinitions ); }; /** * Indicates that fully selected read-only elements will be included when * applying the style (for inline styles only). * @name CKEDITOR.style.includeReadonly * @type Boolean * @default false * @since 3.5 */ /** * Disables inline styling on read-only elements. * @name CKEDITOR.config.disableReadonlyStyling * @type Boolean * @default false * @since 3.5 */ /** * The "styles definition set" to use in the editor. They will be used in the * styles combo and the Style selector of the div container. <br> * The styles may be defined in the page containing the editor, or can be * loaded on demand from an external file. In the second case, if this setting * contains only a name, the styles definition file will be loaded from the * "styles" folder inside the styles plugin folder. * Otherwise, this setting has the "name:url" syntax, making it * possible to set the URL from which loading the styles file.<br> * Previously this setting was available as config.stylesCombo_stylesSet<br> * @name CKEDITOR.config.stylesSet * @type String|Array * @default 'default' * @since 3.3 * @example * // Load from the styles' styles folder (mystyles.js file). * config.stylesSet = 'mystyles'; * @example * // Load from a relative URL. * config.stylesSet = 'mystyles:/editorstyles/styles.js'; * @example * // Load from a full URL. * config.stylesSet = 'mystyles:http://www.example.com/editorstyles/styles.js'; * @example * // Load from a list of definitions. * config.stylesSet = [ * { name : 'Strong Emphasis', element : 'strong' }, * { name : 'Emphasis', element : 'em' }, ... ]; */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/styles/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.stylesSet.add( 'default', [ /* Block Styles */ // These styles are already available in the "Format" combo, so they are // not needed here by default. You may enable them to avoid placing the // "Format" combo in the toolbar, maintaining the same features. /* { name : 'Paragraph' , element : 'p' }, { name : 'Heading 1' , element : 'h1' }, { name : 'Heading 2' , element : 'h2' }, { name : 'Heading 3' , element : 'h3' }, { name : 'Heading 4' , element : 'h4' }, { name : 'Heading 5' , element : 'h5' }, { name : 'Heading 6' , element : 'h6' }, { name : 'Preformatted Text', element : 'pre' }, { name : 'Address' , element : 'address' }, */ { name : 'Blue Title' , element : 'h3', styles : { 'color' : 'Blue' } }, { name : 'Red Title' , element : 'h3', styles : { 'color' : 'Red' } }, /* Inline Styles */ // These are core styles available as toolbar buttons. You may opt enabling // some of them in the Styles combo, removing them from the toolbar. /* { name : 'Strong' , element : 'strong', overrides : 'b' }, { name : 'Emphasis' , element : 'em' , overrides : 'i' }, { name : 'Underline' , element : 'u' }, { name : 'Strikethrough' , element : 'strike' }, { name : 'Subscript' , element : 'sub' }, { name : 'Superscript' , element : 'sup' }, */ { name : 'Marker: Yellow' , element : 'span', styles : { 'background-color' : 'Yellow' } }, { name : 'Marker: Green' , element : 'span', styles : { 'background-color' : 'Lime' } }, { name : 'Big' , element : 'big' }, { name : 'Small' , element : 'small' }, { name : 'Typewriter' , element : 'tt' }, { name : 'Computer Code' , element : 'code' }, { name : 'Keyboard Phrase' , element : 'kbd' }, { name : 'Sample Text' , element : 'samp' }, { name : 'Variable' , element : 'var' }, { name : 'Deleted Text' , element : 'del' }, { name : 'Inserted Text' , element : 'ins' }, { name : 'Cited Work' , element : 'cite' }, { name : 'Inline Quotation' , element : 'q' }, { name : 'Language: RTL' , element : 'span', attributes : { 'dir' : 'rtl' } }, { name : 'Language: LTR' , element : 'span', attributes : { 'dir' : 'ltr' } }, /* Object Styles */ { name : 'Image on Left', element : 'img', attributes : { 'style' : 'padding: 5px; margin-right: 5px', 'border' : '2', 'align' : 'left' } }, { name : 'Image on Right', element : 'img', attributes : { 'style' : 'padding: 5px; margin-left: 5px', 'border' : '2', 'align' : 'right' } }, { name : 'Borderless Table', element : 'table', styles: { 'border-style': 'hidden', 'background-color' : '#E6E6FA' } }, { name : 'Square Bulleted List', element : 'ul', styles : { 'list-style-type' : 'square' } } ]);
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/styles/styles/default.js
default.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'a11yHelp', function( editor ) { var lang = editor.lang.accessibilityHelp, id = CKEDITOR.tools.getNextId(); // CharCode <-> KeyChar. var keyMap = { 8 : "BACKSPACE", 9 : "TAB" , 13 : "ENTER" , 16 : "SHIFT" , 17 : "CTRL" , 18 : "ALT" , 19 : "PAUSE" , 20 : "CAPSLOCK" , 27 : "ESCAPE" , 33 : "PAGE UP" , 34 : "PAGE DOWN" , 35 : "END" , 36 : "HOME" , 37 : "LEFT ARROW" , 38 : "UP ARROW" , 39 : "RIGHT ARROW" , 40 : "DOWN ARROW" , 45 : "INSERT" , 46 : "DELETE" , 91 : "LEFT WINDOW KEY" , 92 : "RIGHT WINDOW KEY" , 93 : "SELECT KEY" , 96 : "NUMPAD 0" , 97 : "NUMPAD 1" , 98 : "NUMPAD 2" , 99 : "NUMPAD 3" , 100 : "NUMPAD 4" , 101 : "NUMPAD 5" , 102 : "NUMPAD 6" , 103 : "NUMPAD 7" , 104 : "NUMPAD 8" , 105 : "NUMPAD 9" , 106 : "MULTIPLY" , 107 : "ADD" , 109 : "SUBTRACT" , 110 : "DECIMAL POINT" , 111 : "DIVIDE" , 112 : "F1" , 113 : "F2" , 114 : "F3" , 115 : "F4" , 116 : "F5" , 117 : "F6" , 118 : "F7" , 119 : "F8" , 120 : "F9" , 121 : "F10" , 122 : "F11" , 123 : "F12" , 144 : "NUM LOCK" , 145 : "SCROLL LOCK" , 186 : "SEMI-COLON" , 187 : "EQUAL SIGN" , 188 : "COMMA" , 189 : "DASH" , 190 : "PERIOD" , 191 : "FORWARD SLASH" , 192 : "GRAVE ACCENT" , 219 : "OPEN BRACKET" , 220 : "BACK SLASH" , 221 : "CLOSE BRAKET" , 222 : "SINGLE QUOTE" }; // Modifier keys override. keyMap[ CKEDITOR.ALT ] = 'ALT'; keyMap[ CKEDITOR.SHIFT ] = 'SHIFT'; keyMap[ CKEDITOR.CTRL ] = 'CTRL'; // Sort in desc. var modifiers = [ CKEDITOR.ALT, CKEDITOR.SHIFT, CKEDITOR.CTRL ]; function representKeyStroke( keystroke ) { var quotient, modifier, presentation = []; for ( var i = 0; i < modifiers.length; i++ ) { modifier = modifiers[ i ]; quotient = keystroke / modifiers[ i ]; if ( quotient > 1 && quotient <= 2 ) { keystroke -= modifier; presentation.push( keyMap[ modifier ] ); } } presentation.push( keyMap[ keystroke ] || String.fromCharCode( keystroke ) ); return presentation.join( '+' ); } var variablesPattern = /\$\{(.*?)\}/g; function replaceVariables( match, name ) { var keystrokes = editor.config.keystrokes, definition, length = keystrokes.length; for ( var i = 0; i < length; i++ ) { definition = keystrokes[ i ]; if ( definition[ 1 ] == name ) break; } return representKeyStroke( definition[ 0 ] ); } // Create the help list directly from lang file entries. function buildHelpContents() { var pageTpl = '<div class="cke_accessibility_legend" role="document" aria-labelledby="' + id + '_arialbl" tabIndex="-1">%1</div>' + '<span id="' + id + '_arialbl" class="cke_voice_label">' + lang.contents + ' </span>', sectionTpl = '<h1>%1</h1><dl>%2</dl>', itemTpl = '<dt>%1</dt><dd>%2</dd>'; var pageHtml = [], sections = lang.legend, sectionLength = sections.length; for ( var i = 0; i < sectionLength; i++ ) { var section = sections[ i ], sectionHtml = [], items = section.items, itemsLength = items.length; for ( var j = 0; j < itemsLength; j++ ) { var item = items[ j ], itemHtml; itemHtml = itemTpl.replace( '%1', item.name ). replace( '%2', item.legend.replace( variablesPattern, replaceVariables ) ); sectionHtml.push( itemHtml ); } pageHtml.push( sectionTpl.replace( '%1', section.name ).replace( '%2', sectionHtml.join( '' ) ) ); } return pageTpl.replace( '%1', pageHtml.join( '' ) ); } return { title : lang.title, minWidth : 600, minHeight : 400, contents : [ { id : 'info', label : editor.lang.common.generalTab, expand : true, elements : [ { type : 'html', id : 'legends', focus : function() {}, html : buildHelpContents() + '<style type="text/css">' + '.cke_accessibility_legend' + '{' + 'width:600px;' + 'height:400px;' + 'padding-right:5px;' + 'overflow-y:auto;' + 'overflow-x:hidden;' + '}' + '.cke_accessibility_legend h1' + '{' + 'font-size: 20px;' + 'border-bottom: 1px solid #AAA;' + 'margin: 5px 0px 15px;' + '}' + '.cke_accessibility_legend dl' + '{' + 'margin-left: 5px;' + '}' + '.cke_accessibility_legend dt' + '{' + 'font-size: 13px;' + 'font-weight: bold;' + '}' + '.cke_accessibility_legend dd' + '{' + 'white-space:normal;' + 'margin:10px' + '}' + '</style>' } ] } ], buttons : [ CKEDITOR.dialog.cancelButton ] }; });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/a11yhelp/dialogs/a11yhelp.js
a11yhelp.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'en', { accessibilityHelp : { title : 'Accessibility Instructions', contents : 'Help Contents. To close this dialog press ESC.', legend : [ { name : 'General', items : [ { name : 'Editor Toolbar', legend: 'Press ${toolbarFocus} to navigate to the toolbar. ' + 'Move to next toolbar button with TAB or RIGHT ARROW. ' + 'Move to previous button with SHIFT+TAB or LEFT ARROW. ' + 'Press SPACE or ENTER to activate the toolbar button.' }, { name : 'Editor Dialog', legend : 'Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. ' + 'For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. ' + 'Then move to next tab with TAB OR RIGTH ARROW. ' + 'Move to previous tab with SHIFT + TAB or LEFT ARROW. ' + 'Press SPACE or ENTER to select the tab page.' }, { name : 'Editor Context Menu', legend : 'Press ${contextMenu} or APPLICATION KEY to open context-menu. ' + 'Then move to next menu option with TAB or DOWN ARROW. ' + 'Move to previous option with SHIFT+TAB or UP ARROW. ' + 'Press SPACE or ENTER to select the menu option. ' + 'Open sub-menu of current option wtih SPACE or ENTER or RIGHT ARROW. ' + 'Go back to parent menu item with ESC or LEFT ARROW. ' + 'Close context menu with ESC.' }, { name : 'Editor List Box', legend : 'Inside a list-box, move to next list item with TAB OR DOWN ARROW. ' + 'Move to previous list item with SHIFT + TAB or UP ARROW. ' + 'Press SPACE or ENTER to select the list option. ' + 'Press ESC to close the list-box.' }, { name : 'Editor Element Path Bar', legend : 'Press ${elementsPathFocus} to navigate to the elements path bar. ' + 'Move to next element button with TAB or RIGHT ARROW. ' + 'Move to previous button with SHIFT+TAB or LEFT ARROW. ' + 'Press SPACE or ENTER to select the element in editor.' } ] }, { name : 'Commands', items : [ { name : ' Undo command', legend : 'Press ${undo}' }, { name : ' Redo command', legend : 'Press ${redo}' }, { name : ' Bold command', legend : 'Press ${bold}' }, { name : ' Italic command', legend : 'Press ${italic}' }, { name : ' Underline command', legend : 'Press ${underline}' }, { name : ' Link command', legend : 'Press ${link}' }, { name : ' Toolbar Collapse command', legend : 'Press ${toolbarCollapse}' }, { name : ' Accessibility Help', legend : 'Press ${a11yHelp}' } ] } ] } });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/a11yhelp/lang/en.js
en.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'he', { accessibilityHelp : { title : 'הוראות נגישות', contents : 'הוראות נגישות. לסגירה לחץ אסקייפ (ESC).', legend : [ { name : 'כללי', items : [ { name : 'סרגל הכלים', legend: 'לחץ על ${toolbarFocus} כדי לנווט לסרגל הכלים. ' + 'עבור לכפתור הבא עם מקש הטאב (TAB) או חץ שמאלי. ' + 'עבור לכפתור הקודם עם מקש השיפט (SHIFT) + טאב (TAB) או חץ ימני. ' + 'לחץ רווח או אנטר (ENTER) כדי להפעיל את הכפתור הנבחר.' }, { name : 'דיאלוגים (חלונות תשאול)', legend : 'בתוך דיאלוג, לחץ טאב (TAB) כדי לנווט לשדה הבא, לחץ שיפט (SHIFT) + טאב (TAB) כדי לנווט לשדה הקודם, לחץ אנטר (ENTER) כדי לשלוח את הדיאלוג, לחץ אסקייפ (ESC) כדי לבטל. ' + 'בתוך דיאלוגים בעלי מספר טאבים (לשוניות), לחץ אלט (ALT) + F10 כדי לנווט לשורת הטאבים. ' + 'נווט לטאב הבא עם טאב (TAB) או חץ שמאלי. ' + 'עבור לטאב הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. ' + 'לחץ רווח או אנטר (ENTER) כדי להיכנס לטאב.' }, { name : 'תפריט ההקשר (Context Menu)', legend : 'לחץ ${contextMenu} או APPLICATION KEYכדי לפתוח את תפריט ההקשר. ' + 'עבור לאפשרות הבאה עם טאב (TAB) או חץ למטה. ' + 'עבור לאפשרות הקודמת עם שיפט (SHIFT) + טאב (TAB) או חץ למעלה. ' + 'לחץ רווח או אנטר (ENTER) כדי לבחור את האפשרות. ' + 'פתח את תת התפריט (Sub-menu) של האפשרות הנוכחית עם רווח או אנטר (ENTER) או חץ שמאלי. ' + 'חזור לתפריט האב עם אסקייפ (ESC) או חץ שמאלי. ' + 'סגור את תפריט ההקשר עם אסקייפ (ESC).' }, { name : 'תפריטים צפים (List boxes)', legend : 'בתוך תפריט צף, עבור לפריט הבא עם טאב (TAB) או חץ למטה. ' + 'עבור לתפריט הקודם עם שיפט (SHIFT) + טאב (TAB) or חץ עליון. ' + 'Press SPACE or ENTER to select the list option. ' + 'Press ESC to close the list-box.' }, { name : 'עץ אלמנטים (Elements Path)', legend : 'לחץ ${elementsPathFocus} כדי לנווט לעץ האלמנטים. ' + 'עבור לפריט הבא עם טאב (TAB) או חץ ימני. ' + 'עבור לפריט הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. ' + 'לחץ רווח או אנטר (ENTER) כדי לבחור את האלמנט בעורך.' } ] }, { name : 'פקודות', items : [ { name : ' ביטול צעד אחרון', legend : 'לחץ ${undo}' }, { name : ' חזרה על צעד אחרון', legend : 'לחץ ${redo}' }, { name : ' הדגשה', legend : 'לחץ ${bold}' }, { name : ' הטייה', legend : 'לחץ ${italic}' }, { name : ' הוספת קו תחתון', legend : 'לחץ ${underline}' }, { name : ' הוספת לינק', legend : 'לחץ ${link}' }, { name : ' כיווץ סרגל הכלים', legend : 'לחץ ${toolbarCollapse}' }, { name : ' הוראות נגישות', legend : 'לחץ ${a11yHelp}' } ] } ] } }); /* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'he', { accessibilityHelp : { title : 'הוראות נגישות', contents : 'הוראות נגישות. לסגירה לחץ אסקייפ (ESC).', legend : [ { name : 'כללי', items : [ { name : 'סרגל הכלים', legend: 'לחץ על ${toolbarFocus} כדי לנווט לסרגל הכלים. ' + 'עבור לכפתור הבא עם מקש הטאב (TAB) או חץ שמאלי. ' + 'עבור לכפתור הקודם עם מקש השיפט (SHIFT) + טאב (TAB) או חץ ימני. ' + 'לחץ רווח או אנטר (ENTER) כדי להפעיל את הכפתור הנבחר.' }, { name : 'דיאלוגים (חלונות תשאול)', legend : 'בתוך דיאלוג, לחץ טאב (TAB) כדי לנווט לשדה הבא, לחץ שיפט (SHIFT) + טאב (TAB) כדי לנווט לשדה הקודם, לחץ אנטר (ENTER) כדי לשלוח את הדיאלוג, לחץ אסקייפ (ESC) כדי לבטל. ' + 'בתוך דיאלוגים בעלי מספר טאבים (לשוניות), לחץ אלט (ALT) + F10 כדי לנווט לשורת הטאבים. ' + 'נווט לטאב הבא עם טאב (TAB) או חץ שמאלי. ' + 'עבור לטאב הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. ' + 'לחץ רווח או אנטר (ENTER) כדי להיכנס לטאב.' }, { name : 'תפריט ההקשר (Context Menu)', legend : 'לחץ ${contextMenu} או APPLICATION KEYכדי לפתוח את תפריט ההקשר. ' + 'עבור לאפשרות הבאה עם טאב (TAB) או חץ למטה. ' + 'עבור לאפשרות הקודמת עם שיפט (SHIFT) + טאב (TAB) או חץ למעלה. ' + 'לחץ רווח או אנטר (ENTER) כדי לבחור את האפשרות. ' + 'פתח את תת התפריט (Sub-menu) של האפשרות הנוכחית עם רווח או אנטר (ENTER) או חץ שמאלי. ' + 'חזור לתפריט האב עם אסקייפ (ESC) או חץ שמאלי. ' + 'סגור את תפריט ההקשר עם אסקייפ (ESC).' }, { name : 'תפריטים צפים (List boxes)', legend : 'בתוך תפריט צף, עבור לפריט הבא עם טאב (TAB) או חץ למטה. ' + 'עבור לתפריט הקודם עם שיפט (SHIFT) + טאב (TAB) or חץ עליון. ' + 'Press SPACE or ENTER to select the list option. ' + 'Press ESC to close the list-box.' }, { name : 'עץ אלמנטים (Elements Path)', legend : 'לחץ ${elementsPathFocus} כדי לנווט לעץ האלמנטים. ' + 'עבור לפריט הבא עם טאב (TAB) או חץ ימני. ' + 'עבור לפריט הקודם עם שיפט (SHIFT) + טאב (TAB) או חץ שמאלי. ' + 'לחץ רווח או אנטר (ENTER) כדי לבחור את האלמנט בעורך.' } ] }, { name : 'פקודות', items : [ { name : ' ביטול צעד אחרון', legend : 'לחץ ${undo}' }, { name : ' חזרה על צעד אחרון', legend : 'לחץ ${redo}' }, { name : ' הדגשה', legend : 'לחץ ${bold}' }, { name : ' הטייה', legend : 'לחץ ${italic}' }, { name : ' הוספת קו תחתון', legend : 'לחץ ${underline}' }, { name : ' הוספת לינק', legend : 'לחץ ${link}' }, { name : ' כיווץ סרגל הכלים', legend : 'לחץ ${toolbarCollapse}' }, { name : ' הוראות נגישות', legend : 'לחץ ${a11yHelp}' } ] } ] } });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/a11yhelp/lang/he.js
he.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { function protectFormStyles( formElement ) { if ( !formElement || formElement.type != CKEDITOR.NODE_ELEMENT || formElement.getName() != 'form' ) return []; var hijackRecord = [], hijackNames = [ 'style', 'className' ]; for ( var i = 0 ; i < hijackNames.length ; i++ ) { var name = hijackNames[i]; var $node = formElement.$.elements.namedItem( name ); if ( $node ) { var hijackNode = new CKEDITOR.dom.element( $node ); hijackRecord.push( [ hijackNode, hijackNode.nextSibling ] ); hijackNode.remove(); } } return hijackRecord; } function restoreFormStyles( formElement, hijackRecord ) { if ( !formElement || formElement.type != CKEDITOR.NODE_ELEMENT || formElement.getName() != 'form' ) return; if ( hijackRecord.length > 0 ) { for ( var i = hijackRecord.length - 1 ; i >= 0 ; i-- ) { var node = hijackRecord[i][0]; var sibling = hijackRecord[i][1]; if ( sibling ) node.insertBefore( sibling ); else node.appendTo( formElement ); } } } function saveStyles( element, isInsideEditor ) { var data = protectFormStyles( element ); var retval = {}; var $element = element.$; if ( !isInsideEditor ) { retval[ 'class' ] = $element.className || ''; $element.className = ''; } retval.inline = $element.style.cssText || ''; if ( !isInsideEditor ) // Reset any external styles that might interfere. (#2474) $element.style.cssText = 'position: static; overflow: visible'; restoreFormStyles( data ); return retval; } function restoreStyles( element, savedStyles ) { var data = protectFormStyles( element ); var $element = element.$; if ( 'class' in savedStyles ) $element.className = savedStyles[ 'class' ]; if ( 'inline' in savedStyles ) $element.style.cssText = savedStyles.inline; restoreFormStyles( data ); } function refreshCursor( editor ) { // Refresh all editor instances on the page (#5724). var all = CKEDITOR.instances; for ( var i in all ) { var one = all[ i ]; if ( one.mode == 'wysiwyg' ) { var body = one.document.getBody(); // Refresh 'contentEditable' otherwise // DOM lifting breaks design mode. (#5560) body.setAttribute( 'contentEditable', false ); body.setAttribute( 'contentEditable', true ); } } if ( editor.focusManager.hasFocus ) { editor.toolbox.focus(); editor.focus(); } } /** * Adding an iframe shim to this element, OR removing the existing one if already applied. * Note: This will only affect IE version below 7. */ function createIframeShim( element ) { if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 6 ) return null; var shim = CKEDITOR.dom.element.createFromHtml( '<iframe frameborder="0" tabindex="-1"' + ' src="javascript:' + 'void((function(){' + 'document.open();' + ( CKEDITOR.env.isCustomDomain() ? 'document.domain=\'' + this.getDocument().$.domain + '\';' : '' ) + 'document.close();' + '})())"' + ' style="display:block;position:absolute;z-index:-1;' + 'progid:DXImageTransform.Microsoft.Alpha(opacity=0);' + '"></iframe>' ); return element.append( shim, true ); } CKEDITOR.plugins.add( 'maximize', { init : function( editor ) { var lang = editor.lang; var mainDocument = CKEDITOR.document, mainWindow = mainDocument.getWindow(); // Saved selection and scroll position for the editing area. var savedSelection, savedScroll; // Saved scroll position for the outer window. var outerScroll; var shim; // Saved resize handler function. function resizeHandler() { var viewPaneSize = mainWindow.getViewPaneSize(); shim && shim.setStyles( { width : viewPaneSize.width + 'px', height : viewPaneSize.height + 'px' } ); editor.resize( viewPaneSize.width, viewPaneSize.height, null, true ); } // Retain state after mode switches. var savedState = CKEDITOR.TRISTATE_OFF; editor.addCommand( 'maximize', { modes : { wysiwyg : 1, source : 1 }, editorFocus : false, exec : function() { var container = editor.container.getChild( 1 ); var contents = editor.getThemeSpace( 'contents' ); // Save current selection and scroll position in editing area. if ( editor.mode == 'wysiwyg' ) { var selection = editor.getSelection(); savedSelection = selection && selection.getRanges(); savedScroll = mainWindow.getScrollPosition(); } else { var $textarea = editor.textarea.$; savedSelection = !CKEDITOR.env.ie && [ $textarea.selectionStart, $textarea.selectionEnd ]; savedScroll = [ $textarea.scrollLeft, $textarea.scrollTop ]; } if ( this.state == CKEDITOR.TRISTATE_OFF ) // Go fullscreen if the state is off. { // Add event handler for resizing. mainWindow.on( 'resize', resizeHandler ); // Save the scroll bar position. outerScroll = mainWindow.getScrollPosition(); // Save and reset the styles for the entire node tree. var currentNode = editor.container; while ( ( currentNode = currentNode.getParent() ) ) { currentNode.setCustomData( 'maximize_saved_styles', saveStyles( currentNode ) ); currentNode.setStyle( 'z-index', editor.config.baseFloatZIndex - 1 ); } contents.setCustomData( 'maximize_saved_styles', saveStyles( contents, true ) ); container.setCustomData( 'maximize_saved_styles', saveStyles( container, true ) ); // Hide scroll bars. var styles = { overflow : CKEDITOR.env.webkit ? '' : 'hidden', // #6896 width : 0, height : 0 }; mainDocument.getDocumentElement().setStyles( styles ); !CKEDITOR.env.gecko && mainDocument.getDocumentElement().setStyle( 'position', 'fixed' ); mainDocument.getBody().setStyles( styles ); // Scroll to the top left (IE needs some time for it - #4923). CKEDITOR.env.ie ? setTimeout( function() { mainWindow.$.scrollTo( 0, 0 ); }, 0 ) : mainWindow.$.scrollTo( 0, 0 ); // Resize and move to top left. container.setStyle( 'position', 'absolute' ); container.$.offsetLeft; // SAFARI BUG: See #2066. container.setStyles( { 'z-index' : editor.config.baseFloatZIndex - 1, left : '0px', top : '0px' } ); shim = createIframeShim( container ); // IE6 select element penetration when maximized. (#4459) // Add cke_maximized class before resize handle since that will change things sizes (#5580) container.addClass( 'cke_maximized' ); resizeHandler(); // Still not top left? Fix it. (Bug #174) var offset = container.getDocumentPosition(); container.setStyles( { left : ( -1 * offset.x ) + 'px', top : ( -1 * offset.y ) + 'px' } ); // Fixing positioning editor chrome in Firefox break design mode. (#5149) CKEDITOR.env.gecko && refreshCursor( editor ); } else if ( this.state == CKEDITOR.TRISTATE_ON ) // Restore from fullscreen if the state is on. { // Remove event handler for resizing. mainWindow.removeListener( 'resize', resizeHandler ); // Restore CSS styles for the entire node tree. var editorElements = [ contents, container ]; for ( var i = 0 ; i < editorElements.length ; i++ ) { restoreStyles( editorElements[i], editorElements[i].getCustomData( 'maximize_saved_styles' ) ); editorElements[i].removeCustomData( 'maximize_saved_styles' ); } currentNode = editor.container; while ( ( currentNode = currentNode.getParent() ) ) { restoreStyles( currentNode, currentNode.getCustomData( 'maximize_saved_styles' ) ); currentNode.removeCustomData( 'maximize_saved_styles' ); } // Restore the window scroll position. CKEDITOR.env.ie ? setTimeout( function() { mainWindow.$.scrollTo( outerScroll.x, outerScroll.y ); }, 0 ) : mainWindow.$.scrollTo( outerScroll.x, outerScroll.y ); // Remove cke_maximized class. container.removeClass( 'cke_maximized' ); // Webkit requires a re-layout on editor chrome. (#6695) if ( CKEDITOR.env.webkit ) { container.setStyle( 'display', 'inline' ); setTimeout( function(){ container.setStyle( 'display', 'block' ); }, 0 ); } if ( shim ) { shim.remove(); shim = null; } // Emit a resize event, because this time the size is modified in // restoreStyles. editor.fire( 'resize' ); } this.toggleState(); // Toggle button label. var button = this.uiItems[ 0 ]; // Only try to change the button if it exists (#6166) if( button ) { var label = ( this.state == CKEDITOR.TRISTATE_OFF ) ? lang.maximize : lang.minimize; var buttonNode = editor.element.getDocument().getById( button._.id ); buttonNode.getChild( 1 ).setHtml( label ); buttonNode.setAttribute( 'title', label ); buttonNode.setAttribute( 'href', 'javascript:void("' + label + '");' ); } // Restore selection and scroll position in editing area. if ( editor.mode == 'wysiwyg' ) { if ( savedSelection ) { // Fixing positioning editor chrome in Firefox break design mode. (#5149) CKEDITOR.env.gecko && refreshCursor( editor ); editor.getSelection().selectRanges(savedSelection); var element = editor.getSelection().getStartElement(); element && element.scrollIntoView( true ); } else mainWindow.$.scrollTo( savedScroll.x, savedScroll.y ); } else { if ( savedSelection ) { $textarea.selectionStart = savedSelection[0]; $textarea.selectionEnd = savedSelection[1]; } $textarea.scrollLeft = savedScroll[0]; $textarea.scrollTop = savedScroll[1]; } savedSelection = savedScroll = null; savedState = this.state; }, canUndo : false } ); editor.ui.addButton( 'Maximize', { label : lang.maximize, command : 'maximize' } ); // Restore the command state after mode change, unless it has been changed to disabled (#6467) editor.on( 'mode', function() { var command = editor.getCommand( 'maximize' ); command.setState( command.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : savedState ); }, null, null, 100 ); } } ); })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/maximize/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'about', function( editor ) { var lang = editor.lang.about; return { title : CKEDITOR.env.ie ? lang.dlgTitle : lang.title, minWidth : 390, minHeight : 230, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ { type : 'html', html : '<style type="text/css">' + '.cke_about_container' + '{' + 'color:#000 !important;' + 'padding:10px 10px 0;' + 'margin-top:5px' + '}' + '.cke_about_container p' + '{' + 'margin: 0 0 10px;' + '}' + '.cke_about_container .cke_about_logo' + '{' + 'height:81px;' + 'background-color:#fff;' + 'background-image:url(' + CKEDITOR.plugins.get( 'about' ).path + 'dialogs/logo_ckeditor.png);' + 'background-position:center; ' + 'background-repeat:no-repeat;' + 'margin-bottom:10px;' + '}' + '.cke_about_container a' + '{' + 'cursor:pointer !important;' + 'color:blue !important;' + 'text-decoration:underline !important;' + '}' + '</style>' + '<div class="cke_about_container">' + '<div class="cke_about_logo"></div>' + '<p>' + 'CKEditor ' + CKEDITOR.version + ' (revision ' + CKEDITOR.revision + ')<br>' + '<a href="http://ckeditor.com/">http://ckeditor.com</a>' + '</p>' + '<p>' + lang.moreInfo + '<br>' + '<a href="http://ckeditor.com/license">http://ckeditor.com/license</a>' + '</p>' + '<p>' + lang.copy.replace( '$1', '<a href="http://cksource.com/">CKSource</a> - Frederico Knabben' ) + '</p>' + '</div>' } ] } ], buttons : [ CKEDITOR.dialog.cancelButton ] }; } );
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/about/dialogs/about.js
about.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { var guardElements = { table:1, ul:1, ol:1, blockquote:1, div:1 }, directSelectionGuardElements = {}, // All guard elements which can have a direction applied on them. allGuardElements = {}; CKEDITOR.tools.extend( directSelectionGuardElements, guardElements, { tr:1, p:1, div:1, li:1 } ); CKEDITOR.tools.extend( allGuardElements, directSelectionGuardElements, { td:1 } ); function onSelectionChange( e ) { setToolbarStates( e ); handleMixedDirContent( e ); } function setToolbarStates( evt ) { var editor = evt.editor, path = evt.data.path; var useComputedState = editor.config.useComputedState, selectedElement; useComputedState = useComputedState === undefined || useComputedState; // We can use computedState provided by the browser or traverse parents manually. if ( !useComputedState ) selectedElement = getElementForDirection( path.lastElement ); selectedElement = selectedElement || path.block || path.blockLimit; // If we're having BODY here, user probably done CTRL+A, let's try to get the enclosed node, if any. selectedElement.is( 'body' ) && ( selectedElement = editor.getSelection().getRanges()[ 0 ].getEnclosedNode() ); if ( !selectedElement ) return; var selectionDir = useComputedState ? selectedElement.getComputedStyle( 'direction' ) : selectedElement.getStyle( 'direction' ) || selectedElement.getAttribute( 'dir' ); editor.getCommand( 'bidirtl' ).setState( selectionDir == 'rtl' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); editor.getCommand( 'bidiltr' ).setState( selectionDir == 'ltr' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); } function handleMixedDirContent( evt ) { var editor = evt.editor, chromeRoot = editor.container.getChild( 1 ), directionNode = evt.data.path.block || evt.data.path.blockLimit; if ( directionNode && editor.lang.dir != directionNode.getComputedStyle( 'direction' ) ) chromeRoot.addClass( 'cke_mixed_dir_content' ); else chromeRoot.removeClass( 'cke_mixed_dir_content' ); } /** * Returns element with possibility of applying the direction. * @param node */ function getElementForDirection( node ) { while ( node && !( node.getName() in allGuardElements || node.is( 'body' ) ) ) { var parent = node.getParent(); if ( !parent ) break; node = parent; } return node; } function switchDir( element, dir, editor, database ) { // Mark this element as processed by switchDir. CKEDITOR.dom.element.setMarker( database, element, 'bidi_processed', 1 ); // Check whether one of the ancestors has already been styled. var parent = element; while ( ( parent = parent.getParent() ) && !parent.is( 'body' ) ) { if ( parent.getCustomData( 'bidi_processed' ) ) { // Ancestor style must dominate. element.removeStyle( 'direction' ); element.removeAttribute( 'dir' ); return null; } } var useComputedState = ( 'useComputedState' in editor.config ) ? editor.config.useComputedState : 1; var elementDir = useComputedState ? element.getComputedStyle( 'direction' ) : element.getStyle( 'direction' ) || element.hasAttribute( 'dir' ); // Stop if direction is same as present. if ( elementDir == dir ) return null; // Reuse computedState if we already have it. var dirBefore = useComputedState ? elementDir : element.getComputedStyle( 'direction' ); // Clear direction on this element. element.removeStyle( 'direction' ); // Do the second check when computed state is ON, to check // if we need to apply explicit direction on this element. if ( useComputedState ) { element.removeAttribute( 'dir' ); if ( dir != element.getComputedStyle( 'direction' ) ) element.setAttribute( 'dir', dir ); } else // Set new direction for this element. element.setAttribute( 'dir', dir ); // If the element direction changed, we need to switch the margins of // the element and all its children, so it will get really reflected // like a mirror. (#5910) if ( dir != dirBefore ) { editor.fire( 'dirChanged', { node : element, dir : dir } ); } editor.forceNextSelectionCheck(); return null; } function getFullySelected( range, elements, enterMode ) { var ancestor = range.getCommonAncestor( false, true ); range = range.clone(); range.enlarge( enterMode == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS ); if ( range.checkBoundaryOfElement( ancestor, CKEDITOR.START ) && range.checkBoundaryOfElement( ancestor, CKEDITOR.END ) ) { var parent; while ( ancestor && ancestor.type == CKEDITOR.NODE_ELEMENT && ( parent = ancestor.getParent() ) && parent.getChildCount() == 1 && !( ancestor.getName() in elements ) ) ancestor = parent; return ancestor.type == CKEDITOR.NODE_ELEMENT && ( ancestor.getName() in elements ) && ancestor; } } function bidiCommand( dir ) { return function( editor ) { var selection = editor.getSelection(), enterMode = editor.config.enterMode, ranges = selection.getRanges(); if ( ranges && ranges.length ) { var database = {}; // Creates bookmarks for selection, as we may split some blocks. var bookmarks = selection.createBookmarks(); var rangeIterator = ranges.createIterator(), range, i = 0; while ( ( range = rangeIterator.getNextRange( 1 ) ) ) { // Apply do directly selected elements from guardElements. var selectedElement = range.getEnclosedNode(); // If this is not our element of interest, apply to fully selected elements from guardElements. if ( !selectedElement || selectedElement && !( selectedElement.type == CKEDITOR.NODE_ELEMENT && selectedElement.getName() in directSelectionGuardElements ) ) selectedElement = getFullySelected( range, guardElements, enterMode ); if ( selectedElement && !selectedElement.isReadOnly() ) switchDir( selectedElement, dir, editor, database ); var iterator, block; // Walker searching for guardElements. var walker = new CKEDITOR.dom.walker( range ); var start = bookmarks[ i ].startNode, end = bookmarks[ i++ ].endNode; walker.evaluator = function( node ) { return !! ( node.type == CKEDITOR.NODE_ELEMENT && node.getName() in guardElements && !( node.getName() == ( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) && node.getParent().type == CKEDITOR.NODE_ELEMENT && node.getParent().getName() == 'blockquote' ) // Element must be fully included in the range as well. (#6485). && node.getPosition( start ) & CKEDITOR.POSITION_FOLLOWING && ( ( node.getPosition( end ) & CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS ) == CKEDITOR.POSITION_PRECEDING ) ); }; while ( ( block = walker.next() ) ) switchDir( block, dir, editor, database ); iterator = range.createIterator(); iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR; while ( ( block = iterator.getNextParagraph( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ) ) !block.isReadOnly() && switchDir( block, dir, editor, database ); } CKEDITOR.dom.element.clearAllMarkers( database ); editor.forceNextSelectionCheck(); // Restore selection position. selection.selectBookmarks( bookmarks ); editor.focus(); } }; } CKEDITOR.plugins.add( 'bidi', { requires : [ 'styles', 'button' ], init : function( editor ) { // All buttons use the same code to register. So, to avoid // duplications, let's use this tool function. var addButtonCommand = function( buttonName, buttonLabel, commandName, commandExec ) { editor.addCommand( commandName, new CKEDITOR.command( editor, { exec : commandExec }) ); editor.ui.addButton( buttonName, { label : buttonLabel, command : commandName }); }; var lang = editor.lang.bidi; addButtonCommand( 'BidiLtr', lang.ltr, 'bidiltr', bidiCommand( 'ltr' ) ); addButtonCommand( 'BidiRtl', lang.rtl, 'bidirtl', bidiCommand( 'rtl' ) ); editor.on( 'selectionChange', onSelectionChange ); } }); })(); /** * Fired when the language direction of an element is changed * @name CKEDITOR.editor#dirChanged * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {Object} eventData.node The element that is being changed. * @param {String} eventData.dir The new direction. */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/bidi/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'smiley', { requires : [ 'dialog' ], init : function( editor ) { editor.config.smiley_path = editor.config.smiley_path || ( this.path + 'images/' ); editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley' ) ); editor.ui.addButton( 'Smiley', { label : editor.lang.smiley.toolbar, command : 'smiley' }); CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' ); } } ); /** * The base path used to build the URL for the smiley images. It must end with * a slash. * @name CKEDITOR.config.smiley_path * @type String * @default {@link CKEDITOR.basePath} + 'plugins/smiley/images/' * @example * config.smiley_path = 'http://www.example.com/images/smileys/'; * @example * config.smiley_path = '/images/smileys/'; */ /** * The file names for the smileys to be displayed. These files must be * contained inside the URL path defined with the * {@link CKEDITOR.config.smiley_path} setting. * @type Array * @default (see example) * @example * // This is actually the default value. * config.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']; */ CKEDITOR.config.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']; /** * The description to be used for each of the smileys defined in the * {@link CKEDITOR.config.smiley_images} setting. Each entry in this array list * must match its relative pair in the {@link CKEDITOR.config.smiley_images} * setting. * @type Array * @default The textual descriptions of smiley. * @example * // Default settings. * config.smiley_descriptions = * [ * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', * 'yes', 'heart', 'broken heart', 'kiss', 'mail' * ]; * @example * // Use textual emoticons as description. * config.smiley_descriptions = * [ * ':)', ':(', ';)', ':D', ':/', ':P', ':*)', ':-o', * ':|', '>:(', 'o:)', '8-)', '>:-)', ';(', '', '', '', * '', '', ':-*', '' * ]; */ CKEDITOR.config.smiley_descriptions = [ 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', 'yes', 'heart', 'broken heart', 'kiss', 'mail' ]; /** * The number of columns to be generated by the smilies matrix. * @name CKEDITOR.config.smiley_columns * @type Number * @default 8 * @since 3.3.2 * @example * config.smiley_columns = 6; */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/smiley/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'smiley', function( editor ) { var config = editor.config, lang = editor.lang.smiley, images = config.smiley_images, columns = config.smiley_columns || 8, i; /** * Simulate "this" of a dialog for non-dialog events. * @type {CKEDITOR.dialog} */ var dialog; var onClick = function( evt ) { var target = evt.data.getTarget(), targetName = target.getName(); if ( targetName == 'a' ) target = target.getChild( 0 ); else if ( targetName != 'img' ) return; var src = target.getAttribute( 'cke_src' ), title = target.getAttribute( 'title' ); var img = editor.document.createElement( 'img', { attributes : { src : src, 'data-cke-saved-src' : src, title : title, alt : title, width : target.$.width, height : target.$.height } }); editor.insertElement( img ); dialog.hide(); evt.data.preventDefault(); }; var onKeydown = CKEDITOR.tools.addFunction( function( ev, element ) { ev = new CKEDITOR.dom.event( ev ); element = new CKEDITOR.dom.element( element ); var relative, nodeToMove; var keystroke = ev.getKeystroke(), rtl = editor.lang.dir == 'rtl'; switch ( keystroke ) { // UP-ARROW case 38 : // relative is TR if ( ( relative = element.getParent().getParent().getPrevious() ) ) { nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] ); nodeToMove.focus(); } ev.preventDefault(); break; // DOWN-ARROW case 40 : // relative is TR if ( ( relative = element.getParent().getParent().getNext() ) ) { nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] ); if ( nodeToMove ) nodeToMove.focus(); } ev.preventDefault(); break; // ENTER // SPACE case 32 : onClick( { data: ev } ); ev.preventDefault(); break; // RIGHT-ARROW case rtl ? 37 : 39 : // TAB case 9 : // relative is TD if ( ( relative = element.getParent().getNext() ) ) { nodeToMove = relative.getChild( 0 ); nodeToMove.focus(); ev.preventDefault(true); } // relative is TR else if ( ( relative = element.getParent().getParent().getNext() ) ) { nodeToMove = relative.getChild( [0, 0] ); if ( nodeToMove ) nodeToMove.focus(); ev.preventDefault(true); } break; // LEFT-ARROW case rtl ? 39 : 37 : // SHIFT + TAB case CKEDITOR.SHIFT + 9 : // relative is TD if ( ( relative = element.getParent().getPrevious() ) ) { nodeToMove = relative.getChild( 0 ); nodeToMove.focus(); ev.preventDefault(true); } // relative is TR else if ( ( relative = element.getParent().getParent().getPrevious() ) ) { nodeToMove = relative.getLast().getChild( 0 ); nodeToMove.focus(); ev.preventDefault(true); } break; default : // Do not stop not handled events. return; } }); // Build the HTML for the smiley images table. var labelId = CKEDITOR.tools.getNextId() + '_smiley_emtions_label'; var html = [ '<div>' + '<span id="' + labelId + '" class="cke_voice_label">' + lang.options +'</span>', '<table role="listbox" aria-labelledby="' + labelId + '" style="width:100%;height:100%" cellspacing="2" cellpadding="2"', CKEDITOR.env.ie && CKEDITOR.env.quirks ? ' style="position:absolute;"' : '', '><tbody>' ]; var size = images.length; for ( i = 0 ; i < size ; i++ ) { if ( i % columns === 0 ) html.push( '<tr>' ); var smileyLabelId = 'cke_smile_label_' + i + '_' + CKEDITOR.tools.getNextNumber(); html.push( '<td class="cke_dark_background cke_centered" style="vertical-align: middle;">' + '<a href="javascript:void(0)" role="option"', ' aria-posinset="' + ( i +1 ) + '"', ' aria-setsize="' + size + '"', ' aria-labelledby="' + smileyLabelId + '"', ' class="cke_smile cke_hand" tabindex="-1" onkeydown="CKEDITOR.tools.callFunction( ', onKeydown, ', event, this );">', '<img class="cke_hand" title="', config.smiley_descriptions[i], '"' + ' cke_src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '" alt="', config.smiley_descriptions[i], '"', ' src="', CKEDITOR.tools.htmlEncode( config.smiley_path + images[ i ] ), '"', // IE BUG: Below is a workaround to an IE image loading bug to ensure the image sizes are correct. ( CKEDITOR.env.ie ? ' onload="this.setAttribute(\'width\', 2); this.removeAttribute(\'width\');" ' : '' ), '>' + '<span id="' + smileyLabelId + '" class="cke_voice_label">' +config.smiley_descriptions[ i ] + '</span>' + '</a>', '</td>' ); if ( i % columns == columns - 1 ) html.push( '</tr>' ); } if ( i < columns - 1 ) { for ( ; i < columns - 1 ; i++ ) html.push( '<td></td>' ); html.push( '</tr>' ); } html.push( '</tbody></table></div>' ); var smileySelector = { type : 'html', html : html.join( '' ), onLoad : function( event ) { dialog = event.sender; }, focus : function() { var self = this; // IE need a while to move the focus (#6539). setTimeout( function () { var firstSmile = self.getElement().getElementsByTag( 'a' ).getItem( 0 ); firstSmile.focus(); }, 0 ); }, onClick : onClick, style : 'width: 100%; border-collapse: separate;' }; return { title : editor.lang.smiley.title, minWidth : 270, minHeight : 120, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ smileySelector ] } ], buttons : [ CKEDITOR.dialog.cancelButton ] }; } );
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/smiley/dialogs/smiley.js
smiley.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'button', { beforeInit : function( editor ) { editor.ui.addHandler( CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler ); } }); /** * Button UI element. * @constant * @example */ CKEDITOR.UI_BUTTON = 1; /** * Represents a button UI element. This class should not be called directly. To * create new buttons use {@link CKEDITOR.ui.prototype.addButton} instead. * @constructor * @param {Object} definition The button definition. * @example */ CKEDITOR.ui.button = function( definition ) { // Copy all definition properties to this object. CKEDITOR.tools.extend( this, definition, // Set defaults. { title : definition.label, className : definition.className || ( definition.command && 'cke_button_' + definition.command ) || '', click : definition.click || function( editor ) { editor.execCommand( definition.command ); } }); this._ = {}; }; /** * Transforms a button definition in a {@link CKEDITOR.ui.button} instance. * @type Object * @example */ CKEDITOR.ui.button.handler = { create : function( definition ) { return new CKEDITOR.ui.button( definition ); } }; /** * Handles a button click. * @private */ CKEDITOR.ui.button._ = { instances : [], keydown : function( index, ev ) { var instance = CKEDITOR.ui.button._.instances[ index ]; if ( instance.onkey ) { ev = new CKEDITOR.dom.event( ev ); return ( instance.onkey( instance, ev.getKeystroke() ) !== false ); } }, focus : function( index, ev ) { var instance = CKEDITOR.ui.button._.instances[ index ], retVal; if ( instance.onfocus ) retVal = ( instance.onfocus( instance, new CKEDITOR.dom.event( ev ) ) !== false ); // FF2: prevent focus event been bubbled up to editor container, which caused unexpected editor focus. if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ev.preventBubble(); return retVal; } }; ( function() { var keydownFn = CKEDITOR.tools.addFunction( CKEDITOR.ui.button._.keydown, CKEDITOR.ui.button._ ), focusFn = CKEDITOR.tools.addFunction( CKEDITOR.ui.button._.focus, CKEDITOR.ui.button._ ); CKEDITOR.ui.button.prototype = { canGroup : true, /** * Renders the button. * @param {CKEDITOR.editor} editor The editor instance which this button is * to be used by. * @param {Array} output The output array to which append the HTML relative * to this button. * @example */ render : function( editor, output ) { var env = CKEDITOR.env, id = this._.id = CKEDITOR.tools.getNextId(), classes = '', command = this.command, // Get the command name. clickFn, index; this._.editor = editor; var instance = { id : id, button : this, editor : editor, focus : function() { var element = CKEDITOR.document.getById( id ); element.focus(); }, execute : function() { this.button.click( editor ); } }; instance.clickFn = clickFn = CKEDITOR.tools.addFunction( instance.execute, instance ); instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1; // Indicate a mode sensitive button. if ( this.modes ) { var modeStates = {}; editor.on( 'beforeModeUnload', function() { modeStates[ editor.mode ] = this._.state; }, this ); editor.on( 'mode', function() { var mode = editor.mode; // Restore saved button state. this.setState( this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); }, this); } else if ( command ) { // Get the command instance. command = editor.getCommand( command ); if ( command ) { command.on( 'state', function() { this.setState( command.state ); }, this); classes += 'cke_' + ( command.state == CKEDITOR.TRISTATE_ON ? 'on' : command.state == CKEDITOR.TRISTATE_DISABLED ? 'disabled' : 'off' ); } } if ( !command ) classes += 'cke_off'; if ( this.className ) classes += ' ' + this.className; output.push( '<span class="cke_button' + ( this.icon && this.icon.indexOf( '.png' ) == -1 ? ' cke_noalphafix' : '' ) + '">', '<a id="', id, '"' + ' class="', classes, '"', env.gecko && env.version >= 10900 && !env.hc ? '' : '" href="javascript:void(\''+ ( this.title || '' ).replace( "'", '' )+ '\')"', ' title="', this.title, '"' + ' tabindex="-1"' + ' hidefocus="true"' + ' role="button"' + ' aria-labelledby="' + id + '_label"' + ( this.hasArrow ? ' aria-haspopup="true"' : '' ) ); // Some browsers don't cancel key events in the keydown but in the // keypress. // TODO: Check if really needed for Gecko+Mac. if ( env.opera || ( env.gecko && env.mac ) ) { output.push( ' onkeypress="return false;"' ); } // With Firefox, we need to force the button to redraw, otherwise it // will remain in the focus state. if ( env.gecko ) { output.push( ' onblur="this.style.cssText = this.style.cssText;"' ); } output.push( ' onkeydown="return CKEDITOR.tools.callFunction(', keydownFn, ', ', index, ', event);"' + ' onfocus="return CKEDITOR.tools.callFunction(', focusFn,', ', index, ', event);"' + ' onclick="CKEDITOR.tools.callFunction(', clickFn, ', this); return false;">' + '<span class="cke_icon"' ); if ( this.icon ) { var offset = ( this.iconOffset || 0 ) * -16; output.push( ' style="background-image:url(', CKEDITOR.getUrl( this.icon ), ');background-position:0 ' + offset + 'px;"' ); } output.push( '>&nbsp;</span>' + '<span id="', id, '_label" class="cke_label">', this.label, '</span>' ); if ( this.hasArrow ) { output.push( '<span class="cke_buttonarrow">' // BLACK DOWN-POINTING TRIANGLE + ( CKEDITOR.env.hc ? '&#9660;' : '&nbsp;' ) + '</span>' ); } output.push( '</a>', '</span>' ); if ( this.onRender ) this.onRender(); return instance; }, setState : function( state ) { if ( this._.state == state ) return false; this._.state = state; var element = CKEDITOR.document.getById( this._.id ); if ( element ) { element.setState( state ); state == CKEDITOR.TRISTATE_DISABLED ? element.setAttribute( 'aria-disabled', true ) : element.removeAttribute( 'aria-disabled' ); state == CKEDITOR.TRISTATE_ON ? element.setAttribute( 'aria-pressed', true ) : element.removeAttribute( 'aria-pressed' ); return true; } else return false; } }; })(); /** * Adds a button definition to the UI elements list. * @param {String} The button name. * @param {Object} The button definition. * @example * editorInstance.ui.addButton( 'MyBold', * { * label : 'My Bold', * command : 'bold' * }); */ CKEDITOR.ui.prototype.addButton = function( name, definition ) { this.add( name, CKEDITOR.UI_BUTTON, definition ); }; CKEDITOR.on( 'reset', function() { CKEDITOR.ui.button._.instances = []; });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/button/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { // #### checkSelectionChange : START // The selection change check basically saves the element parent tree of // the current node and check it on successive requests. If there is any // change on the tree, then the selectionChange event gets fired. function checkSelectionChange() { try { // In IE, the "selectionchange" event may still get thrown when // releasing the WYSIWYG mode, so we need to check it first. var sel = this.getSelection(); if ( !sel || !sel.document.getWindow().$ ) return; var firstElement = sel.getStartElement(); var currentPath = new CKEDITOR.dom.elementPath( firstElement ); if ( !currentPath.compare( this._.selectionPreviousPath ) ) { this._.selectionPreviousPath = currentPath; this.fire( 'selectionChange', { selection : sel, path : currentPath, element : firstElement } ); } } catch (e) {} } var checkSelectionChangeTimer, checkSelectionChangeTimeoutPending; function checkSelectionChangeTimeout() { // Firing the "OnSelectionChange" event on every key press started to // be too slow. This function guarantees that there will be at least // 200ms delay between selection checks. checkSelectionChangeTimeoutPending = true; if ( checkSelectionChangeTimer ) return; checkSelectionChangeTimeoutExec.call( this ); checkSelectionChangeTimer = CKEDITOR.tools.setTimeout( checkSelectionChangeTimeoutExec, 200, this ); } function checkSelectionChangeTimeoutExec() { checkSelectionChangeTimer = null; if ( checkSelectionChangeTimeoutPending ) { // Call this with a timeout so the browser properly moves the // selection after the mouseup. It happened that the selection was // being moved after the mouseup when clicking inside selected text // with Firefox. CKEDITOR.tools.setTimeout( checkSelectionChange, 0, this ); checkSelectionChangeTimeoutPending = false; } } // #### checkSelectionChange : END var selectAllCmd = { modes : { wysiwyg : 1, source : 1 }, exec : function( editor ) { switch ( editor.mode ) { case 'wysiwyg' : editor.document.$.execCommand( 'SelectAll', false, null ); // Force triggering selectionChange (#7008) editor.forceNextSelectionCheck(); editor.selectionChange(); break; case 'source' : // Select the contents of the textarea var textarea = editor.textarea.$; if ( CKEDITOR.env.ie ) textarea.createTextRange().execCommand( 'SelectAll' ); else { textarea.selectionStart = 0; textarea.selectionEnd = textarea.value.length; } textarea.focus(); } }, canUndo : false }; CKEDITOR.plugins.add( 'selection', { init : function( editor ) { editor.on( 'contentDom', function() { var doc = editor.document, body = doc.getBody(), html = doc.getDocumentElement(); if ( CKEDITOR.env.ie ) { // Other browsers don't loose the selection if the // editor document loose the focus. In IE, we don't // have support for it, so we reproduce it here, other // than firing the selection change event. var savedRange, saveEnabled, restoreEnabled = 1; // "onfocusin" is fired before "onfocus". It makes it // possible to restore the selection before click // events get executed. body.on( 'focusin', function( evt ) { // If there are elements with layout they fire this event but // it must be ignored to allow edit its contents #4682 if ( evt.data.$.srcElement.nodeName != 'BODY' ) return; // If we have saved a range, restore it at this // point. if ( savedRange ) { // Range restored here might invalidate the DOM structure thus break up // the locked selection, give it up. (#6083) var lockedSelection = doc.getCustomData( 'cke_locked_selection' ); if ( restoreEnabled && !lockedSelection ) { // Well not break because of this. try { savedRange.select(); } catch (e) {} } savedRange = null; } }); body.on( 'focus', function() { // Enable selections to be saved. saveEnabled = 1; saveSelection(); }); body.on( 'beforedeactivate', function( evt ) { // Ignore this event if it's caused by focus switch between // internal editable control type elements, e.g. layouted paragraph. (#4682) if ( evt.data.$.toElement ) return; // Disable selections from being saved. saveEnabled = 0; restoreEnabled = 1; }); // IE before version 8 will leave cursor blinking inside the document after // editor blurred unless we clean up the selection. (#4716) if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) { editor.on( 'blur', function( evt ) { // Try/Catch to avoid errors if the editor is hidden. (#6375) try { editor.document && editor.document.$.selection.empty(); } catch (e) {} }); } // Listening on document element ensures that // scrollbar is included. (#5280) html.on( 'mousedown', function() { // Lock restore selection now, as we have // a followed 'click' event which introduce // new selection. (#5735) restoreEnabled = 0; }); html.on( 'mouseup', function() { restoreEnabled = 1; }); // In IE6/7 the blinking cursor appears, but contents are // not editable. (#5634) if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.version < 8 || CKEDITOR.env.quirks ) ) { // The 'click' event is not fired when clicking the // scrollbars, so we can use it to check whether // the empty space following <body> has been clicked. html.on( 'click', function( evt ) { if ( evt.data.getTarget().getName() == 'html' ) editor.getSelection().getRanges()[ 0 ].select(); }); } var scroll; // IE fires the "selectionchange" event when clicking // inside a selection. We don't want to capture that. body.on( 'mousedown', function( evt ) { // IE scrolls document to top on right mousedown // when editor has no focus, remember this scroll // position and revert it before context menu opens. (#5778) if ( evt.data.$.button == 2 ) { var sel = editor.document.$.selection; if ( sel.type == 'None' ) scroll = editor.window.getScrollPosition(); } disableSave(); }); body.on( 'mouseup', function( evt ) { // Restore recorded scroll position when needed on right mouseup. if ( evt.data.$.button == 2 && scroll ) { editor.document.$.documentElement.scrollLeft = scroll.x; editor.document.$.documentElement.scrollTop = scroll.y; } scroll = null; saveEnabled = 1; setTimeout( function() { saveSelection( true ); }, 0 ); }); body.on( 'keydown', disableSave ); body.on( 'keyup', function() { saveEnabled = 1; saveSelection(); }); // IE is the only to provide the "selectionchange" // event. doc.on( 'selectionchange', saveSelection ); function disableSave() { saveEnabled = 0; } function saveSelection( testIt ) { if ( saveEnabled ) { var doc = editor.document, sel = editor.getSelection(), nativeSel = sel && sel.getNative(); // There is a very specific case, when clicking // inside a text selection. In that case, the // selection collapses at the clicking point, // but the selection object remains in an // unknown state, making createRange return a // range at the very start of the document. In // such situation we have to test the range, to // be sure it's valid. if ( testIt && nativeSel && nativeSel.type == 'None' ) { // The "InsertImage" command can be used to // test whether the selection is good or not. // If not, it's enough to give some time to // IE to put things in order for us. if ( !doc.$.queryCommandEnabled( 'InsertImage' ) ) { CKEDITOR.tools.setTimeout( saveSelection, 50, this, true ); return; } } // Avoid saving selection from within text input. (#5747) var parentTag; if ( nativeSel && nativeSel.type && nativeSel.type != 'Control' && ( parentTag = nativeSel.createRange() ) && ( parentTag = parentTag.parentElement() ) && ( parentTag = parentTag.nodeName ) && parentTag.toLowerCase() in { input: 1, textarea : 1 } ) { return; } savedRange = nativeSel && sel.getRanges()[ 0 ]; checkSelectionChangeTimeout.call( editor ); } } } else { // In other browsers, we make the selection change // check based on other events, like clicks or keys // press. doc.on( 'mouseup', checkSelectionChangeTimeout, editor ); doc.on( 'keyup', checkSelectionChangeTimeout, editor ); } }); // Clear the cached range path before unload. (#7174) editor.on( 'contentDomUnload', editor.forceNextSelectionCheck, editor ); editor.addCommand( 'selectAll', selectAllCmd ); editor.ui.addButton( 'SelectAll', { label : editor.lang.selectAll, command : 'selectAll' }); editor.selectionChange = checkSelectionChangeTimeout; } }); /** * Gets the current selection from the editing area when in WYSIWYG mode. * @returns {CKEDITOR.dom.selection} A selection object or null if not on * WYSIWYG mode or no selection is available. * @example * var selection = CKEDITOR.instances.editor1.<b>getSelection()</b>; * alert( selection.getType() ); */ CKEDITOR.editor.prototype.getSelection = function() { return this.document && this.document.getSelection(); }; CKEDITOR.editor.prototype.forceNextSelectionCheck = function() { delete this._.selectionPreviousPath; }; /** * Gets the current selection from the document. * @returns {CKEDITOR.dom.selection} A selection object. * @example * var selection = CKEDITOR.instances.editor1.document.<b>getSelection()</b>; * alert( selection.getType() ); */ CKEDITOR.dom.document.prototype.getSelection = function() { var sel = new CKEDITOR.dom.selection( this ); return ( !sel || sel.isInvalid ) ? null : sel; }; /** * No selection. * @constant * @example * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_NONE ) * alert( 'Nothing is selected' ); */ CKEDITOR.SELECTION_NONE = 1; /** * Text or collapsed selection. * @constant * @example * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_TEXT ) * alert( 'Text is selected' ); */ CKEDITOR.SELECTION_TEXT = 2; /** * Element selection. * @constant * @example * if ( editor.getSelection().getType() == CKEDITOR.SELECTION_ELEMENT ) * alert( 'An element is selected' ); */ CKEDITOR.SELECTION_ELEMENT = 3; /** * Manipulates the selection in a DOM document. * @constructor * @example */ CKEDITOR.dom.selection = function( document ) { var lockedSelection = document.getCustomData( 'cke_locked_selection' ); if ( lockedSelection ) return lockedSelection; this.document = document; this.isLocked = 0; this._ = { cache : {} }; /** * IE BUG: The selection's document may be a different document than the * editor document. Return null if that's the case. */ if ( CKEDITOR.env.ie ) { var range = this.getNative().createRange(); if ( !range || ( range.item && range.item(0).ownerDocument != this.document.$ ) || ( range.parentElement && range.parentElement().ownerDocument != this.document.$ ) ) { this.isInvalid = true; } } return this; }; var styleObjectElements = { img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1, a:1, input:1, form:1, select:1, textarea:1, button:1, fieldset:1, th:1, thead:1, tfoot:1 }; CKEDITOR.dom.selection.prototype = { /** * Gets the native selection object from the browser. * @function * @returns {Object} The native selection object. * @example * var selection = editor.getSelection().<b>getNative()</b>; */ getNative : CKEDITOR.env.ie ? function() { return this._.cache.nativeSel || ( this._.cache.nativeSel = this.document.$.selection ); } : function() { return this._.cache.nativeSel || ( this._.cache.nativeSel = this.document.getWindow().$.getSelection() ); }, /** * Gets the type of the current selection. The following values are * available: * <ul> * <li>{@link CKEDITOR.SELECTION_NONE} (1): No selection.</li> * <li>{@link CKEDITOR.SELECTION_TEXT} (2): Text is selected or * collapsed selection.</li> * <li>{@link CKEDITOR.SELECTION_ELEMENT} (3): A element * selection.</li> * </ul> * @function * @returns {Number} One of the following constant values: * {@link CKEDITOR.SELECTION_NONE}, {@link CKEDITOR.SELECTION_TEXT} or * {@link CKEDITOR.SELECTION_ELEMENT}. * @example * if ( editor.getSelection().<b>getType()</b> == CKEDITOR.SELECTION_TEXT ) * alert( 'Text is selected' ); */ getType : CKEDITOR.env.ie ? function() { var cache = this._.cache; if ( cache.type ) return cache.type; var type = CKEDITOR.SELECTION_NONE; try { var sel = this.getNative(), ieType = sel.type; if ( ieType == 'Text' ) type = CKEDITOR.SELECTION_TEXT; if ( ieType == 'Control' ) type = CKEDITOR.SELECTION_ELEMENT; // It is possible that we can still get a text range // object even when type == 'None' is returned by IE. // So we'd better check the object returned by // createRange() rather than by looking at the type. if ( sel.createRange().parentElement ) type = CKEDITOR.SELECTION_TEXT; } catch(e) {} return ( cache.type = type ); } : function() { var cache = this._.cache; if ( cache.type ) return cache.type; var type = CKEDITOR.SELECTION_TEXT; var sel = this.getNative(); if ( !sel ) type = CKEDITOR.SELECTION_NONE; else if ( sel.rangeCount == 1 ) { // Check if the actual selection is a control (IMG, // TABLE, HR, etc...). var range = sel.getRangeAt(0), startContainer = range.startContainer; if ( startContainer == range.endContainer && startContainer.nodeType == 1 && ( range.endOffset - range.startOffset ) == 1 && styleObjectElements[ startContainer.childNodes[ range.startOffset ].nodeName.toLowerCase() ] ) { type = CKEDITOR.SELECTION_ELEMENT; } } return ( cache.type = type ); }, /** * Retrieve the {@link CKEDITOR.dom.range} instances that represent the current selection. * Note: Some browsers returns multiple ranges even on a sequent selection, e.g. Firefox returns * one range for each table cell when one or more table row is selected. * @return {Array} * @example * var ranges = selection.getRanges(); * alert(ranges.length); */ getRanges : (function() { var func = CKEDITOR.env.ie ? ( function() { function getNodeIndex( node ) { return new CKEDITOR.dom.node( node ).getIndex(); } // Finds the container and offset for a specific boundary // of an IE range. var getBoundaryInformation = function( range, start ) { // Creates a collapsed range at the requested boundary. range = range.duplicate(); range.collapse( start ); // Gets the element that encloses the range entirely. var parent = range.parentElement(); // Empty parent element, e.g. <i>^</i> if ( !parent.hasChildNodes() ) return { container : parent, offset : 0 }; var siblings = parent.children, child, testRange = range.duplicate(), startIndex = 0, endIndex = siblings.length - 1, index = -1, position, distance; // Binary search over all element childs to test the range to see whether // range is right on the boundary of one element. while ( startIndex <= endIndex ) { index = Math.floor( ( startIndex + endIndex ) / 2 ); child = siblings[ index ]; testRange.moveToElementText( child ); position = testRange.compareEndPoints( 'StartToStart', range ); if ( position > 0 ) endIndex = index - 1; else if ( position < 0 ) startIndex = index + 1; else return { container : parent, offset : getNodeIndex( child ) }; } // All childs are text nodes, // or to the right hand of test range are all text nodes. (#6992) if ( index == -1 || index == siblings.length - 1 && position < 0 ) { // Adapt test range to embrace the entire parent contents. testRange.moveToElementText( parent ); testRange.setEndPoint( 'StartToStart', range ); // IE report line break as CRLF with range.text but // only LF with textnode.nodeValue, normalize them to avoid // breaking character counting logic below. (#3949) distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length; siblings = parent.childNodes; // Actual range anchor right beside test range at the boundary of text node. if ( !distance ) { child = siblings[ siblings.length - 1 ]; if ( child.nodeType == CKEDITOR.NODE_ELEMENT ) return { container : parent, offset : siblings.length }; else return { container : child, offset : child.nodeValue.length }; } // Start the measuring until distance overflows, meanwhile count the text nodes. var i = siblings.length; while ( distance > 0 ) distance -= siblings[ --i ].nodeValue.length; return { container : siblings[ i ], offset : -distance }; } // Test range was one offset beyond OR behind the anchored text node. else { // Adapt one side of test range to the actual range // for measuring the offset between them. testRange.collapse( position > 0 ? true : false ); testRange.setEndPoint( position > 0 ? 'StartToStart' : 'EndToStart', range ); // IE report line break as CRLF with range.text but // only LF with textnode.nodeValue, normalize them to avoid // breaking character counting logic below. (#3949) distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length; // Actual range anchor right beside test range at the inner boundary of text node. if ( !distance ) return { container : parent, offset : getNodeIndex( child ) + ( position > 0 ? 0 : 1 ) }; // Start the measuring until distance overflows, meanwhile count the text nodes. while ( distance > 0 ) { child = child[ position > 0 ? 'previousSibling' : 'nextSibling' ]; try { distance -= child.nodeValue.length; } // Measurement in IE could be somtimes wrong because of <select> element. (#4611) catch( e ) { return { container : parent, offset : getNodeIndex( child ) }; } } return { container : child, offset : position > 0 ? -distance : child.nodeValue.length + distance }; } }; return function() { // IE doesn't have range support (in the W3C way), so we // need to do some magic to transform selections into // CKEDITOR.dom.range instances. var sel = this.getNative(), nativeRange = sel && sel.createRange(), type = this.getType(), range; if ( !sel ) return []; if ( type == CKEDITOR.SELECTION_TEXT ) { range = new CKEDITOR.dom.range( this.document ); var boundaryInfo = getBoundaryInformation( nativeRange, true ); range.setStart( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset ); boundaryInfo = getBoundaryInformation( nativeRange ); range.setEnd( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset ); // Correct an invalid IE range case on empty list item. (#5850) if ( range.endContainer.getPosition( range.startContainer ) & CKEDITOR.POSITION_PRECEDING && range.endOffset <= range.startContainer.getIndex() ) { range.collapse(); } return [ range ]; } else if ( type == CKEDITOR.SELECTION_ELEMENT ) { var retval = []; for ( var i = 0 ; i < nativeRange.length ; i++ ) { var element = nativeRange.item( i ), parentElement = element.parentNode, j = 0; range = new CKEDITOR.dom.range( this.document ); for (; j < parentElement.childNodes.length && parentElement.childNodes[j] != element ; j++ ) { /*jsl:pass*/ } range.setStart( new CKEDITOR.dom.node( parentElement ), j ); range.setEnd( new CKEDITOR.dom.node( parentElement ), j + 1 ); retval.push( range ); } return retval; } return []; }; })() : function() { // On browsers implementing the W3C range, we simply // tranform the native ranges in CKEDITOR.dom.range // instances. var ranges = [], range, doc = this.document, sel = this.getNative(); if ( !sel ) return ranges; // On WebKit, it may happen that we'll have no selection // available. We normalize it here by replicating the // behavior of other browsers. if ( !sel.rangeCount ) { range = new CKEDITOR.dom.range( doc ); range.moveToElementEditStart( doc.getBody() ); ranges.push( range ); } for ( var i = 0 ; i < sel.rangeCount ; i++ ) { var nativeRange = sel.getRangeAt( i ); range = new CKEDITOR.dom.range( doc ); range.setStart( new CKEDITOR.dom.node( nativeRange.startContainer ), nativeRange.startOffset ); range.setEnd( new CKEDITOR.dom.node( nativeRange.endContainer ), nativeRange.endOffset ); ranges.push( range ); } return ranges; }; return function( onlyEditables ) { var cache = this._.cache; if ( cache.ranges && !onlyEditables ) return cache.ranges; else if ( !cache.ranges ) cache.ranges = new CKEDITOR.dom.rangeList( func.call( this ) ); // Split range into multiple by read-only nodes. if ( onlyEditables ) { var ranges = cache.ranges; for ( var i = 0; i < ranges.length; i++ ) { var range = ranges[ i ]; // Drop range spans inside one ready-only node. var parent = range.getCommonAncestor(); if ( parent.isReadOnly() ) ranges.splice( i, 1 ); if ( range.collapsed ) continue; var startContainer = range.startContainer, endContainer = range.endContainer, startOffset = range.startOffset, endOffset = range.endOffset, walkerRange = range.clone(); // Range may start inside a non-editable element, restart range // by the end of it. var readOnly; if ( ( readOnly = startContainer.isReadOnly() ) ) range.setStartAfter( readOnly ); // Enlarge range start/end with text node to avoid walker // being DOM destructive, it doesn't interfere our checking // of elements below as well. if ( startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) { if ( startOffset >= startContainer.getLength() ) walkerRange.setStartAfter( startContainer ); else walkerRange.setStartBefore( startContainer ); } if ( endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) { if ( !endOffset ) walkerRange.setEndBefore( endContainer ); else walkerRange.setEndAfter( endContainer ); } // Looking for non-editable element inside the range. var walker = new CKEDITOR.dom.walker( walkerRange ); walker.evaluator = function( node ) { if ( node.type == CKEDITOR.NODE_ELEMENT && node.isReadOnly() ) { var newRange = range.clone(); range.setEndBefore( node ); // Drop collapsed range around read-only elements, // it make sure the range list empty when selecting // only non-editable elements. if ( range.collapsed ) ranges.splice( i--, 1 ); // Avoid creating invalid range. if ( !( node.getPosition( walkerRange.endContainer ) & CKEDITOR.POSITION_CONTAINS ) ) { newRange.setStartAfter( node ); if ( !newRange.collapsed ) ranges.splice( i + 1, 0, newRange ); } return true; } return false; }; walker.next(); } } return cache.ranges; }; })(), /** * Gets the DOM element in which the selection starts. * @returns {CKEDITOR.dom.element} The element at the beginning of the * selection. * @example * var element = editor.getSelection().<b>getStartElement()</b>; * alert( element.getName() ); */ getStartElement : function() { var cache = this._.cache; if ( cache.startElement !== undefined ) return cache.startElement; var node, sel = this.getNative(); switch ( this.getType() ) { case CKEDITOR.SELECTION_ELEMENT : return this.getSelectedElement(); case CKEDITOR.SELECTION_TEXT : var range = this.getRanges()[0]; if ( range ) { if ( !range.collapsed ) { range.optimize(); // Decrease the range content to exclude particial // selected node on the start which doesn't have // visual impact. ( #3231 ) while ( 1 ) { var startContainer = range.startContainer, startOffset = range.startOffset; // Limit the fix only to non-block elements.(#3950) if ( startOffset == ( startContainer.getChildCount ? startContainer.getChildCount() : startContainer.getLength() ) && !startContainer.isBlockBoundary() ) range.setStartAfter( startContainer ); else break; } node = range.startContainer; if ( node.type != CKEDITOR.NODE_ELEMENT ) return node.getParent(); node = node.getChild( range.startOffset ); if ( !node || node.type != CKEDITOR.NODE_ELEMENT ) node = range.startContainer; else { var child = node.getFirst(); while ( child && child.type == CKEDITOR.NODE_ELEMENT ) { node = child; child = child.getFirst(); } } } else { node = range.startContainer; if ( node.type != CKEDITOR.NODE_ELEMENT ) node = node.getParent(); } node = node.$; } } return cache.startElement = ( node ? new CKEDITOR.dom.element( node ) : null ); }, /** * Gets the current selected element. * @returns {CKEDITOR.dom.element} The selected element. Null if no * selection is available or the selection type is not * {@link CKEDITOR.SELECTION_ELEMENT}. * @example * var element = editor.getSelection().<b>getSelectedElement()</b>; * alert( element.getName() ); */ getSelectedElement : function() { var cache = this._.cache; if ( cache.selectedElement !== undefined ) return cache.selectedElement; var self = this; var node = CKEDITOR.tools.tryThese( // Is it native IE control type selection? function() { return self.getNative().createRange().item( 0 ); }, // Figure it out by checking if there's a single enclosed // node of the range. function() { var range = self.getRanges()[ 0 ], enclosed, selected; // Check first any enclosed element, e.g. <ul>[<li><a href="#">item</a></li>]</ul> for ( var i = 2; i && !( ( enclosed = range.getEnclosedNode() ) && ( enclosed.type == CKEDITOR.NODE_ELEMENT ) && styleObjectElements[ enclosed.getName() ] && ( selected = enclosed ) ); i-- ) { // Then check any deep wrapped element, e.g. [<b><i><img /></i></b>] range.shrink( CKEDITOR.SHRINK_ELEMENT ); } return selected.$; }); return cache.selectedElement = ( node ? new CKEDITOR.dom.element( node ) : null ); }, lock : function() { // Call all cacheable function. this.getRanges(); this.getStartElement(); this.getSelectedElement(); // The native selection is not available when locked. this._.cache.nativeSel = {}; this.isLocked = 1; // Save this selection inside the DOM document. this.document.setCustomData( 'cke_locked_selection', this ); }, unlock : function( restore ) { var doc = this.document, lockedSelection = doc.getCustomData( 'cke_locked_selection' ); if ( lockedSelection ) { doc.setCustomData( 'cke_locked_selection', null ); if ( restore ) { var selectedElement = lockedSelection.getSelectedElement(), ranges = !selectedElement && lockedSelection.getRanges(); this.isLocked = 0; this.reset(); doc.getBody().focus(); if ( selectedElement ) this.selectElement( selectedElement ); else this.selectRanges( ranges ); } } if ( !lockedSelection || !restore ) { this.isLocked = 0; this.reset(); } }, reset : function() { this._.cache = {}; }, /** * Make the current selection of type {@link CKEDITOR.SELECTION_ELEMENT} by enclosing the specified element. * @param element */ selectElement : function( element ) { if ( this.isLocked ) { var range = new CKEDITOR.dom.range( this.document ); range.setStartBefore( element ); range.setEndAfter( element ); this._.cache.selectedElement = element; this._.cache.startElement = element; this._.cache.ranges = new CKEDITOR.dom.rangeList( range ); this._.cache.type = CKEDITOR.SELECTION_ELEMENT; return; } if ( CKEDITOR.env.ie ) { this.getNative().empty(); try { // Try to select the node as a control. range = this.document.$.body.createControlRange(); range.addElement( element.$ ); range.select(); } catch( e ) { // If failed, select it as a text range. range = this.document.$.body.createTextRange(); range.moveToElementText( element.$ ); range.select(); } finally { this.document.fire( 'selectionchange' ); } this.reset(); } else { // Create the range for the element. range = this.document.$.createRange(); range.selectNode( element.$ ); // Select the range. var sel = this.getNative(); sel.removeAllRanges(); sel.addRange( range ); this.reset(); } }, /** * Adding the specified ranges to document selection preceding * by clearing up the original selection. * @param {CKEDITOR.dom.range} ranges */ selectRanges : function( ranges ) { if ( this.isLocked ) { this._.cache.selectedElement = null; this._.cache.startElement = ranges[ 0 ] && ranges[ 0 ].getTouchedStartNode(); this._.cache.ranges = new CKEDITOR.dom.rangeList( ranges ); this._.cache.type = CKEDITOR.SELECTION_TEXT; return; } if ( CKEDITOR.env.ie ) { if ( ranges.length > 1 ) { // IE doesn't accept multiple ranges selection, so we join all into one. var last = ranges[ ranges.length -1 ] ; ranges[ 0 ].setEnd( last.endContainer, last.endOffset ); ranges.length = 1; } if ( ranges[ 0 ] ) ranges[ 0 ].select(); this.reset(); } else { var sel = this.getNative(); if ( ranges.length ) sel.removeAllRanges(); for ( var i = 0 ; i < ranges.length ; i++ ) { // Joining sequential ranges introduced by // readonly elements protection. if ( i < ranges.length -1 ) { var left = ranges[ i ], right = ranges[ i +1 ], between = left.clone(); between.setStart( left.endContainer, left.endOffset ); between.setEnd( right.startContainer, right.startOffset ); // Don't confused by Firefox adjancent multi-ranges // introduced by table cells selection. if ( !between.collapsed ) { between.shrink( CKEDITOR.NODE_ELEMENT, true ); var ancestor = between.getCommonAncestor(), enclosed = between.getEnclosedNode(); // The following cases has to be considered: // 1. <span contenteditable="false">[placeholder]</span> // 2. <input contenteditable="false" type="radio"/> (#6621) if ( ancestor.isReadOnly() || enclosed && enclosed.isReadOnly() ) { right.setStart( left.startContainer, left.startOffset ); ranges.splice( i--, 1 ); continue; } } } var range = ranges[ i ]; var nativeRange = this.document.$.createRange(); var startContainer = range.startContainer; // In FF2, if we have a collapsed range, inside an empty // element, we must add something to it otherwise the caret // will not be visible. // In Opera instead, the selection will be moved out of the // element. (#4657) if ( range.collapsed && ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ) && startContainer.type == CKEDITOR.NODE_ELEMENT && !startContainer.getChildCount() ) { startContainer.appendText( '' ); } nativeRange.setStart( startContainer.$, range.startOffset ); nativeRange.setEnd( range.endContainer.$, range.endOffset ); // Select the range. sel.addRange( nativeRange ); } this.reset(); } }, /** * Create bookmark for every single of this selection range (from #getRanges) * by calling the {@link CKEDITOR.dom.range.prototype.createBookmark} method, * with extra cares to avoid interferon among those ranges. Same arguments are * received as with the underlay range method. */ createBookmarks : function( serializable ) { return this.getRanges().createBookmarks( serializable ); }, /** * Create bookmark for every single of this selection range (from #getRanges) * by calling the {@link CKEDITOR.dom.range.prototype.createBookmark2} method, * with extra cares to avoid interferon among those ranges. Same arguments are * received as with the underlay range method. */ createBookmarks2 : function( normalized ) { return this.getRanges().createBookmarks2( normalized ); }, /** * Select the virtual ranges denote by the bookmarks by calling #selectRanges. * @param bookmarks */ selectBookmarks : function( bookmarks ) { var ranges = []; for ( var i = 0 ; i < bookmarks.length ; i++ ) { var range = new CKEDITOR.dom.range( this.document ); range.moveToBookmark( bookmarks[i] ); ranges.push( range ); } this.selectRanges( ranges ); return this; }, /** * Retrieve the common ancestor node of the first range and the last range. */ getCommonAncestor : function() { var ranges = this.getRanges(), startNode = ranges[ 0 ].startContainer, endNode = ranges[ ranges.length - 1 ].endContainer; return startNode.getCommonAncestor( endNode ); }, /** * Moving scroll bar to the current selection's start position. */ scrollIntoView : function() { // If we have split the block, adds a temporary span at the // range position and scroll relatively to it. var start = this.getStartElement(); start.scrollIntoView(); } }; })(); ( function() { var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), fillerTextRegex = /\ufeff|\u00a0/, nonCells = { table:1,tbody:1,tr:1 }; CKEDITOR.dom.range.prototype.select = CKEDITOR.env.ie ? // V2 function( forceExpand ) { var collapsed = this.collapsed; var isStartMarkerAlone; var dummySpan; // IE doesn't support selecting the entire table row/cell, move the selection into cells, e.g. // <table><tbody><tr>[<td>cell</b></td>... => <table><tbody><tr><td>[cell</td>... if ( this.startContainer.type == CKEDITOR.NODE_ELEMENT && this.startContainer.getName() in nonCells || this.endContainer.type == CKEDITOR.NODE_ELEMENT && this.endContainer.getName() in nonCells ) { this.shrink( CKEDITOR.NODE_ELEMENT, true ); } var bookmark = this.createBookmark(); // Create marker tags for the start and end boundaries. var startNode = bookmark.startNode; var endNode; if ( !collapsed ) endNode = bookmark.endNode; // Create the main range which will be used for the selection. var ieRange = this.document.$.body.createTextRange(); // Position the range at the start boundary. ieRange.moveToElementText( startNode.$ ); ieRange.moveStart( 'character', 1 ); if ( endNode ) { // Create a tool range for the end. var ieRangeEnd = this.document.$.body.createTextRange(); // Position the tool range at the end. ieRangeEnd.moveToElementText( endNode.$ ); // Move the end boundary of the main range to match the tool range. ieRange.setEndPoint( 'EndToEnd', ieRangeEnd ); ieRange.moveEnd( 'character', -1 ); } else { // The isStartMarkerAlone logic comes from V2. It guarantees that the lines // will expand and that the cursor will be blinking on the right place. // Actually, we are using this flag just to avoid using this hack in all // situations, but just on those needed. var next = startNode.getNext( notWhitespaces ); isStartMarkerAlone = ( !( next && next.getText && next.getText().match( fillerTextRegex ) ) // already a filler there? && ( forceExpand || !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ) ) ); // Append a temporary <span>&#65279;</span> before the selection. // This is needed to avoid IE destroying selections inside empty // inline elements, like <b></b> (#253). // It is also needed when placing the selection right after an inline // element to avoid the selection moving inside of it. dummySpan = this.document.createElement( 'span' ); dummySpan.setHtml( '&#65279;' ); // Zero Width No-Break Space (U+FEFF). See #1359. dummySpan.insertBefore( startNode ); if ( isStartMarkerAlone ) { // To expand empty blocks or line spaces after <br>, we need // instead to have any char, which will be later deleted using the // selection. // \ufeff = Zero Width No-Break Space (U+FEFF). (#1359) this.document.createText( '\ufeff' ).insertBefore( startNode ); } } // Remove the markers (reset the position, because of the changes in the DOM tree). this.setStartBefore( startNode ); startNode.remove(); if ( collapsed ) { if ( isStartMarkerAlone ) { // Move the selection start to include the temporary \ufeff. ieRange.moveStart( 'character', -1 ); ieRange.select(); // Remove our temporary stuff. this.document.$.selection.clear(); } else ieRange.select(); this.moveToPosition( dummySpan, CKEDITOR.POSITION_BEFORE_START ); dummySpan.remove(); } else { this.setEndBefore( endNode ); endNode.remove(); ieRange.select(); } this.document.fire( 'selectionchange' ); } : function() { var startContainer = this.startContainer; // If we have a collapsed range, inside an empty element, we must add // something to it, otherwise the caret will not be visible. if ( this.collapsed && startContainer.type == CKEDITOR.NODE_ELEMENT && !startContainer.getChildCount() ) startContainer.append( new CKEDITOR.dom.text( '' ) ); var nativeRange = this.document.$.createRange(); nativeRange.setStart( startContainer.$, this.startOffset ); try { nativeRange.setEnd( this.endContainer.$, this.endOffset ); } catch ( e ) { // There is a bug in Firefox implementation (it would be too easy // otherwise). The new start can't be after the end (W3C says it can). // So, let's create a new range and collapse it to the desired point. if ( e.toString().indexOf( 'NS_ERROR_ILLEGAL_VALUE' ) >= 0 ) { this.collapse( true ); nativeRange.setEnd( this.endContainer.$, this.endOffset ); } else throw( e ); } var selection = this.document.getSelection().getNative(); // getSelection() returns null in case when iframe is "display:none" in FF. (#6577) if ( selection ) { selection.removeAllRanges(); selection.addRange( nativeRange ); } }; } )();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/selection/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Undo/Redo system for saving shapshot for document modification * and other recordable changes. */ (function() { CKEDITOR.plugins.add( 'undo', { requires : [ 'selection', 'wysiwygarea' ], init : function( editor ) { var undoManager = new UndoManager( editor ); var undoCommand = editor.addCommand( 'undo', { exec : function() { if ( undoManager.undo() ) { editor.selectionChange(); this.fire( 'afterUndo' ); } }, state : CKEDITOR.TRISTATE_DISABLED, canUndo : false }); var redoCommand = editor.addCommand( 'redo', { exec : function() { if ( undoManager.redo() ) { editor.selectionChange(); this.fire( 'afterRedo' ); } }, state : CKEDITOR.TRISTATE_DISABLED, canUndo : false }); undoManager.onChange = function() { undoCommand.setState( undoManager.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); redoCommand.setState( undoManager.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); }; function recordCommand( event ) { // If the command hasn't been marked to not support undo. if ( undoManager.enabled && event.data.command.canUndo !== false ) undoManager.save(); } // We'll save snapshots before and after executing a command. editor.on( 'beforeCommandExec', recordCommand ); editor.on( 'afterCommandExec', recordCommand ); // Save snapshots before doing custom changes. editor.on( 'saveSnapshot', function() { undoManager.save(); }); // Registering keydown on every document recreation.(#3844) editor.on( 'contentDom', function() { editor.document.on( 'keydown', function( event ) { // Do not capture CTRL hotkeys. if ( !event.data.$.ctrlKey && !event.data.$.metaKey ) undoManager.type( event ); }); }); // Always save an undo snapshot - the previous mode might have // changed editor contents. editor.on( 'beforeModeUnload', function() { editor.mode == 'wysiwyg' && undoManager.save( true ); }); // Make the undo manager available only in wysiwyg mode. editor.on( 'mode', function() { undoManager.enabled = editor.mode == 'wysiwyg'; undoManager.onChange(); }); editor.ui.addButton( 'Undo', { label : editor.lang.undo, command : 'undo' }); editor.ui.addButton( 'Redo', { label : editor.lang.redo, command : 'redo' }); editor.resetUndo = function() { // Reset the undo stack. undoManager.reset(); // Create the first image. editor.fire( 'saveSnapshot' ); }; /** * Update the undo stacks with any subsequent DOM changes after this call. * @name CKEDITOR.editor#updateUndo * @example * function() * { * editor.fire( 'updateSnapshot' ); * ... * // Ask to include subsequent (in this call stack) DOM changes to be * // considered as part of the first snapshot. * editor.fire( 'updateSnapshot' ); * editor.document.body.append(...); * ... * } */ editor.on( 'updateSnapshot', function() { if ( undoManager.currentImage && new Image( editor ).equals( undoManager.currentImage ) ) setTimeout( function() { undoManager.update(); }, 0 ); }); } }); CKEDITOR.plugins.undo = {}; /** * Undo snapshot which represents the current document status. * @name CKEDITOR.plugins.undo.Image * @param editor The editor instance on which the image is created. */ var Image = CKEDITOR.plugins.undo.Image = function( editor ) { this.editor = editor; var contents = editor.getSnapshot(), selection = contents && editor.getSelection(); // In IE, we need to remove the expando attributes. CKEDITOR.env.ie && contents && ( contents = contents.replace( /\s+data-cke-expando=".*?"/g, '' ) ); this.contents = contents; this.bookmarks = selection && selection.createBookmarks2( true ); }; // Attributes that browser may changing them when setting via innerHTML. var protectedAttrs = /\b(?:href|src|name)="[^"]*?"/gi; Image.prototype = { equals : function( otherImage, contentOnly ) { var thisContents = this.contents, otherContents = otherImage.contents; // For IE6/7 : Comparing only the protected attribute values but not the original ones.(#4522) if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) { thisContents = thisContents.replace( protectedAttrs, '' ); otherContents = otherContents.replace( protectedAttrs, '' ); } if ( thisContents != otherContents ) return false; if ( contentOnly ) return true; var bookmarksA = this.bookmarks, bookmarksB = otherImage.bookmarks; if ( bookmarksA || bookmarksB ) { if ( !bookmarksA || !bookmarksB || bookmarksA.length != bookmarksB.length ) return false; for ( var i = 0 ; i < bookmarksA.length ; i++ ) { var bookmarkA = bookmarksA[ i ], bookmarkB = bookmarksB[ i ]; if ( bookmarkA.startOffset != bookmarkB.startOffset || bookmarkA.endOffset != bookmarkB.endOffset || !CKEDITOR.tools.arrayCompare( bookmarkA.start, bookmarkB.start ) || !CKEDITOR.tools.arrayCompare( bookmarkA.end, bookmarkB.end ) ) { return false; } } } return true; } }; /** * @constructor Main logic for Redo/Undo feature. */ function UndoManager( editor ) { this.editor = editor; // Reset the undo stack. this.reset(); } var editingKeyCodes = { /*Backspace*/ 8:1, /*Delete*/ 46:1 }, modifierKeyCodes = { /*Shift*/ 16:1, /*Ctrl*/ 17:1, /*Alt*/ 18:1 }, navigationKeyCodes = { 37:1, 38:1, 39:1, 40:1 }; // Arrows: L, T, R, B UndoManager.prototype = { /** * Process undo system regard keystrikes. * @param {CKEDITOR.dom.event} event */ type : function( event ) { var keystroke = event && event.data.getKey(), isModifierKey = keystroke in modifierKeyCodes, isEditingKey = keystroke in editingKeyCodes, wasEditingKey = this.lastKeystroke in editingKeyCodes, sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke, // Keystrokes which navigation through contents. isReset = keystroke in navigationKeyCodes, wasReset = this.lastKeystroke in navigationKeyCodes, // Keystrokes which just introduce new contents. isContent = ( !isEditingKey && !isReset ), // Create undo snap for every different modifier key. modifierSnapshot = ( isEditingKey && !sameAsLastEditingKey ), // Create undo snap on the following cases: // 1. Just start to type . // 2. Typing some content after a modifier. // 3. Typing some content after make a visible selection. startedTyping = !( isModifierKey || this.typing ) || ( isContent && ( wasEditingKey || wasReset ) ); if ( startedTyping || modifierSnapshot ) { var beforeTypeImage = new Image( this.editor ); // Use setTimeout, so we give the necessary time to the // browser to insert the character into the DOM. CKEDITOR.tools.setTimeout( function() { var currentSnapshot = this.editor.getSnapshot(); // In IE, we need to remove the expando attributes. if ( CKEDITOR.env.ie ) currentSnapshot = currentSnapshot.replace( /\s+data-cke-expando=".*?"/g, '' ); if ( beforeTypeImage.contents != currentSnapshot ) { // It's safe to now indicate typing state. this.typing = true; // This's a special save, with specified snapshot // and without auto 'fireChange'. if ( !this.save( false, beforeTypeImage, false ) ) // Drop future snapshots. this.snapshots.splice( this.index + 1, this.snapshots.length - this.index - 1 ); this.hasUndo = true; this.hasRedo = false; this.typesCount = 1; this.modifiersCount = 1; this.onChange(); } }, 0, this ); } this.lastKeystroke = keystroke; // Create undo snap after typed too much (over 25 times). if ( isEditingKey ) { this.typesCount = 0; this.modifiersCount++; if ( this.modifiersCount > 25 ) { this.save( false, null, false ); this.modifiersCount = 1; } } else if ( !isReset ) { this.modifiersCount = 0; this.typesCount++; if ( this.typesCount > 25 ) { this.save( false, null, false ); this.typesCount = 1; } } }, reset : function() // Reset the undo stack. { /** * Remember last pressed key. */ this.lastKeystroke = 0; /** * Stack for all the undo and redo snapshots, they're always created/removed * in consistency. */ this.snapshots = []; /** * Current snapshot history index. */ this.index = -1; this.limit = this.editor.config.undoStackSize || 20; this.currentImage = null; this.hasUndo = false; this.hasRedo = false; this.resetType(); }, /** * Reset all states about typing. * @see UndoManager.type */ resetType : function() { this.typing = false; delete this.lastKeystroke; this.typesCount = 0; this.modifiersCount = 0; }, fireChange : function() { this.hasUndo = !!this.getNextImage( true ); this.hasRedo = !!this.getNextImage( false ); // Reset typing this.resetType(); this.onChange(); }, /** * Save a snapshot of document image for later retrieve. */ save : function( onContentOnly, image, autoFireChange ) { var snapshots = this.snapshots; // Get a content image. if ( !image ) image = new Image( this.editor ); // Do nothing if it was not possible to retrieve an image. if ( image.contents === false ) return false; // Check if this is a duplicate. In such case, do nothing. if ( this.currentImage && image.equals( this.currentImage, onContentOnly ) ) return false; // Drop future snapshots. snapshots.splice( this.index + 1, snapshots.length - this.index - 1 ); // If we have reached the limit, remove the oldest one. if ( snapshots.length == this.limit ) snapshots.shift(); // Add the new image, updating the current index. this.index = snapshots.push( image ) - 1; this.currentImage = image; if ( autoFireChange !== false ) this.fireChange(); return true; }, restoreImage : function( image ) { this.editor.loadSnapshot( image.contents ); if ( image.bookmarks ) this.editor.getSelection().selectBookmarks( image.bookmarks ); else if ( CKEDITOR.env.ie ) { // IE BUG: If I don't set the selection to *somewhere* after setting // document contents, then IE would create an empty paragraph at the bottom // the next time the document is modified. var $range = this.editor.document.getBody().$.createTextRange(); $range.collapse( true ); $range.select(); } this.index = image.index; // Update current image with the actual editor // content, since actualy content may differ from // the original snapshot due to dom change. (#4622) this.update(); this.fireChange(); }, // Get the closest available image. getNextImage : function( isUndo ) { var snapshots = this.snapshots, currentImage = this.currentImage, image, i; if ( currentImage ) { if ( isUndo ) { for ( i = this.index - 1 ; i >= 0 ; i-- ) { image = snapshots[ i ]; if ( !currentImage.equals( image, true ) ) { image.index = i; return image; } } } else { for ( i = this.index + 1 ; i < snapshots.length ; i++ ) { image = snapshots[ i ]; if ( !currentImage.equals( image, true ) ) { image.index = i; return image; } } } } return null; }, /** * Check the current redo state. * @return {Boolean} Whether the document has previous state to * retrieve. */ redoable : function() { return this.enabled && this.hasRedo; }, /** * Check the current undo state. * @return {Boolean} Whether the document has future state to restore. */ undoable : function() { return this.enabled && this.hasUndo; }, /** * Perform undo on current index. */ undo : function() { if ( this.undoable() ) { this.save( true ); var image = this.getNextImage( true ); if ( image ) return this.restoreImage( image ), true; } return false; }, /** * Perform redo on current index. */ redo : function() { if ( this.redoable() ) { // Try to save. If no changes have been made, the redo stack // will not change, so it will still be redoable. this.save( true ); // If instead we had changes, we can't redo anymore. if ( this.redoable() ) { var image = this.getNextImage( false ); if ( image ) return this.restoreImage( image ), true; } } return false; }, /** * Update the last snapshot of the undo stack with the current editor content. */ update : function() { this.snapshots.splice( this.index, 1, ( this.currentImage = new Image( this.editor ) ) ); } }; })(); /** * The number of undo steps to be saved. The higher this setting value the more * memory is used for it. * @type Number * @default 20 * @example * config.undoStackSize = 50; */ /** * Fired when the editor is about to save an undo snapshot. This event can be * fired by plugins and customizations to make the editor saving undo snapshots. * @name CKEDITOR.editor#saveSnapshot * @event */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/undo/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @file Special Character plugin */ CKEDITOR.plugins.add( 'specialchar', { // List of available localizations. availableLangs : { en:1 }, init : function( editor ) { var pluginName = 'specialchar', plugin = this; // Register the dialog. CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' ); editor.addCommand( pluginName, { exec : function() { var langCode = editor.langCode; langCode = plugin.availableLangs[ langCode ] ? langCode : 'en'; CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ), function() { CKEDITOR.tools.extend( editor.lang.specialChar, plugin.lang[ langCode ] ); editor.openDialog( pluginName ); }); }, modes : { wysiwyg:1 }, canUndo : false }); // Register the toolbar button. editor.ui.addButton( 'SpecialChar', { label : editor.lang.specialChar.toolbar, command : pluginName }); } } ); /** * The list of special characters visible in Special Character dialog. * @type Array * @example * config.specialChars = [ '&quot;', '&rsquo;', [ '&custom;', 'Custom label' ] ]; * config.specialChars = config.specialChars.concat( [ '&quot;', [ '&rsquo;', 'Custom label' ] ] ); */ CKEDITOR.config.specialChars = [ '!','&quot;','#','$','%','&amp;',"'",'(',')','*','+','-','.','/', '0','1','2','3','4','5','6','7','8','9',':',';', '&lt;','=','&gt;','?','@', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O', 'P','Q','R','S','T','U','V','W','X','Y','Z', '[',']','^','_','`', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', 'q','r','s','t','u','v','w','x','y','z', '{','|','}','~', "&euro;", "&lsquo;", "&rsquo;", "&ldquo;", "&rdquo;", "&ndash;", "&mdash;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&reg;", "&macr;", "&deg;", "&", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&OElig;", "&oelig;", "&#372;", "&#374", "&#373", "&#375;", "&sbquo;", "&#8219;", "&bdquo;", "&hellip;", "&trade;", "&#9658;", "&bull;", "&rarr;", "&rArr;", "&hArr;", "&diams;", "&asymp;" ];
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/specialchar/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'specialchar', function( editor ) { /** * Simulate "this" of a dialog for non-dialog events. * @type {CKEDITOR.dialog} */ var dialog, lang = editor.lang.specialChar; var onChoice = function( evt ) { var target, value; if ( evt.data ) target = evt.data.getTarget(); else target = new CKEDITOR.dom.element( evt ); if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) ) { target.removeClass( "cke_light_background" ); dialog.hide(); editor.insertHtml( value ); } }; var onClick = CKEDITOR.tools.addFunction( onChoice ); var focusedNode; var onFocus = function( evt, target ) { var value; target = target || evt.data.getTarget(); if ( target.getName() == 'span' ) target = target.getParent(); if ( target.getName() == 'a' && ( value = target.getChild( 0 ).getHtml() ) ) { // Trigger blur manually if there is focused node. if ( focusedNode ) onBlur( null, focusedNode ); var htmlPreview = dialog.getContentElement( 'info', 'htmlPreview' ).getElement(); dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( value ); htmlPreview.setHtml( CKEDITOR.tools.htmlEncode( value ) ); target.getParent().addClass( "cke_light_background" ); // Memorize focused node. focusedNode = target; } }; var onBlur = function( evt, target ) { target = target || evt.data.getTarget(); if ( target.getName() == 'span' ) target = target.getParent(); if ( target.getName() == 'a' ) { dialog.getContentElement( 'info', 'charPreview' ).getElement().setHtml( '&nbsp;' ); dialog.getContentElement( 'info', 'htmlPreview' ).getElement().setHtml( '&nbsp;' ); target.getParent().removeClass( "cke_light_background" ); focusedNode = undefined; } }; var onKeydown = CKEDITOR.tools.addFunction( function( ev ) { ev = new CKEDITOR.dom.event( ev ); // Get an Anchor element. var element = ev.getTarget(); var relative, nodeToMove; var keystroke = ev.getKeystroke(), rtl = editor.lang.dir == 'rtl'; switch ( keystroke ) { // UP-ARROW case 38 : // relative is TR if ( ( relative = element.getParent().getParent().getPrevious() ) ) { nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] ); nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); } ev.preventDefault(); break; // DOWN-ARROW case 40 : // relative is TR if ( ( relative = element.getParent().getParent().getNext() ) ) { nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] ); if ( nodeToMove && nodeToMove.type == 1 ) { nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); } } ev.preventDefault(); break; // SPACE // ENTER is already handled as onClick case 32 : onChoice( { data: ev } ); ev.preventDefault(); break; // RIGHT-ARROW case rtl ? 37 : 39 : // TAB case 9 : // relative is TD if ( ( relative = element.getParent().getNext() ) ) { nodeToMove = relative.getChild( 0 ); if ( nodeToMove.type == 1 ) { nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); ev.preventDefault( true ); } else onBlur( null, element ); } // relative is TR else if ( ( relative = element.getParent().getParent().getNext() ) ) { nodeToMove = relative.getChild( [ 0, 0 ] ); if ( nodeToMove && nodeToMove.type == 1 ) { nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); ev.preventDefault( true ); } else onBlur( null, element ); } break; // LEFT-ARROW case rtl ? 39 : 37 : // SHIFT + TAB case CKEDITOR.SHIFT + 9 : // relative is TD if ( ( relative = element.getParent().getPrevious() ) ) { nodeToMove = relative.getChild( 0 ); nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); ev.preventDefault( true ); } // relative is TR else if ( ( relative = element.getParent().getParent().getPrevious() ) ) { nodeToMove = relative.getLast().getChild( 0 ); nodeToMove.focus(); onBlur( null, element ); onFocus( null, nodeToMove ); ev.preventDefault( true ); } else onBlur( null, element ); break; default : // Do not stop not handled events. return; } }); return { title : lang.title, minWidth : 430, minHeight : 280, buttons : [ CKEDITOR.dialog.cancelButton ], charColumns : 17, onLoad : function() { var columns = this.definition.charColumns, extraChars = editor.config.extraSpecialChars, chars = editor.config.specialChars; var charsTableLabel = CKEDITOR.tools.getNextId() + '_specialchar_table_label'; var html = [ '<table role="listbox" aria-labelledby="' + charsTableLabel + '"' + ' style="width: 320px; height: 100%; border-collapse: separate;"' + ' align="center" cellspacing="2" cellpadding="2" border="0">' ]; var i = 0, size = chars.length, character, charDesc; while ( i < size ) { html.push( '<tr>' ) ; for ( var j = 0 ; j < columns ; j++, i++ ) { if ( ( character = chars[ i ] ) ) { charDesc = ''; if ( character instanceof Array ) { charDesc = character[ 1 ]; character = character[ 0 ]; } else { var _tmpName = character.toLowerCase().replace( '&', '' ).replace( ';', '' ).replace( '#', '' ); // Use character in case description unavailable. charDesc = lang[ _tmpName ] || character; } var charLabelId = 'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber(); html.push( '<td class="cke_dark_background" style="cursor: default" role="presentation">' + '<a href="javascript: void(0);" role="option"' + ' aria-posinset="' + ( i +1 ) + '"', ' aria-setsize="' + size + '"', ' aria-labelledby="' + charLabelId + '"', ' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="', CKEDITOR.tools.htmlEncode( charDesc ), '"' + ' onkeydown="CKEDITOR.tools.callFunction( ' + onKeydown + ', event, this )"' + ' onclick="CKEDITOR.tools.callFunction(' + onClick + ', this); return false;"' + ' tabindex="-1">' + '<span style="margin: 0 auto;cursor: inherit">' + character + '</span>' + '<span class="cke_voice_label" id="' + charLabelId + '">' + charDesc + '</span></a>'); } else html.push( '<td class="cke_dark_background">&nbsp;' ); html.push( '</td>' ); } html.push( '</tr>' ); } html.push( '</tbody></table>', '<span id="' + charsTableLabel + '" class="cke_voice_label">' + lang.options +'</span>' ); this.getContentElement( 'info', 'charContainer' ).getElement().setHtml( html.join( '' ) ); }, contents : [ { id : 'info', label : editor.lang.common.generalTab, title : editor.lang.common.generalTab, padding : 0, align : 'top', elements : [ { type : 'hbox', align : 'top', widths : [ '320px', '90px' ], children : [ { type : 'html', id : 'charContainer', html : '', onMouseover : onFocus, onMouseout : onBlur, focus : function() { var firstChar = this.getElement().getElementsByTag( 'a' ).getItem( 0 ); setTimeout( function() { firstChar.focus(); onFocus( null, firstChar ); }, 0 ); }, onShow : function() { var firstChar = this.getElement().getChild( [ 0, 0, 0, 0, 0 ] ); setTimeout( function() { firstChar.focus(); onFocus( null, firstChar ); }, 0 ); }, onLoad : function( event ) { dialog = event.sender; } }, { type : 'hbox', align : 'top', widths : [ '100%' ], children : [ { type : 'vbox', align : 'top', children : [ { type : 'html', html : '<div></div>' }, { type : 'html', id : 'charPreview', className : 'cke_dark_background', style : 'border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;', html : '<div>&nbsp;</div>' }, { type : 'html', id : 'htmlPreview', className : 'cke_dark_background', style : 'border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;text-align:center;', html : '<div>&nbsp;</div>' } ] } ] } ] } ] } ] }; } );
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/specialchar/dialogs/specialchar.js
specialchar.js
 CKEDITOR.plugins.setLang( 'specialchar', 'en', { euro: "EURO SIGN", lsquo: "LEFT SINGLE QUOTATION MARK", rsquo: "RIGHT SINGLE QUOTATION MARK", ldquo: "LEFT DOUBLE QUOTATION MARK", rdquo: "RIGHT DOUBLE QUOTATION MARK", ndash: "EN DASH", mdash: "EM DASH", iexcl: "INVERTED EXCLAMATION MARK", cent: "CENT SIGN", pound: "POUND SIGN", curren: "CURRENCY SIGN", yen: "YEN SIGN", brvbar: "BROKEN BAR", sect: "SECTION SIGN", uml: "DIAERESIS", copy: "COPYRIGHT SIGN", ordf: "FEMININE ORDINAL INDICATOR", laquo: "LEFT-POINTING DOUBLE ANGLE QUOTATION MARK", not: "NOT SIGN", reg: "REGISTERED SIGN", macr: "MACRON", deg: "DEGREE SIGN", sup2: "SUPERSCRIPT TWO", sup3: "SUPERSCRIPT THREE", acute: "ACUTE ACCENT", micro: "MICRO SIGN", para: "PILCROW SIGN", middot: "MIDDLE DOT", cedil: "CEDILLA", sup1: "SUPERSCRIPT ONE", ordm: "MASCULINE ORDINAL INDICATOR", frac14: "VULGAR FRACTION ONE QUARTER", frac12: "VULGAR FRACTION ONE HALF", frac34: "VULGAR FRACTION THREE QUARTERS", iquest: "INVERTED QUESTION MARK", agrave: "LATIN SMALL LETTER A WITH GRAVE", aacute: "LATIN SMALL LETTER A WITH ACUTE", acirc: "LATIN SMALL LETTER A WITH CIRCUMFLEX", atilde: "LATIN SMALL LETTER A WITH TILDE", auml: "LATIN SMALL LETTER A WITH DIAERESIS", aring: "LATIN SMALL LETTER A WITH RING ABOVE", aelig: "LATIN SMALL LETTER AE", ccedil: "LATIN SMALL LETTER C WITH CEDILLA", egrave: "LATIN SMALL LETTER E WITH GRAVE", eacute: "LATIN SMALL LETTER E WITH ACUTE", ecirc: "LATIN SMALL LETTER E WITH CIRCUMFLEX", euml: "LATIN SMALL LETTER E WITH DIAERESIS", igrave: "LATIN SMALL LETTER I WITH GRAVE", iacute: "LATIN SMALL LETTER I WITH ACUTE", icirc: "LATIN SMALL LETTER I WITH CIRCUMFLEX", iuml: "LATIN SMALL LETTER I WITH DIAERESIS", eth: "LATIN SMALL LETTER ETH", ntilde: "LATIN SMALL LETTER N WITH TILDE", ograve: "LATIN SMALL LETTER O WITH GRAVE", oacute: "LATIN SMALL LETTER O WITH ACUTE", ocirc: "LATIN SMALL LETTER O WITH CIRCUMFLEX", otilde: "LATIN SMALL LETTER O WITH TILDE", ouml: "LATIN SMALL LETTER O WITH DIAERESIS", times: "MULTIPLICATION SIGN", oslash: "LATIN SMALL LETTER O WITH STROKE", ugrave: "LATIN SMALL LETTER U WITH GRAVE", uacute: "LATIN SMALL LETTER U WITH ACUTE", ucirc: "LATIN SMALL LETTER U WITH CIRCUMFLEX", uuml: "LATIN SMALL LETTER U WITH DIAERESIS", yacute: "LATIN SMALL LETTER Y WITH ACUTE", thorn: "LATIN SMALL LETTER THORN", szlig: "LATIN SMALL LETTER SHARP S", divide: "DIVISION SIGN", yuml: "LATIN SMALL LETTER Y WITH DIAERESIS", oelig: "LATIN SMALL LIGATURE OE", '372': "LATIN CAPITAL LETTER W WITH CIRCUMFLEX", '374': "LATIN CAPITAL LETTER Y WITH CIRCUMFLEX", '373': "LATIN SMALL LETTER W WITH CIRCUMFLEX", '375': "LATIN SMALL LETTER Y WITH CIRCUMFLEX", 8219: "SINGLE HIGH-REVERSED-9 QUOTATION MARK", bdquo: "DOUBLE LOW-9 QUOTATION MARK", hellip: "HORIZONTAL ELLIPSIS", trade: "TRADE MARK SIGN", '9658': "BLACK RIGHT-POINTING POINTER", bull: "BULLET", rarr: "RIGHTWARDS DOUBLE ARROW", harr: "LEFT RIGHT DOUBLE ARROW", diams: "BLACK DIAMOND SUIT", asymp: "ALMOST EQUAL TO", sbquo: 'SINGLE LOW-9 QUOTATION MARK' });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/specialchar/lang/en.js
en.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { var imageDialog = function( editor, dialogType ) { // Load image preview. var IMAGE = 1, LINK = 2, PREVIEW = 4, CLEANUP = 8, regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i, regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i, pxLengthRegex = /^\d+px$/; var onSizeChange = function() { var value = this.getValue(), // This = input element. dialog = this.getDialog(), aMatch = value.match( regexGetSize ); // Check value if ( aMatch ) { if ( aMatch[2] == '%' ) // % is allowed - > unlock ratio. switchLockRatio( dialog, false ); // Unlock. value = aMatch[1]; } // Only if ratio is locked if ( dialog.lockRatio ) { var oImageOriginal = dialog.originalElement; if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { if ( this.id == 'txtHeight' ) { if ( value && value != '0' ) value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) ); if ( !isNaN( value ) ) dialog.setValueOf( 'info', 'txtWidth', value ); } else //this.id = txtWidth. { if ( value && value != '0' ) value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) ); if ( !isNaN( value ) ) dialog.setValueOf( 'info', 'txtHeight', value ); } } } updatePreview( dialog ); }; var updatePreview = function( dialog ) { //Don't load before onShow. if ( !dialog.originalElement || !dialog.preview ) return 1; // Read attributes and update imagePreview; dialog.commitContent( PREVIEW, dialog.preview ); return 0; }; // Custom commit dialog logic, where we're intended to give inline style // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute // by other fields. function commitContent() { var args = arguments; var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' ); inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args ); this.foreach( function( widget ) { if ( widget.commit && widget.id != 'txtdlgGenStyle' ) widget.commit.apply( widget, args ); }); } // Avoid recursions. var incommit; // Synchronous field values to other impacted fields is required, e.g. border // size change should alter inline-style text as well. function commitInternally( targetFields ) { if ( incommit ) return; incommit = 1; var dialog = this.getDialog(), element = dialog.imageElement; if ( element ) { // Commit this field and broadcast to target fields. this.commit( IMAGE, element ); targetFields = [].concat( targetFields ); var length = targetFields.length, field; for ( var i = 0; i < length; i++ ) { field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) ); // May cause recursion. field && field.setup( IMAGE, element ); } } incommit = 0; } var switchLockRatio = function( dialog, value ) { var oImageOriginal = dialog.originalElement; // Dialog may already closed. (#5505) if( !oImageOriginal ) return null; var ratioButton = CKEDITOR.document.getById( btnLockSizesId ); if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { if ( value == 'check' ) // Check image ratio and original image ratio. { var width = dialog.getValueOf( 'info', 'txtWidth' ), height = dialog.getValueOf( 'info', 'txtHeight' ), originalRatio = oImageOriginal.$.width * 1000 / oImageOriginal.$.height, thisRatio = width * 1000 / height; dialog.lockRatio = false; // Default: unlock ratio if ( !width && !height ) dialog.lockRatio = true; else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) ) { if ( Math.round( originalRatio ) == Math.round( thisRatio ) ) dialog.lockRatio = true; } } else if ( value != undefined ) dialog.lockRatio = value; else dialog.lockRatio = !dialog.lockRatio; } else if ( value != 'check' ) // I can't lock ratio if ratio is unknown. dialog.lockRatio = false; if ( dialog.lockRatio ) ratioButton.removeClass( 'cke_btn_unlocked' ); else ratioButton.addClass( 'cke_btn_unlocked' ); var lang = dialog._.editor.lang.image, label = lang[ dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ]; ratioButton.setAttribute( 'title', label ); ratioButton.getFirst().setText( label ); return dialog.lockRatio; }; var resetSize = function( dialog ) { var oImageOriginal = dialog.originalElement; if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width ); dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height ); } updatePreview( dialog ); }; var setupDimension = function( type, element ) { if ( type != IMAGE ) return; function checkDimension( size, defaultValue ) { var aMatch = size.match( regexGetSize ); if ( aMatch ) { if ( aMatch[2] == '%' ) // % is allowed. { aMatch[1] += '%'; switchLockRatio( dialog, false ); // Unlock ratio } return aMatch[1]; } return defaultValue; } var dialog = this.getDialog(), value = '', dimension = (( this.id == 'txtWidth' )? 'width' : 'height' ), size = element.getAttribute( dimension ); if ( size ) value = checkDimension( size, value ); value = checkDimension( element.getStyle( dimension ), value ); this.setValue( value ); }; var previewPreloader; var onImgLoadEvent = function() { // Image is ready. var original = this.originalElement; original.setCustomData( 'isReady', 'true' ); original.removeListener( 'load', onImgLoadEvent ); original.removeListener( 'error', onImgLoadErrorEvent ); original.removeListener( 'abort', onImgLoadErrorEvent ); // Hide loader CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); // New image -> new domensions if ( !this.dontResetSize ) resetSize( this ); if ( this.firstLoad ) CKEDITOR.tools.setTimeout( function(){ switchLockRatio( this, 'check' ); }, 0, this ); this.firstLoad = false; this.dontResetSize = false; }; var onImgLoadErrorEvent = function() { // Error. Image is not loaded. var original = this.originalElement; original.removeListener( 'load', onImgLoadEvent ); original.removeListener( 'error', onImgLoadErrorEvent ); original.removeListener( 'abort', onImgLoadErrorEvent ); // Set Error image. var noimage = CKEDITOR.getUrl( editor.skinPath + 'images/noimage.png' ); if ( this.preview ) this.preview.setAttribute( 'src', noimage ); // Hide loader CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); switchLockRatio( this, false ); // Unlock. }; var numbering = function( id ) { return CKEDITOR.tools.getNextId() + '_' + id; }, btnLockSizesId = numbering( 'btnLockSizes' ), btnResetSizeId = numbering( 'btnResetSize' ), imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ), imagePreviewBoxId = numbering( 'ImagePreviewBox' ), previewLinkId = numbering( 'previewLink' ), previewImageId = numbering( 'previewImage' ); return { title : editor.lang.image[ dialogType == 'image' ? 'title' : 'titleButton' ], minWidth : 420, minHeight : 360, onShow : function() { this.imageElement = false; this.linkElement = false; // Default: create a new element. this.imageEditMode = false; this.linkEditMode = false; this.lockRatio = true; this.dontResetSize = false; this.firstLoad = true; this.addLink = false; var editor = this.getParentEditor(), sel = this.getParentEditor().getSelection(), element = sel.getSelectedElement(), link = element && element.getAscendant( 'a' ); //Hide loader. CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); // Create the preview before setup the dialog contents. previewPreloader = new CKEDITOR.dom.element( 'img', editor.document ); this.preview = CKEDITOR.document.getById( previewImageId ); // Copy of the image this.originalElement = editor.document.createElement( 'img' ); this.originalElement.setAttribute( 'alt', '' ); this.originalElement.setCustomData( 'isReady', 'false' ); if ( link ) { this.linkElement = link; this.linkEditMode = true; // Look for Image element. var linkChildren = link.getChildren(); if ( linkChildren.count() == 1 ) // 1 child. { var childTagName = linkChildren.getItem( 0 ).getName(); if ( childTagName == 'img' || childTagName == 'input' ) { this.imageElement = linkChildren.getItem( 0 ); if ( this.imageElement.getName() == 'img' ) this.imageEditMode = 'img'; else if ( this.imageElement.getName() == 'input' ) this.imageEditMode = 'input'; } } // Fill out all fields. if ( dialogType == 'image' ) this.setupContent( LINK, link ); } if ( element && element.getName() == 'img' && !element.data( 'cke-realelement' ) || element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' ) { this.imageEditMode = element.getName(); this.imageElement = element; } if ( this.imageEditMode ) { // Use the original element as a buffer from since we don't want // temporary changes to be committed, e.g. if the dialog is canceled. this.cleanImageElement = this.imageElement; this.imageElement = this.cleanImageElement.clone( true, true ); // Fill out all fields. this.setupContent( IMAGE, this.imageElement ); // Refresh LockRatio button switchLockRatio ( this, true ); } else this.imageElement = editor.document.createElement( 'img' ); // Dont show preview if no URL given. if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) ) { this.preview.removeAttribute( 'src' ); this.preview.setStyle( 'display', 'none' ); } }, onOk : function() { // Edit existing Image. if ( this.imageEditMode ) { var imgTagName = this.imageEditMode; // Image dialog and Input element. if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) ) { // Replace INPUT-> IMG imgTagName = 'img'; this.imageElement = editor.document.createElement( 'img' ); this.imageElement.setAttribute( 'alt', '' ); editor.insertElement( this.imageElement ); } // ImageButton dialog and Image element. else if ( dialogType != 'image' && imgTagName == 'img' && confirm( editor.lang.image.img2Button )) { // Replace IMG -> INPUT imgTagName = 'input'; this.imageElement = editor.document.createElement( 'input' ); this.imageElement.setAttributes( { type : 'image', alt : '' } ); editor.insertElement( this.imageElement ); } else { // Restore the original element before all commits. this.imageElement = this.cleanImageElement; delete this.cleanImageElement; } } else // Create a new image. { // Image dialog -> create IMG element. if ( dialogType == 'image' ) this.imageElement = editor.document.createElement( 'img' ); else { this.imageElement = editor.document.createElement( 'input' ); this.imageElement.setAttribute ( 'type' ,'image' ); } this.imageElement.setAttribute( 'alt', '' ); } // Create a new link. if ( !this.linkEditMode ) this.linkElement = editor.document.createElement( 'a' ); // Set attributes. this.commitContent( IMAGE, this.imageElement ); this.commitContent( LINK, this.linkElement ); // Remove empty style attribute. if ( !this.imageElement.getAttribute( 'style' ) ) this.imageElement.removeAttribute( 'style' ); // Insert a new Image. if ( !this.imageEditMode ) { if ( this.addLink ) { //Insert a new Link. if ( !this.linkEditMode ) { editor.insertElement(this.linkElement); this.linkElement.append(this.imageElement, false); } else //Link already exists, image not. editor.insertElement(this.imageElement ); } else editor.insertElement( this.imageElement ); } else // Image already exists. { //Add a new link element. if ( !this.linkEditMode && this.addLink ) { editor.insertElement( this.linkElement ); this.imageElement.appendTo( this.linkElement ); } //Remove Link, Image exists. else if ( this.linkEditMode && !this.addLink ) { editor.getSelection().selectElement( this.linkElement ); editor.insertElement( this.imageElement ); } } }, onLoad : function() { if ( dialogType != 'image' ) this.hidePage( 'Link' ); //Hide Link tab. var doc = this._.element.getDocument(); this.addFocusable( doc.getById( btnResetSizeId ), 5 ); this.addFocusable( doc.getById( btnLockSizesId ), 5 ); this.commitContent = commitContent; }, onHide : function() { if ( this.preview ) this.commitContent( CLEANUP, this.preview ); if ( this.originalElement ) { this.originalElement.removeListener( 'load', onImgLoadEvent ); this.originalElement.removeListener( 'error', onImgLoadErrorEvent ); this.originalElement.removeListener( 'abort', onImgLoadErrorEvent ); this.originalElement.remove(); this.originalElement = false; // Dialog is closed. } delete this.imageElement; }, contents : [ { id : 'info', label : editor.lang.image.infoTab, accessKey : 'I', elements : [ { type : 'vbox', padding : 0, children : [ { type : 'hbox', widths : [ '280px', '110px' ], align : 'right', children : [ { id : 'txtUrl', type : 'text', label : editor.lang.common.url, required: true, onChange : function() { var dialog = this.getDialog(), newUrl = this.getValue(); //Update original image if ( newUrl.length > 0 ) //Prevent from load before onShow { dialog = this.getDialog(); var original = dialog.originalElement; dialog.preview.removeStyle( 'display' ); original.setCustomData( 'isReady', 'false' ); // Show loader var loader = CKEDITOR.document.getById( imagePreviewLoaderId ); if ( loader ) loader.setStyle( 'display', '' ); original.on( 'load', onImgLoadEvent, dialog ); original.on( 'error', onImgLoadErrorEvent, dialog ); original.on( 'abort', onImgLoadErrorEvent, dialog ); original.setAttribute( 'src', newUrl ); // Query the preloader to figure out the url impacted by based href. previewPreloader.setAttribute( 'src', newUrl ); dialog.preview.setAttribute( 'src', previewPreloader.$.src ); updatePreview( dialog ); } // Dont show preview if no URL given. else if ( dialog.preview ) { dialog.preview.removeAttribute( 'src' ); dialog.preview.setStyle( 'display', 'none' ); } }, setup : function( type, element ) { if ( type == IMAGE ) { var url = element.data( 'cke-saved-src' ) || element.getAttribute( 'src' ); var field = this; this.getDialog().dontResetSize = true; field.setValue( url ); // And call this.onChange() // Manually set the initial value.(#4191) field.setInitValue(); } }, commit : function( type, element ) { if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) { element.data( 'cke-saved-src', this.getValue() ); element.setAttribute( 'src', this.getValue() ); } else if ( type == CLEANUP ) { element.setAttribute( 'src', '' ); // If removeAttribute doesn't work. element.removeAttribute( 'src' ); } }, validate : CKEDITOR.dialog.validate.notEmpty( editor.lang.image.urlMissing ) }, { type : 'button', id : 'browse', // v-align with the 'txtUrl' field. // TODO: We need something better than a fixed size here. style : 'display:inline-block;margin-top:10px;', align : 'center', label : editor.lang.common.browseServer, hidden : true, filebrowser : 'info:txtUrl' } ] } ] }, { id : 'txtAlt', type : 'text', label : editor.lang.image.alt, accessKey : 'T', 'default' : '', onChange : function() { updatePreview( this.getDialog() ); }, setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'alt' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'alt', this.getValue() ); } else if ( type == PREVIEW ) { element.setAttribute( 'alt', this.getValue() ); } else if ( type == CLEANUP ) { element.removeAttribute( 'alt' ); } } }, { type : 'hbox', children : [ { type : 'vbox', children : [ { type : 'hbox', widths : [ '50%', '50%' ], children : [ { type : 'vbox', padding : 1, children : [ { type : 'text', width: '40px', id : 'txtWidth', label : editor.lang.common.width, onKeyUp : onSizeChange, onChange : function() { commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, validate : function() { var aMatch = this.getValue().match( regexGetSizeOrEmpty ); if ( !aMatch ) alert( editor.lang.common.invalidWidth ); return !!aMatch; }, setup : setupDimension, commit : function( type, element, internalCommit ) { var value = this.getValue(); if ( type == IMAGE ) { if ( value ) element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); else if ( !value && this.isChanged( ) ) element.removeStyle( 'width' ); !internalCommit && element.removeAttribute( 'width' ); } else if ( type == PREVIEW ) { var aMatch = value.match( regexGetSize ); if ( !aMatch ) { var oImageOriginal = this.getDialog().originalElement; if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) element.setStyle( 'width', oImageOriginal.$.width + 'px'); } else element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) ); } else if ( type == CLEANUP ) { element.removeAttribute( 'width' ); element.removeStyle( 'width' ); } } }, { type : 'text', id : 'txtHeight', width: '40px', label : editor.lang.common.height, onKeyUp : onSizeChange, onChange : function() { commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, validate : function() { var aMatch = this.getValue().match( regexGetSizeOrEmpty ); if ( !aMatch ) alert( editor.lang.common.invalidHeight ); return !!aMatch; }, setup : setupDimension, commit : function( type, element, internalCommit ) { var value = this.getValue(); if ( type == IMAGE ) { if ( value ) element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); else if ( !value && this.isChanged( ) ) element.removeStyle( 'height' ); if ( !internalCommit && type == IMAGE ) element.removeAttribute( 'height' ); } else if ( type == PREVIEW ) { var aMatch = value.match( regexGetSize ); if ( !aMatch ) { var oImageOriginal = this.getDialog().originalElement; if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) element.setStyle( 'height', oImageOriginal.$.height + 'px' ); } else element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) ); } else if ( type == CLEANUP ) { element.removeAttribute( 'height' ); element.removeStyle( 'height' ); } } } ] }, { type : 'html', style : 'margin-top:30px;width:40px;height:40px;', onLoad : function() { // Activate Reset button var resetButton = CKEDITOR.document.getById( btnResetSizeId ), ratioButton = CKEDITOR.document.getById( btnLockSizesId ); if ( resetButton ) { resetButton.on( 'click', function(evt) { resetSize( this ); evt.data.preventDefault(); }, this.getDialog() ); resetButton.on( 'mouseover', function() { this.addClass( 'cke_btn_over' ); }, resetButton ); resetButton.on( 'mouseout', function() { this.removeClass( 'cke_btn_over' ); }, resetButton ); } // Activate (Un)LockRatio button if ( ratioButton ) { ratioButton.on( 'click', function(evt) { var locked = switchLockRatio( this ), oImageOriginal = this.originalElement, width = this.getValueOf( 'info', 'txtWidth' ); if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' && width ) { var height = oImageOriginal.$.height / oImageOriginal.$.width * width; if ( !isNaN( height ) ) { this.setValueOf( 'info', 'txtHeight', Math.round( height ) ); updatePreview( this ); } } evt.data.preventDefault(); }, this.getDialog() ); ratioButton.on( 'mouseover', function() { this.addClass( 'cke_btn_over' ); }, ratioButton ); ratioButton.on( 'mouseout', function() { this.removeClass( 'cke_btn_over' ); }, ratioButton ); } }, html : '<div>'+ '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.unlockRatio + '" class="cke_btn_locked" id="' + btnLockSizesId + '" role="button"><span class="cke_label">' + editor.lang.image.unlockRatio + '</span></a>' + '<a href="javascript:void(0)" tabindex="-1" title="' + editor.lang.image.resetSize + '" class="cke_btn_reset" id="' + btnResetSizeId + '" role="button"><span class="cke_label">' + editor.lang.image.resetSize + '</span></a>'+ '</div>' } ] }, { type : 'vbox', padding : 1, children : [ { type : 'text', id : 'txtBorder', width: '60px', label : editor.lang.image.border, 'default' : '', onKeyUp : function() { updatePreview( this.getDialog() ); }, onChange : function() { commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateBorder ), setup : function( type, element ) { if ( type == IMAGE ) { var value, borderStyle = element.getStyle( 'border-width' ); borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ ); value = borderStyle && parseInt( borderStyle[ 1 ], 10 ); isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'border' ) ); this.setValue( value ); } }, commit : function( type, element, internalCommit ) { var value = parseInt( this.getValue(), 10 ); if ( type == IMAGE || type == PREVIEW ) { if ( !isNaN( value ) ) { element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) ); element.setStyle( 'border-style', 'solid' ); } else if ( !value && this.isChanged() ) { element.removeStyle( 'border-width' ); element.removeStyle( 'border-style' ); element.removeStyle( 'border-color' ); } if ( !internalCommit && type == IMAGE ) element.removeAttribute( 'border' ); } else if ( type == CLEANUP ) { element.removeAttribute( 'border' ); element.removeStyle( 'border-width' ); element.removeStyle( 'border-style' ); element.removeStyle( 'border-color' ); } } }, { type : 'text', id : 'txtHSpace', width: '60px', label : editor.lang.image.hSpace, 'default' : '', onKeyUp : function() { updatePreview( this.getDialog() ); }, onChange : function() { commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateHSpace ), setup : function( type, element ) { if ( type == IMAGE ) { var value, marginLeftPx, marginRightPx, marginLeftStyle = element.getStyle( 'margin-left' ), marginRightStyle = element.getStyle( 'margin-right' ); marginLeftStyle = marginLeftStyle && marginLeftStyle.match( pxLengthRegex ); marginRightStyle = marginRightStyle && marginRightStyle.match( pxLengthRegex ); marginLeftPx = parseInt( marginLeftStyle, 10 ); marginRightPx = parseInt( marginRightStyle, 10 ); value = ( marginLeftPx == marginRightPx ) && marginLeftPx; isNaN( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'hspace' ) ); this.setValue( value ); } }, commit : function( type, element, internalCommit ) { var value = parseInt( this.getValue(), 10 ); if ( type == IMAGE || type == PREVIEW ) { if ( !isNaN( value ) ) { element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) ); element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) ); } else if ( !value && this.isChanged( ) ) { element.removeStyle( 'margin-left' ); element.removeStyle( 'margin-right' ); } if ( !internalCommit && type == IMAGE ) element.removeAttribute( 'hspace' ); } else if ( type == CLEANUP ) { element.removeAttribute( 'hspace' ); element.removeStyle( 'margin-left' ); element.removeStyle( 'margin-right' ); } } }, { type : 'text', id : 'txtVSpace', width : '60px', label : editor.lang.image.vSpace, 'default' : '', onKeyUp : function() { updatePreview( this.getDialog() ); }, onChange : function() { commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, validate : CKEDITOR.dialog.validate.integer( editor.lang.image.validateVSpace ), setup : function( type, element ) { if ( type == IMAGE ) { var value, marginTopPx, marginBottomPx, marginTopStyle = element.getStyle( 'margin-top' ), marginBottomStyle = element.getStyle( 'margin-bottom' ); marginTopStyle = marginTopStyle && marginTopStyle.match( pxLengthRegex ); marginBottomStyle = marginBottomStyle && marginBottomStyle.match( pxLengthRegex ); marginTopPx = parseInt( marginTopStyle, 10 ); marginBottomPx = parseInt( marginBottomStyle, 10 ); value = ( marginTopPx == marginBottomPx ) && marginTopPx; isNaN ( parseInt( value, 10 ) ) && ( value = element.getAttribute( 'vspace' ) ); this.setValue( value ); } }, commit : function( type, element, internalCommit ) { var value = parseInt( this.getValue(), 10 ); if ( type == IMAGE || type == PREVIEW ) { if ( !isNaN( value ) ) { element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) ); element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) ); } else if ( !value && this.isChanged( ) ) { element.removeStyle( 'margin-top' ); element.removeStyle( 'margin-bottom' ); } if ( !internalCommit && type == IMAGE ) element.removeAttribute( 'vspace' ); } else if ( type == CLEANUP ) { element.removeAttribute( 'vspace' ); element.removeStyle( 'margin-top' ); element.removeStyle( 'margin-bottom' ); } } }, { id : 'cmbAlign', type : 'select', widths : [ '35%','65%' ], style : 'width:90px', label : editor.lang.common.align, 'default' : '', items : [ [ editor.lang.common.notSet , ''], [ editor.lang.common.alignLeft , 'left'], [ editor.lang.common.alignRight , 'right'] // Backward compatible with v2 on setup when specified as attribute value, // while these values are no more available as select options. // [ editor.lang.image.alignAbsBottom , 'absBottom'], // [ editor.lang.image.alignAbsMiddle , 'absMiddle'], // [ editor.lang.image.alignBaseline , 'baseline'], // [ editor.lang.image.alignTextTop , 'text-top'], // [ editor.lang.image.alignBottom , 'bottom'], // [ editor.lang.image.alignMiddle , 'middle'], // [ editor.lang.image.alignTop , 'top'] ], onChange : function() { updatePreview( this.getDialog() ); commitInternally.call( this, 'advanced:txtdlgGenStyle' ); }, setup : function( type, element ) { if ( type == IMAGE ) { var value = element.getStyle( 'float' ); switch( value ) { // Ignore those unrelated values. case 'inherit': case 'none': value = ''; } !value && ( value = ( element.getAttribute( 'align' ) || '' ).toLowerCase() ); this.setValue( value ); } }, commit : function( type, element, internalCommit ) { var value = this.getValue(); if ( type == IMAGE || type == PREVIEW ) { if ( value ) element.setStyle( 'float', value ); else element.removeStyle( 'float' ); if ( !internalCommit && type == IMAGE ) { value = ( element.getAttribute( 'align' ) || '' ).toLowerCase(); switch( value ) { // we should remove it only if it matches "left" or "right", // otherwise leave it intact. case 'left': case 'right': element.removeAttribute( 'align' ); } } } else if ( type == CLEANUP ) element.removeStyle( 'float' ); } } ] } ] }, { type : 'vbox', height : '250px', children : [ { type : 'html', style : 'width:95%;', html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+ '<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+ '<div id="' + imagePreviewBoxId + '" class="ImagePreviewBox"><table><tr><td>'+ '<a href="javascript:void(0)" target="_blank" onclick="return false;" id="' + previewLinkId + '">'+ '<img id="' + previewImageId + '" alt="" /></a>' + ( editor.config.image_previewText || 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, '+ 'nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.' ) + '</td></tr></table></div></div>' } ] } ] } ] }, { id : 'Link', label : editor.lang.link.title, padding : 0, elements : [ { id : 'txtUrl', type : 'text', label : editor.lang.common.url, style : 'width: 100%', 'default' : '', setup : function( type, element ) { if ( type == LINK ) { var href = element.data( 'cke-saved-href' ); if ( !href ) href = element.getAttribute( 'href' ); this.setValue( href ); } }, commit : function( type, element ) { if ( type == LINK ) { if ( this.getValue() || this.isChanged() ) { var url = decodeURI( this.getValue() ); element.data( 'cke-saved-href', url ); element.setAttribute( 'href', url ); if ( this.getValue() || !editor.config.image_removeLinkByEmptyURL ) this.getDialog().addLink = true; } } } }, { type : 'button', id : 'browse', filebrowser : { action : 'Browse', target: 'Link:txtUrl', url: editor.config.filebrowserImageBrowseLinkUrl }, style : 'float:right', hidden : true, label : editor.lang.common.browseServer }, { id : 'cmbTarget', type : 'select', label : editor.lang.common.target, 'default' : '', items : [ [ editor.lang.common.notSet , ''], [ editor.lang.common.targetNew , '_blank'], [ editor.lang.common.targetTop , '_top'], [ editor.lang.common.targetSelf , '_self'], [ editor.lang.common.targetParent , '_parent'] ], setup : function( type, element ) { if ( type == LINK ) this.setValue( element.getAttribute( 'target' ) || '' ); }, commit : function( type, element ) { if ( type == LINK ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'target', this.getValue() ); } } } ] }, { id : 'Upload', hidden : true, filebrowser : 'uploadButton', label : editor.lang.image.upload, elements : [ { type : 'file', id : 'upload', label : editor.lang.image.btnUpload, style: 'height:40px', size : 38 }, { type : 'fileButton', id : 'uploadButton', filebrowser : 'info:txtUrl', label : editor.lang.image.btnUpload, 'for' : [ 'Upload', 'upload' ] } ] }, { id : 'advanced', label : editor.lang.common.advancedTab, elements : [ { type : 'hbox', widths : [ '50%', '25%', '25%' ], children : [ { type : 'text', id : 'linkId', label : editor.lang.common.id, setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'id' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'id', this.getValue() ); } } }, { id : 'cmbLangDir', type : 'select', style : 'width : 100px;', label : editor.lang.common.langDir, 'default' : '', items : [ [ editor.lang.common.notSet, '' ], [ editor.lang.common.langDirLtr, 'ltr' ], [ editor.lang.common.langDirRtl, 'rtl' ] ], setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'dir' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'dir', this.getValue() ); } } }, { type : 'text', id : 'txtLangCode', label : editor.lang.common.langCode, 'default' : '', setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'lang' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'lang', this.getValue() ); } } } ] }, { type : 'text', id : 'txtGenLongDescr', label : editor.lang.common.longDescr, setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'longDesc' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'longDesc', this.getValue() ); } } }, { type : 'hbox', widths : [ '50%', '50%' ], children : [ { type : 'text', id : 'txtGenClass', label : editor.lang.common.cssClass, 'default' : '', setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'class' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'class', this.getValue() ); } } }, { type : 'text', id : 'txtGenTitle', label : editor.lang.common.advisoryTitle, 'default' : '', onChange : function() { updatePreview( this.getDialog() ); }, setup : function( type, element ) { if ( type == IMAGE ) this.setValue( element.getAttribute( 'title' ) ); }, commit : function( type, element ) { if ( type == IMAGE ) { if ( this.getValue() || this.isChanged() ) element.setAttribute( 'title', this.getValue() ); } else if ( type == PREVIEW ) { element.setAttribute( 'title', this.getValue() ); } else if ( type == CLEANUP ) { element.removeAttribute( 'title' ); } } } ] }, { type : 'text', id : 'txtdlgGenStyle', label : editor.lang.common.cssStyle, 'default' : '', setup : function( type, element ) { if ( type == IMAGE ) { var genStyle = element.getAttribute( 'style' ); if ( !genStyle && element.$.style.cssText ) genStyle = element.$.style.cssText; this.setValue( genStyle ); var height = element.$.style.height, width = element.$.style.width, aMatchH = ( height ? height : '' ).match( regexGetSize ), aMatchW = ( width ? width : '').match( regexGetSize ); this.attributesInStyle = { height : !!aMatchH, width : !!aMatchW }; } }, onChange : function () { commitInternally.call( this, [ 'info:cmbFloat', 'info:cmbAlign', 'info:txtVSpace', 'info:txtHSpace', 'info:txtBorder', 'info:txtWidth', 'info:txtHeight' ] ); updatePreview( this ); }, commit : function( type, element ) { if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) { element.setAttribute( 'style', this.getValue() ); } } } ] } ] }; }; CKEDITOR.dialog.add( 'image', function( editor ) { return imageDialog( editor, 'image' ); }); CKEDITOR.dialog.add( 'imagebutton', function( editor ) { return imageDialog( editor, 'imagebutton' ); }); })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/image/dialogs/image.js
image.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview The "filebrowser" plugin, it adds support for file uploads and * browsing. * * When file is selected inside of the file browser or uploaded, its url is * inserted automatically to a field, which is described in the 'filebrowser' * attribute. To specify field that should be updated, pass the tab id and * element id, separated with a colon. * * Example 1: (Browse) * * <pre> * { * type : 'button', * id : 'browse', * filebrowser : 'tabId:elementId', * label : editor.lang.common.browseServer * } * </pre> * * If you set the 'filebrowser' attribute on any element other than * 'fileButton', the 'Browse' action will be triggered. * * Example 2: (Quick Upload) * * <pre> * { * type : 'fileButton', * id : 'uploadButton', * filebrowser : 'tabId:elementId', * label : editor.lang.common.uploadSubmit, * 'for' : [ 'upload', 'upload' ] * } * </pre> * * If you set the 'filebrowser' attribute on a fileButton element, the * 'QuickUpload' action will be executed. * * Filebrowser plugin also supports more advanced configuration (through * javascript object). * * The following settings are supported: * * <pre> * [action] - Browse or QuickUpload * [target] - field to update, tabId:elementId * [params] - additional arguments to be passed to the server connector (optional) * [onSelect] - function to execute when file is selected/uploaded (optional) * [url] - the URL to be called (optional) * </pre> * * Example 3: (Quick Upload) * * <pre> * { * type : 'fileButton', * label : editor.lang.common.uploadSubmit, * id : 'buttonId', * filebrowser : * { * action : 'QuickUpload', //required * target : 'tab1:elementId', //required * params : //optional * { * type : 'Files', * currentFolder : '/folder/' * }, * onSelect : function( fileUrl, errorMessage ) //optional * { * // Do not call the built-in selectFuntion * // return false; * } * }, * 'for' : [ 'tab1', 'myFile' ] * } * </pre> * * Suppose we have a file element with id 'myFile', text field with id * 'elementId' and a fileButton. If filebowser.url is not specified explicitly, * form action will be set to 'filebrowser[DialogName]UploadUrl' or, if not * specified, to 'filebrowserUploadUrl'. Additional parameters from 'params' * object will be added to the query string. It is possible to create your own * uploadHandler and cancel the built-in updateTargetElement command. * * Example 4: (Browse) * * <pre> * { * type : 'button', * id : 'buttonId', * label : editor.lang.common.browseServer, * filebrowser : * { * action : 'Browse', * url : '/ckfinder/ckfinder.html&amp;type=Images', * target : 'tab1:elementId' * } * } * </pre> * * In this example, after pressing a button, file browser will be opened in a * popup. If we don't specify filebrowser.url attribute, * 'filebrowser[DialogName]BrowseUrl' or 'filebrowserBrowseUrl' will be used. * After selecting a file in a file browser, an element with id 'elementId' will * be updated. Just like in the third example, a custom 'onSelect' function may be * defined. */ ( function() { /** * Adds (additional) arguments to given url. * * @param {String} * url The url. * @param {Object} * params Additional parameters. */ function addQueryString( url, params ) { var queryString = []; if ( !params ) return url; else { for ( var i in params ) queryString.push( i + "=" + encodeURIComponent( params[ i ] ) ); } return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" ); } /** * Make a string's first character uppercase. * * @param {String} * str String. */ function ucFirst( str ) { str += ''; var f = str.charAt( 0 ).toUpperCase(); return f + str.substr( 1 ); } /** * The onlick function assigned to the 'Browse Server' button. Opens the * file browser and updates target field when file is selected. * * @param {CKEDITOR.event} * evt The event object. */ function browseServer( evt ) { var dialog = this.getDialog(); var editor = dialog.getParentEditor(); editor._.filebrowserSe = this; var width = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowWidth' ] || editor.config.filebrowserWindowWidth || '80%'; var height = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowHeight' ] || editor.config.filebrowserWindowHeight || '70%'; var params = this.filebrowser.params || {}; params.CKEditor = editor.name; params.CKEditorFuncNum = editor._.filebrowserFn; if ( !params.langCode ) params.langCode = editor.langCode; var url = addQueryString( this.filebrowser.url, params ); editor.popup( url, width, height, editor.config.fileBrowserWindowFeatures ); } /** * The onlick function assigned to the 'Upload' button. Makes the final * decision whether form is really submitted and updates target field when * file is uploaded. * * @param {CKEDITOR.event} * evt The event object. */ function uploadFile( evt ) { var dialog = this.getDialog(); var editor = dialog.getParentEditor(); editor._.filebrowserSe = this; // If user didn't select the file, stop the upload. if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getInputElement().$.value ) return false; if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getAction() ) return false; return true; } /** * Setups the file element. * * @param {CKEDITOR.ui.dialog.file} * fileInput The file element used during file upload. * @param {Object} * filebrowser Object containing filebrowser settings assigned to * the fileButton associated with this file element. */ function setupFileElement( editor, fileInput, filebrowser ) { var params = filebrowser.params || {}; params.CKEditor = editor.name; params.CKEditorFuncNum = editor._.filebrowserFn; if ( !params.langCode ) params.langCode = editor.langCode; fileInput.action = addQueryString( filebrowser.url, params ); fileInput.filebrowser = filebrowser; } /** * Traverse through the content definition and attach filebrowser to * elements with 'filebrowser' attribute. * * @param String * dialogName Dialog name. * @param {CKEDITOR.dialog.dialogDefinitionObject} * definition Dialog definition. * @param {Array} * elements Array of {@link CKEDITOR.dialog.contentDefinition} * objects. */ function attachFileBrowser( editor, dialogName, definition, elements ) { var element, fileInput; for ( var i in elements ) { element = elements[ i ]; if ( element.type == 'hbox' || element.type == 'vbox' ) attachFileBrowser( editor, dialogName, definition, element.children ); if ( !element.filebrowser ) continue; if ( typeof element.filebrowser == 'string' ) { var fb = { action : ( element.type == 'fileButton' ) ? 'QuickUpload' : 'Browse', target : element.filebrowser }; element.filebrowser = fb; } if ( element.filebrowser.action == 'Browse' ) { var url = element.filebrowser.url; if ( url === undefined ) { url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ]; if ( url === undefined ) url = editor.config.filebrowserBrowseUrl; } if ( url ) { element.onClick = browseServer; element.filebrowser.url = url; element.hidden = false; } } else if ( element.filebrowser.action == 'QuickUpload' && element[ 'for' ] ) { url = element.filebrowser.url; if ( url === undefined ) { url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ]; if ( url === undefined ) url = editor.config.filebrowserUploadUrl; } if ( url ) { var onClick = element.onClick; element.onClick = function( evt ) { // "element" here means the definition object, so we need to find the correct // button to scope the event call var sender = evt.sender; if ( onClick && onClick.call( sender, evt ) === false ) return false; return uploadFile.call( sender, evt ); }; element.filebrowser.url = url; element.hidden = false; setupFileElement( editor, definition.getContents( element[ 'for' ][ 0 ] ).get( element[ 'for' ][ 1 ] ), element.filebrowser ); } } } } /** * Updates the target element with the url of uploaded/selected file. * * @param {String} * url The url of a file. */ function updateTargetElement( url, sourceElement ) { var dialog = sourceElement.getDialog(); var targetElement = sourceElement.filebrowser.target || null; url = url.replace( /#/g, '%23' ); // If there is a reference to targetElement, update it. if ( targetElement ) { var target = targetElement.split( ':' ); var element = dialog.getContentElement( target[ 0 ], target[ 1 ] ); if ( element ) { element.setValue( url ); dialog.selectPage( target[ 0 ] ); } } } /** * Returns true if filebrowser is configured in one of the elements. * * @param {CKEDITOR.dialog.dialogDefinitionObject} * definition Dialog definition. * @param String * tabId The tab id where element(s) can be found. * @param String * elementId The element id (or ids, separated with a semicolon) to check. */ function isConfigured( definition, tabId, elementId ) { if ( elementId.indexOf( ";" ) !== -1 ) { var ids = elementId.split( ";" ); for ( var i = 0 ; i < ids.length ; i++ ) { if ( isConfigured( definition, tabId, ids[i] ) ) return true; } return false; } var elementFileBrowser = definition.getContents( tabId ).get( elementId ).filebrowser; return ( elementFileBrowser && elementFileBrowser.url ); } function setUrl( fileUrl, data ) { var dialog = this._.filebrowserSe.getDialog(), targetInput = this._.filebrowserSe[ 'for' ], onSelect = this._.filebrowserSe.filebrowser.onSelect; if ( targetInput ) dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).reset(); if ( typeof data == 'function' && data.call( this._.filebrowserSe ) === false ) return; if ( onSelect && onSelect.call( this._.filebrowserSe, fileUrl, data ) === false ) return; // The "data" argument may be used to pass the error message to the editor. if ( typeof data == 'string' && data ) alert( data ); if ( fileUrl ) updateTargetElement( fileUrl, this._.filebrowserSe ); } CKEDITOR.plugins.add( 'filebrowser', { init : function( editor, pluginPath ) { editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor ); editor.on( 'destroy', function () { CKEDITOR.tools.removeFunction( this._.filebrowserFn ); } ); } } ); CKEDITOR.on( 'dialogDefinition', function( evt ) { var definition = evt.data.definition, element; // Associate filebrowser to elements with 'filebrowser' attribute. for ( var i in definition.contents ) { if ( ( element = definition.contents[ i ] ) ) { attachFileBrowser( evt.editor, evt.data.name, definition, element.elements ); if ( element.hidden && element.filebrowser ) { element.hidden = !isConfigured( definition, element[ 'id' ], element.filebrowser ); } } } } ); } )(); /** * The location of an external file browser, that should be launched when "Browse Server" button is pressed. * If configured, the "Browse Server" button will appear in Link, Image and Flash dialogs. * @see The <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)">File Browser/Uploader</a> documentation. * @name CKEDITOR.config.filebrowserBrowseUrl * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserBrowseUrl = '/browser/browse.php'; */ /** * The location of a script that handles file uploads. * If set, the "Upload" tab will appear in "Link", "Image" and "Flash" dialogs. * @name CKEDITOR.config.filebrowserUploadUrl * @see The <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)">File Browser/Uploader</a> documentation. * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserUploadUrl = '/uploader/upload.php'; */ /** * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog. * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}. * @name CKEDITOR.config.filebrowserImageBrowseUrl * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images'; */ /** * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog. * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}. * @name CKEDITOR.config.filebrowserFlashBrowseUrl * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserFlashBrowseUrl = '/browser/browse.php?type=Flash'; */ /** * The location of a script that handles file uploads in the Image dialog. * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserUploadUrl}. * @name CKEDITOR.config.filebrowserImageUploadUrl * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserImageUploadUrl = '/uploader/upload.php?type=Images'; */ /** * The location of a script that handles file uploads in the Flash dialog. * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserUploadUrl}. * @name CKEDITOR.config.filebrowserFlashUploadUrl * @since 3.0 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserFlashUploadUrl = '/uploader/upload.php?type=Flash'; */ /** * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog. * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}. * @name CKEDITOR.config.filebrowserImageBrowseLinkUrl * @since 3.2 * @type String * @default '' (empty string = disabled) * @example * config.filebrowserImageBrowseLinkUrl = '/browser/browse.php'; */ /** * The "features" to use in the file browser popup window. * @name CKEDITOR.config.filebrowserWindowFeatures * @since 3.4.1 * @type String * @default 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes' * @example * config.filebrowserWindowFeatures = 'resizable=yes,scrollbars=no'; */
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/filebrowser/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'htmlwriter' ); /** * Class used to write HTML data. * @constructor * @example * var writer = new CKEDITOR.htmlWriter(); * writer.openTag( 'p' ); * writer.attribute( 'class', 'MyClass' ); * writer.openTagClose( 'p' ); * writer.text( 'Hello' ); * writer.closeTag( 'p' ); * alert( writer.getHtml() ); "&lt;p class="MyClass"&gt;Hello&lt;/p&gt;" */ CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( { base : CKEDITOR.htmlParser.basicWriter, $ : function() { // Call the base contructor. this.base(); /** * The characters to be used for each identation step. * @type String * @default "\t" (tab) * @example * // Use two spaces for indentation. * editorInstance.dataProcessor.writer.indentationChars = ' '; */ this.indentationChars = '\t'; /** * The characters to be used to close "self-closing" elements, like "br" or * "img". * @type String * @default " /&gt;" * @example * // Use HTML4 notation for self-closing elements. * editorInstance.dataProcessor.writer.selfClosingEnd = '>'; */ this.selfClosingEnd = ' />'; /** * The characters to be used for line breaks. * @type String * @default "\n" (LF) * @example * // Use CRLF for line breaks. * editorInstance.dataProcessor.writer.lineBreakChars = '\r\n'; */ this.lineBreakChars = '\n'; this.forceSimpleAmpersand = 0; this.sortAttributes = 1; this._.indent = 0; this._.indentation = ''; // Indicate preformatted block context status. (#5789) this._.inPre = 0; this._.rules = {}; var dtd = CKEDITOR.dtd; for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) { this.setRules( e, { indent : 1, breakBeforeOpen : 1, breakAfterOpen : 1, breakBeforeClose : !dtd[ e ][ '#' ], breakAfterClose : 1 }); } this.setRules( 'br', { breakAfterOpen : 1 }); this.setRules( 'title', { indent : 0, breakAfterOpen : 0 }); this.setRules( 'style', { indent : 0, breakBeforeClose : 1 }); // Disable indentation on <pre>. this.setRules( 'pre', { indent : 0 }); }, proto : { /** * Writes the tag opening part for a opener tag. * @param {String} tagName The element name for this tag. * @param {Object} attributes The attributes defined for this tag. The * attributes could be used to inspect the tag. * @example * // Writes "&lt;p". * writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } ); */ openTag : function( tagName, attributes ) { var rules = this._.rules[ tagName ]; if ( this._.indent ) this.indentation(); // Do not break if indenting. else if ( rules && rules.breakBeforeOpen ) { this.lineBreak(); this.indentation(); } this._.output.push( '<', tagName ); }, /** * Writes the tag closing part for a opener tag. * @param {String} tagName The element name for this tag. * @param {Boolean} isSelfClose Indicates that this is a self-closing tag, * like "br" or "img". * @example * // Writes "&gt;". * writer.openTagClose( 'p', false ); * @example * // Writes " /&gt;". * writer.openTagClose( 'br', true ); */ openTagClose : function( tagName, isSelfClose ) { var rules = this._.rules[ tagName ]; if ( isSelfClose ) this._.output.push( this.selfClosingEnd ); else { this._.output.push( '>' ); if ( rules && rules.indent ) this._.indentation += this.indentationChars; } if ( rules && rules.breakAfterOpen ) this.lineBreak(); tagName == 'pre' && ( this._.inPre = 1 ); }, /** * Writes an attribute. This function should be called after opening the * tag with {@link #openTagClose}. * @param {String} attName The attribute name. * @param {String} attValue The attribute value. * @example * // Writes ' class="MyClass"'. * writer.attribute( 'class', 'MyClass' ); */ attribute : function( attName, attValue ) { if ( typeof attValue == 'string' ) { this.forceSimpleAmpersand && ( attValue = attValue.replace( /&amp;/g, '&' ) ); // Browsers don't always escape special character in attribute values. (#4683, #4719). attValue = CKEDITOR.tools.htmlEncodeAttr( attValue ); } this._.output.push( ' ', attName, '="', attValue, '"' ); }, /** * Writes a closer tag. * @param {String} tagName The element name for this tag. * @example * // Writes "&lt;/p&gt;". * writer.closeTag( 'p' ); */ closeTag : function( tagName ) { var rules = this._.rules[ tagName ]; if ( rules && rules.indent ) this._.indentation = this._.indentation.substr( this.indentationChars.length ); if ( this._.indent ) this.indentation(); // Do not break if indenting. else if ( rules && rules.breakBeforeClose ) { this.lineBreak(); this.indentation(); } this._.output.push( '</', tagName, '>' ); tagName == 'pre' && ( this._.inPre = 0 ); if ( rules && rules.breakAfterClose ) this.lineBreak(); }, /** * Writes text. * @param {String} text The text value * @example * // Writes "Hello Word". * writer.text( 'Hello Word' ); */ text : function( text ) { if ( this._.indent ) { this.indentation(); !this._.inPre && ( text = CKEDITOR.tools.ltrim( text ) ); } this._.output.push( text ); }, /** * Writes a comment. * @param {String} comment The comment text. * @example * // Writes "&lt;!-- My comment --&gt;". * writer.comment( ' My comment ' ); */ comment : function( comment ) { if ( this._.indent ) this.indentation(); this._.output.push( '<!--', comment, '-->' ); }, /** * Writes a line break. It uses the {@link #lineBreakChars} property for it. * @example * // Writes "\n" (e.g.). * writer.lineBreak(); */ lineBreak : function() { if ( !this._.inPre && this._.output.length > 0 ) this._.output.push( this.lineBreakChars ); this._.indent = 1; }, /** * Writes the current indentation chars. It uses the * {@link #indentationChars} property, repeating it for the current * indentation steps. * @example * // Writes "\t" (e.g.). * writer.indentation(); */ indentation : function() { if( !this._.inPre ) this._.output.push( this._.indentation ); this._.indent = 0; }, /** * Sets formatting rules for a give element. The possible rules are: * <ul> * <li><b>indent</b>: indent the element contents.</li> * <li><b>breakBeforeOpen</b>: break line before the opener tag for this element.</li> * <li><b>breakAfterOpen</b>: break line after the opener tag for this element.</li> * <li><b>breakBeforeClose</b>: break line before the closer tag for this element.</li> * <li><b>breakAfterClose</b>: break line after the closer tag for this element.</li> * </ul> * * All rules default to "false". Each call to the function overrides * already present rules, leaving the undefined untouched. * * By default, all elements available in the {@link CKEDITOR.dtd.$block), * {@link CKEDITOR.dtd.$listItem} and {@link CKEDITOR.dtd.$tableContent} * lists have all the above rules set to "true". Additionaly, the "br" * element has the "breakAfterOpen" set to "true". * @param {String} tagName The element name to which set the rules. * @param {Object} rules An object containing the element rules. * @example * // Break line before and after "img" tags. * writer.setRules( 'img', * { * breakBeforeOpen : true * breakAfterOpen : true * }); * @example * // Reset the rules for the "h1" tag. * writer.setRules( 'h1', {} ); */ setRules : function( tagName, rules ) { var currentRules = this._.rules[ tagName ]; if ( currentRules ) CKEDITOR.tools.extend( currentRules, rules, true ); else this._.rules[ tagName ] = rules; } } });
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/htmlwriter/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { var flashFilenameRegex = /\.swf(?:$|\?)/i; var cssifyLength = CKEDITOR.tools.cssLength; function isFlashEmbed( element ) { var attributes = element.attributes; return ( attributes.type == 'application/x-shockwave-flash' || flashFilenameRegex.test( attributes.src || '' ) ); } function createFakeElement( editor, realElement ) { var fakeElement = editor.createFakeParserElement( realElement, 'cke_flash', 'flash', true ), fakeStyle = fakeElement.attributes.style || ''; var width = realElement.attributes.width, height = realElement.attributes.height; if ( typeof width != 'undefined' ) fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + cssifyLength( width ) + ';'; if ( typeof height != 'undefined' ) fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + cssifyLength( height ) + ';'; return fakeElement; } CKEDITOR.plugins.add( 'flash', { init : function( editor ) { editor.addCommand( 'flash', new CKEDITOR.dialogCommand( 'flash' ) ); editor.ui.addButton( 'Flash', { label : editor.lang.common.flash, command : 'flash' }); CKEDITOR.dialog.add( 'flash', this.path + 'dialogs/flash.js' ); editor.addCss( 'img.cke_flash' + '{' + 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/placeholder.png' ) + ');' + 'background-position: center center;' + 'background-repeat: no-repeat;' + 'border: 1px solid #a9a9a9;' + 'width: 80px;' + 'height: 80px;' + '}' ); // If the "menu" plugin is loaded, register the menu items. if ( editor.addMenuItems ) { editor.addMenuItems( { flash : { label : editor.lang.flash.properties, command : 'flash', group : 'flash' } }); } editor.on( 'doubleclick', function( evt ) { var element = evt.data.element; if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'flash' ) evt.data.dialog = 'flash'; }); // If the "contextmenu" plugin is loaded, register the listeners. if ( editor.contextMenu ) { editor.contextMenu.addListener( function( element, selection ) { if ( element && element.is( 'img' ) && !element.isReadOnly() && element.data( 'cke-real-element-type' ) == 'flash' ) return { flash : CKEDITOR.TRISTATE_OFF }; }); } }, afterInit : function( editor ) { var dataProcessor = editor.dataProcessor, dataFilter = dataProcessor && dataProcessor.dataFilter; if ( dataFilter ) { dataFilter.addRules( { elements : { 'cke:object' : function( element ) { var attributes = element.attributes, classId = attributes.classid && String( attributes.classid ).toLowerCase(); if ( !classId ) { // Look for the inner <embed> for ( var i = 0 ; i < element.children.length ; i++ ) { if ( element.children[ i ].name == 'cke:embed' ) { if ( !isFlashEmbed( element.children[ i ] ) ) return null; return createFakeElement( editor, element ); } } return null; } return createFakeElement( editor, element ); }, 'cke:embed' : function( element ) { if ( !isFlashEmbed( element ) ) return null; return createFakeElement( editor, element ); } } }, 5); } }, requires : [ 'fakeobjects' ] }); })(); CKEDITOR.tools.extend( CKEDITOR.config, { /** * Save as EMBED tag only. This tag is unrecommended. * @type Boolean * @default false */ flashEmbedTagOnly : false, /** * Add EMBED tag as alternative: &lt;object&gt&lt;embed&gt&lt;/embed&gt&lt;/object&gt * @type Boolean * @default false */ flashAddEmbedTag : true, /** * Use embedTagOnly and addEmbedTag values on edit. * @type Boolean * @default false */ flashConvertOnEdit : false } );
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/flash/plugin.js
plugin.js
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { /* * It is possible to set things in three different places. * 1. As attributes in the object tag. * 2. As param tags under the object tag. * 3. As attributes in the embed tag. * It is possible for a single attribute to be present in more than one place. * So let's define a mapping between a sementic attribute and its syntactic * equivalents. * Then we'll set and retrieve attribute values according to the mapping, * instead of having to check and set each syntactic attribute every time. * * Reference: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701 */ var ATTRTYPE_OBJECT = 1, ATTRTYPE_PARAM = 2, ATTRTYPE_EMBED = 4; var attributesMap = { id : [ { type : ATTRTYPE_OBJECT, name : 'id' } ], classid : [ { type : ATTRTYPE_OBJECT, name : 'classid' } ], codebase : [ { type : ATTRTYPE_OBJECT, name : 'codebase'} ], pluginspage : [ { type : ATTRTYPE_EMBED, name : 'pluginspage' } ], src : [ { type : ATTRTYPE_PARAM, name : 'movie' }, { type : ATTRTYPE_EMBED, name : 'src' } ], name : [ { type : ATTRTYPE_EMBED, name : 'name' } ], align : [ { type : ATTRTYPE_OBJECT, name : 'align' } ], title : [ { type : ATTRTYPE_OBJECT, name : 'title' }, { type : ATTRTYPE_EMBED, name : 'title' } ], 'class' : [ { type : ATTRTYPE_OBJECT, name : 'class' }, { type : ATTRTYPE_EMBED, name : 'class'} ], width : [ { type : ATTRTYPE_OBJECT, name : 'width' }, { type : ATTRTYPE_EMBED, name : 'width' } ], height : [ { type : ATTRTYPE_OBJECT, name : 'height' }, { type : ATTRTYPE_EMBED, name : 'height' } ], hSpace : [ { type : ATTRTYPE_OBJECT, name : 'hSpace' }, { type : ATTRTYPE_EMBED, name : 'hSpace' } ], vSpace : [ { type : ATTRTYPE_OBJECT, name : 'vSpace' }, { type : ATTRTYPE_EMBED, name : 'vSpace' } ], style : [ { type : ATTRTYPE_OBJECT, name : 'style' }, { type : ATTRTYPE_EMBED, name : 'style' } ], type : [ { type : ATTRTYPE_EMBED, name : 'type' } ] }; var names = [ 'play', 'loop', 'menu', 'quality', 'scale', 'salign', 'wmode', 'bgcolor', 'base', 'flashvars', 'allowScriptAccess', 'allowFullScreen' ]; for ( var i = 0 ; i < names.length ; i++ ) attributesMap[ names[i] ] = [ { type : ATTRTYPE_EMBED, name : names[i] }, { type : ATTRTYPE_PARAM, name : names[i] } ]; names = [ 'allowFullScreen', 'play', 'loop', 'menu' ]; for ( i = 0 ; i < names.length ; i++ ) attributesMap[ names[i] ][0]['default'] = attributesMap[ names[i] ][1]['default'] = true; function loadValue( objectNode, embedNode, paramMap ) { var attributes = attributesMap[ this.id ]; if ( !attributes ) return; var isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox ); for ( var i = 0 ; i < attributes.length ; i++ ) { var attrDef = attributes[ i ]; switch ( attrDef.type ) { case ATTRTYPE_OBJECT: if ( !objectNode ) continue; if ( objectNode.getAttribute( attrDef.name ) !== null ) { var value = objectNode.getAttribute( attrDef.name ); if ( isCheckbox ) this.setValue( value.toLowerCase() == 'true' ); else this.setValue( value ); return; } else if ( isCheckbox ) this.setValue( !!attrDef[ 'default' ] ); break; case ATTRTYPE_PARAM: if ( !objectNode ) continue; if ( attrDef.name in paramMap ) { value = paramMap[ attrDef.name ]; if ( isCheckbox ) this.setValue( value.toLowerCase() == 'true' ); else this.setValue( value ); return; } else if ( isCheckbox ) this.setValue( !!attrDef[ 'default' ] ); break; case ATTRTYPE_EMBED: if ( !embedNode ) continue; if ( embedNode.getAttribute( attrDef.name ) ) { value = embedNode.getAttribute( attrDef.name ); if ( isCheckbox ) this.setValue( value.toLowerCase() == 'true' ); else this.setValue( value ); return; } else if ( isCheckbox ) this.setValue( !!attrDef[ 'default' ] ); } } } function commitValue( objectNode, embedNode, paramMap ) { var attributes = attributesMap[ this.id ]; if ( !attributes ) return; var isRemove = ( this.getValue() === '' ), isCheckbox = ( this instanceof CKEDITOR.ui.dialog.checkbox ); for ( var i = 0 ; i < attributes.length ; i++ ) { var attrDef = attributes[i]; switch ( attrDef.type ) { case ATTRTYPE_OBJECT: if ( !objectNode ) continue; var value = this.getValue(); if ( isRemove || isCheckbox && value === attrDef[ 'default' ] ) objectNode.removeAttribute( attrDef.name ); else objectNode.setAttribute( attrDef.name, value ); break; case ATTRTYPE_PARAM: if ( !objectNode ) continue; value = this.getValue(); if ( isRemove || isCheckbox && value === attrDef[ 'default' ] ) { if ( attrDef.name in paramMap ) paramMap[ attrDef.name ].remove(); } else { if ( attrDef.name in paramMap ) paramMap[ attrDef.name ].setAttribute( 'value', value ); else { var param = CKEDITOR.dom.element.createFromHtml( '<cke:param></cke:param>', objectNode.getDocument() ); param.setAttributes( { name : attrDef.name, value : value } ); if ( objectNode.getChildCount() < 1 ) param.appendTo( objectNode ); else param.insertBefore( objectNode.getFirst() ); } } break; case ATTRTYPE_EMBED: if ( !embedNode ) continue; value = this.getValue(); if ( isRemove || isCheckbox && value === attrDef[ 'default' ]) embedNode.removeAttribute( attrDef.name ); else embedNode.setAttribute( attrDef.name, value ); } } } CKEDITOR.dialog.add( 'flash', function( editor ) { var makeObjectTag = !editor.config.flashEmbedTagOnly, makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly; var previewPreloader, previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>' + '<div id="cke_FlashPreviewLoader' + CKEDITOR.tools.getNextNumber() + '" style="display:none"><div class="loading">&nbsp;</div></div>' + '<div id="cke_FlashPreviewBox' + CKEDITOR.tools.getNextNumber() + '" class="FlashPreviewBox"></div></div>'; return { title : editor.lang.flash.title, minWidth : 420, minHeight : 310, onShow : function() { // Clear previously saved elements. this.fakeImage = this.objectNode = this.embedNode = null; previewPreloader = new CKEDITOR.dom.element( 'embed', editor.document ); // Try to detect any embed or object tag that has Flash parameters. var fakeImage = this.getSelectedElement(); if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'flash' ) { this.fakeImage = fakeImage; var realElement = editor.restoreRealElement( fakeImage ), objectNode = null, embedNode = null, paramMap = {}; if ( realElement.getName() == 'cke:object' ) { objectNode = realElement; var embedList = objectNode.getElementsByTag( 'embed', 'cke' ); if ( embedList.count() > 0 ) embedNode = embedList.getItem( 0 ); var paramList = objectNode.getElementsByTag( 'param', 'cke' ); for ( var i = 0, length = paramList.count() ; i < length ; i++ ) { var item = paramList.getItem( i ), name = item.getAttribute( 'name' ), value = item.getAttribute( 'value' ); paramMap[ name ] = value; } } else if ( realElement.getName() == 'cke:embed' ) embedNode = realElement; this.objectNode = objectNode; this.embedNode = embedNode; this.setupContent( objectNode, embedNode, paramMap, fakeImage ); } }, onOk : function() { // If there's no selected object or embed, create one. Otherwise, reuse the // selected object and embed nodes. var objectNode = null, embedNode = null, paramMap = null; if ( !this.fakeImage ) { if ( makeObjectTag ) { objectNode = CKEDITOR.dom.element.createFromHtml( '<cke:object></cke:object>', editor.document ); var attributes = { classid : 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000', codebase : 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' }; objectNode.setAttributes( attributes ); } if ( makeEmbedTag ) { embedNode = CKEDITOR.dom.element.createFromHtml( '<cke:embed></cke:embed>', editor.document ); embedNode.setAttributes( { type : 'application/x-shockwave-flash', pluginspage : 'http://www.macromedia.com/go/getflashplayer' } ); if ( objectNode ) embedNode.appendTo( objectNode ); } } else { objectNode = this.objectNode; embedNode = this.embedNode; } // Produce the paramMap if there's an object tag. if ( objectNode ) { paramMap = {}; var paramList = objectNode.getElementsByTag( 'param', 'cke' ); for ( var i = 0, length = paramList.count() ; i < length ; i++ ) paramMap[ paramList.getItem( i ).getAttribute( 'name' ) ] = paramList.getItem( i ); } // A subset of the specified attributes/styles // should also be applied on the fake element to // have better visual effect. (#5240) var extraStyles = {}, extraAttributes = {}; this.commitContent( objectNode, embedNode, paramMap, extraStyles, extraAttributes ); // Refresh the fake image. var newFakeImage = editor.createFakeElement( objectNode || embedNode, 'cke_flash', 'flash', true ); newFakeImage.setAttributes( extraAttributes ); newFakeImage.setStyles( extraStyles ); if ( this.fakeImage ) { newFakeImage.replace( this.fakeImage ); editor.getSelection().selectElement( newFakeImage ); } else editor.insertElement( newFakeImage ); }, onHide : function() { if ( this.preview ) this.preview.setHtml(''); }, contents : [ { id : 'info', label : editor.lang.common.generalTab, accessKey : 'I', elements : [ { type : 'vbox', padding : 0, children : [ { type : 'hbox', widths : [ '280px', '110px' ], align : 'right', children : [ { id : 'src', type : 'text', label : editor.lang.common.url, required : true, validate : CKEDITOR.dialog.validate.notEmpty( editor.lang.flash.validateSrc ), setup : loadValue, commit : commitValue, onLoad : function() { var dialog = this.getDialog(), updatePreview = function( src ){ // Query the preloader to figure out the url impacted by based href. previewPreloader.setAttribute( 'src', src ); dialog.preview.setHtml( '<embed height="100%" width="100%" src="' + CKEDITOR.tools.htmlEncode( previewPreloader.getAttribute( 'src' ) ) + '" type="application/x-shockwave-flash"></embed>' ); }; // Preview element dialog.preview = dialog.getContentElement( 'info', 'preview' ).getElement().getChild( 3 ); // Sync on inital value loaded. this.on( 'change', function( evt ){ if ( evt.data && evt.data.value ) updatePreview( evt.data.value ); } ); // Sync when input value changed. this.getInputElement().on( 'change', function( evt ){ updatePreview( this.getValue() ); }, this ); } }, { type : 'button', id : 'browse', filebrowser : 'info:src', hidden : true, // v-align with the 'src' field. // TODO: We need something better than a fixed size here. style : 'display:inline-block;margin-top:10px;', label : editor.lang.common.browseServer } ] } ] }, { type : 'hbox', widths : [ '25%', '25%', '25%', '25%', '25%' ], children : [ { type : 'text', id : 'width', style : 'width:95px', label : editor.lang.common.width, validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidWidth ), setup : function( objectNode, embedNode, paramMap, fakeImage ) { loadValue.apply( this, arguments ); if ( fakeImage ) { var fakeImageWidth = parseInt( fakeImage.$.style.width, 10 ); if ( !isNaN( fakeImageWidth ) ) this.setValue( fakeImageWidth ); } }, commit : function( objectNode, embedNode, paramMap, extraStyles ) { commitValue.apply( this, arguments ); if ( this.getValue() ) extraStyles.width = this.getValue() + 'px'; } }, { type : 'text', id : 'height', style : 'width:95px', label : editor.lang.common.height, validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidHeight ), setup : function( objectNode, embedNode, paramMap, fakeImage ) { loadValue.apply( this, arguments ); if ( fakeImage ) { var fakeImageHeight = parseInt( fakeImage.$.style.height, 10 ); if ( !isNaN( fakeImageHeight ) ) this.setValue( fakeImageHeight ); } }, commit : function( objectNode, embedNode, paramMap, extraStyles ) { commitValue.apply( this, arguments ); if ( this.getValue() ) extraStyles.height = this.getValue() + 'px'; } }, { type : 'text', id : 'hSpace', style : 'width:95px', label : editor.lang.flash.hSpace, validate : CKEDITOR.dialog.validate.integer( editor.lang.flash.validateHSpace ), setup : loadValue, commit : commitValue }, { type : 'text', id : 'vSpace', style : 'width:95px', label : editor.lang.flash.vSpace, validate : CKEDITOR.dialog.validate.integer( editor.lang.flash.validateVSpace ), setup : loadValue, commit : commitValue } ] }, { type : 'vbox', children : [ { type : 'html', id : 'preview', style : 'width:95%;', html : previewAreaHtml } ] } ] }, { id : 'Upload', hidden : true, filebrowser : 'uploadButton', label : editor.lang.common.upload, elements : [ { type : 'file', id : 'upload', label : editor.lang.common.upload, size : 38 }, { type : 'fileButton', id : 'uploadButton', label : editor.lang.common.uploadSubmit, filebrowser : 'info:src', 'for' : [ 'Upload', 'upload' ] } ] }, { id : 'properties', label : editor.lang.flash.propertiesTab, elements : [ { type : 'hbox', widths : [ '50%', '50%' ], children : [ { id : 'scale', type : 'select', label : editor.lang.flash.scale, 'default' : '', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , ''], [ editor.lang.flash.scaleAll, 'showall' ], [ editor.lang.flash.scaleNoBorder, 'noborder' ], [ editor.lang.flash.scaleFit, 'exactfit' ] ], setup : loadValue, commit : commitValue }, { id : 'allowScriptAccess', type : 'select', label : editor.lang.flash.access, 'default' : '', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , ''], [ editor.lang.flash.accessAlways, 'always' ], [ editor.lang.flash.accessSameDomain, 'samedomain' ], [ editor.lang.flash.accessNever, 'never' ] ], setup : loadValue, commit : commitValue } ] }, { type : 'hbox', widths : [ '50%', '50%' ], children : [ { id : 'wmode', type : 'select', label : editor.lang.flash.windowMode, 'default' : '', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , '' ], [ editor.lang.flash.windowModeWindow, 'window' ], [ editor.lang.flash.windowModeOpaque, 'opaque' ], [ editor.lang.flash.windowModeTransparent, 'transparent' ] ], setup : loadValue, commit : commitValue }, { id : 'quality', type : 'select', label : editor.lang.flash.quality, 'default' : 'high', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , '' ], [ editor.lang.flash.qualityBest, 'best' ], [ editor.lang.flash.qualityHigh, 'high' ], [ editor.lang.flash.qualityAutoHigh, 'autohigh' ], [ editor.lang.flash.qualityMedium, 'medium' ], [ editor.lang.flash.qualityAutoLow, 'autolow' ], [ editor.lang.flash.qualityLow, 'low' ] ], setup : loadValue, commit : commitValue } ] }, { type : 'hbox', widths : [ '50%', '50%' ], children : [ { id : 'align', type : 'select', label : editor.lang.common.align, 'default' : '', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , ''], [ editor.lang.common.alignLeft , 'left'], [ editor.lang.flash.alignAbsBottom , 'absBottom'], [ editor.lang.flash.alignAbsMiddle , 'absMiddle'], [ editor.lang.flash.alignBaseline , 'baseline'], [ editor.lang.common.alignBottom , 'bottom'], [ editor.lang.common.alignMiddle , 'middle'], [ editor.lang.common.alignRight , 'right'], [ editor.lang.flash.alignTextTop , 'textTop'], [ editor.lang.common.alignTop , 'top'] ], setup : loadValue, commit : function( objectNode, embedNode, paramMap, extraStyles, extraAttributes ) { var value = this.getValue(); commitValue.apply( this, arguments ); value && ( extraAttributes.align = value ); } }, { type : 'html', html : '<div></div>' } ] }, { type : 'fieldset', label : CKEDITOR.tools.htmlEncode( editor.lang.flash.flashvars ), children : [ { type : 'vbox', padding : 0, children : [ { type : 'checkbox', id : 'menu', label : editor.lang.flash.chkMenu, 'default' : true, setup : loadValue, commit : commitValue }, { type : 'checkbox', id : 'play', label : editor.lang.flash.chkPlay, 'default' : true, setup : loadValue, commit : commitValue }, { type : 'checkbox', id : 'loop', label : editor.lang.flash.chkLoop, 'default' : true, setup : loadValue, commit : commitValue }, { type : 'checkbox', id : 'allowFullScreen', label : editor.lang.flash.chkFull, 'default' : true, setup : loadValue, commit : commitValue } ] } ] } ] }, { id : 'advanced', label : editor.lang.common.advancedTab, elements : [ { type : 'hbox', widths : [ '45%', '55%' ], children : [ { type : 'text', id : 'id', label : editor.lang.common.id, setup : loadValue, commit : commitValue }, { type : 'text', id : 'title', label : editor.lang.common.advisoryTitle, setup : loadValue, commit : commitValue } ] }, { type : 'hbox', widths : [ '45%', '55%' ], children : [ { type : 'text', id : 'bgcolor', label : editor.lang.flash.bgcolor, setup : loadValue, commit : commitValue }, { type : 'text', id : 'class', label : editor.lang.common.cssClass, setup : loadValue, commit : commitValue } ] }, { type : 'text', id : 'style', label : editor.lang.common.cssStyle, setup : loadValue, commit : commitValue } ] } ] }; } ); })();
z3c.formwidget.ckeditor
/z3c.formwidget.ckeditor-2.0.0a1.zip/z3c.formwidget.ckeditor-2.0.0a1/src/z3c/formwidget/ckeditor/ckeditor-js/_source/plugins/flash/dialogs/flash.js
flash.js