diff --git a/Gruntfile.js b/Gruntfile.js
index 776bceb99..b21a4dfd5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -286,7 +286,7 @@ module.exports = function(grunt) {
options: {
publish: [{
id: 'gov.nasa.jpl:evm:zip',
- version: '3.1.0',
+ version: '3.2.0',
path: 'deploy/'
}]
}
diff --git a/app/assets/alfresco-icon-sm.png b/app/assets/alfresco-icon-sm.png
new file mode 100644
index 000000000..458572c82
Binary files /dev/null and b/app/assets/alfresco-icon-sm.png differ
diff --git a/app/assets/arrow-change.svg b/app/assets/arrow-change.svg
new file mode 100644
index 000000000..8d2504033
--- /dev/null
+++ b/app/assets/arrow-change.svg
@@ -0,0 +1,12 @@
+
+
+
diff --git a/app/assets/arrowhead.svg b/app/assets/arrowhead.svg
new file mode 100644
index 000000000..ce87f61f4
--- /dev/null
+++ b/app/assets/arrowhead.svg
@@ -0,0 +1,12 @@
+
+
+
diff --git a/app/assets/location-feedback.svg b/app/assets/location-feedback.svg
new file mode 100644
index 000000000..2c7a839eb
--- /dev/null
+++ b/app/assets/location-feedback.svg
@@ -0,0 +1,18 @@
+
+
+
diff --git a/app/js/mms/app.js b/app/js/mms/app.js
index c4bbab5ed..2f29d625f 100644
--- a/app/js/mms/app.js
+++ b/app/js/mms/app.js
@@ -1,9 +1,9 @@
'use strict';
-angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.borderLayout', 'ui.bootstrap', 'ui.router', 'ui.tree', 'angular-growl', 'cfp.hotkeys', 'angulartics', 'angulartics.piwik', 'diff-match-patch', 'ngStorage'])
+angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.borderLayout', 'ui.bootstrap', 'ui.router', 'ui.tree', 'angular-growl', 'cfp.hotkeys', 'angulartics', 'angulartics.piwik', 'diff-match-patch', 'ngStorage', 'ngAnimate'])
.config(function($stateProvider, $urlRouterProvider, $httpProvider) {
-
+
$urlRouterProvider.rule(function ($injector, $location) {
var locationPath = $location.url();
if (locationPath.indexOf('full%23') > 0)
@@ -64,7 +64,7 @@ angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.bor
growl.error(reason.message);
});
};
- }
+ }
}
}
})
@@ -82,7 +82,7 @@ angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.bor
});
return deferred.promise;
},
- orgObs: function($stateParams, ProjectService, ticket) {
+ orgObs: function($stateParams, ProjectService, ticket) {
return ProjectService.getOrgs();
}
},
@@ -129,11 +129,11 @@ angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.bor
for (var i = 0; i < projectArray.length; i++) {
if(projectArray[i].id === project.id){
return 1;
- }
+ }
}
return 0;
};
-
+
$scope.continue = function() {
if (orgId && projectId) {
$scope.spin = true;
@@ -209,7 +209,7 @@ angular.module('mmsApp', ['mms', 'mms.directives', 'app.tpls', 'fa.directive.bor
},
views: {
'nav@': {
- template: '
', - invisibleSpace: '', - rBlockTest: /^(P|H[1-6]|LI|ADDRESS|SECTION|HEADER|FOOTER|ASIDE|ARTICLE)$/i, - alignmentTags: ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'DD', 'DL', 'DT', 'DIV', 'TD', - 'BLOCKQUOTE', 'OUTPUT', 'FIGCAPTION', 'ADDRESS', 'SECTION', - 'HEADER', 'FOOTER', 'ASIDE', 'ARTICLE'], - ownLine: ['area', 'body', 'head', 'hr', 'i?frame', 'link', 'meta', 'noscript', 'style', 'script', 'table', 'tbody', 'thead', 'tfoot'], - contOwnLine: ['li', 'dt', 'dt', 'h[1-6]', 'option', 'script'], - newLevel: ['blockquote', 'div', 'dl', 'fieldset', 'form', 'frameset', 'map', 'ol', 'p', 'pre', 'select', 'td', 'th', 'tr', 'ul'], - blockLevelElements: ['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'DD', 'DL', 'DT', 'DIV', 'LI', - 'BLOCKQUOTE', 'OUTPUT', 'FIGCAPTION', 'PRE', 'ADDRESS', 'SECTION', - 'HEADER', 'FOOTER', 'ASIDE', 'ARTICLE', 'TD'], - - - // lang - langs: { - en: { - html: 'HTML', - video: 'Insert Video', - image: 'Insert Image', - table: 'Table', - link: 'Link', - link_insert: 'Insert link', - link_edit: 'Edit link', - unlink: 'Unlink', - formatting: 'Formatting', - paragraph: 'Normal text', - quote: 'Quote', - code: 'Code', - header1: 'Header 1', - header2: 'Header 2', - header3: 'Header 3', - header4: 'Header 4', - header5: 'Header 5', - bold: 'Bold', - italic: 'Italic', - fontcolor: 'Font Color', - backcolor: 'Back Color', - unorderedlist: 'Unordered List', - orderedlist: 'Ordered List', - outdent: 'Outdent', - indent: 'Indent', - cancel: 'Cancel', - insert: 'Insert', - save: 'Save', - _delete: 'Delete', - insert_table: 'Insert Table', - insert_row_above: 'Add Row Above', - insert_row_below: 'Add Row Below', - insert_column_left: 'Add Column Left', - insert_column_right: 'Add Column Right', - delete_column: 'Delete Column', - delete_row: 'Delete Row', - delete_table: 'Delete Table', - rows: 'Rows', - columns: 'Columns', - add_head: 'Add Head', - delete_head: 'Delete Head', - title: 'Title', - image_position: 'Position', - none: 'None', - left: 'Left', - right: 'Right', - center: 'Center', - image_web_link: 'Image Web Link', - text: 'Text', - mailto: 'Email', - web: 'URL', - video_html_code: 'Video Embed Code', - file: 'Insert File', - upload: 'Upload', - download: 'Download', - choose: 'Choose', - or_choose: 'Or choose', - drop_file_here: 'Drop file here', - align_left: 'Align text to the left', - align_center: 'Center text', - align_right: 'Align text to the right', - align_justify: 'Justify text', - horizontalrule: 'Insert Horizontal Rule', - deleted: 'Deleted', - anchor: 'Anchor', - link_new_tab: 'Open link in new tab', - underline: 'Underline', - alignment: 'Alignment', - filename: 'Name (optional)', - edit: 'Edit' - } - } - }; - - // Functionality - Redactor.fn = $.Redactor.prototype = { - - keyCode: { - BACKSPACE: 8, - DELETE: 46, - DOWN: 40, - ENTER: 13, - ESC: 27, - TAB: 9, - CTRL: 17, - META: 91, - LEFT: 37, - LEFT_WIN: 91 - }, - - // Initialization - init: function(el, options) - { - this.rtePaste = false; - this.$element = this.$source = $(el); - this.uuid = uuid++; - - // clonning options - var opts = $.extend(true, {}, $.Redactor.opts); - - // current settings - this.opts = $.extend( - {}, - opts, - this.$element.data(), - options - ); - - this.start = true; - this.dropdowns = []; - - // get sizes - this.sourceHeight = this.$source.css('height'); - this.sourceWidth = this.$source.css('width'); - - // dependency of the editor modes - if (this.opts.fullpage) this.opts.iframe = true; - if (this.opts.linebreaks) this.opts.paragraphy = false; - if (this.opts.paragraphy) this.opts.linebreaks = false; - if (this.opts.toolbarFixedBox) this.opts.toolbarFixed = true; - - // the alias for iframe mode - this.document = document; - this.window = window; - - // selection saved - this.savedSel = false; - - // clean setup - this.cleanlineBefore = new RegExp('^<(/?' + this.opts.ownLine.join('|/?' ) + '|' + this.opts.contOwnLine.join('|') + ')[ >]'); - this.cleanlineAfter = new RegExp('^<(br|/?' + this.opts.ownLine.join('|/?' ) + '|/' + this.opts.contOwnLine.join('|/') + ')[ >]'); - this.cleannewLevel = new RegExp('^?(' + this.opts.newLevel.join('|' ) + ')[ >]'); - - // block level - this.rTestBlock = new RegExp('^(' + this.opts.blockLevelElements.join('|' ) + ')$', 'i'); - - // setup formatting permissions - if (this.opts.linebreaks === false) - { - if (this.opts.allowedTags !== false) - { - var arrSearch = ['strong', 'em', 'del']; - var arrAdd = ['b', 'i', 'strike']; - - if ($.inArray('p', this.opts.allowedTags) === '-1') this.opts.allowedTags.push('p'); - - for (i in arrSearch) - { - if ($.inArray(arrSearch[i], this.opts.allowedTags) != '-1') this.opts.allowedTags.push(arrAdd[i]); - } - } - - if (this.opts.deniedTags !== false) - { - var pos = $.inArray('p', this.opts.deniedTags); - if (pos !== '-1') this.opts.deniedTags.splice(pos, pos); - } - } - - // ie & opera - if (this.browser('msie') || this.browser('opera')) - { - this.opts.buttons = this.removeFromArrayByValue(this.opts.buttons, 'horizontalrule'); - } - - // load lang - this.opts.curLang = this.opts.langs[this.opts.lang]; - - // extend shortcuts - $.extend(this.opts.shortcuts, this.opts.shortcutsAdd); - - // init placeholder - this.placeholderInit(); - - // Build - this.buildStart(); - - }, - toolbarInit: function(lang) - { - return { - html: - { - title: lang.html, - func: 'toggle' - }, - formatting: - { - title: lang.formatting, - func: 'show', - dropdown: - { - p: - { - title: lang.paragraph, - func: 'formatBlocks' - }, - blockquote: - { - title: lang.quote, - func: 'formatQuote', - className: 'redactor_format_blockquote' - }, - pre: - { - title: lang.code, - func: 'formatBlocks', - className: 'redactor_format_pre' - }, - h1: - { - title: lang.header1, - func: 'formatBlocks', - className: 'redactor_format_h1' - }, - h2: - { - title: lang.header2, - func: 'formatBlocks', - className: 'redactor_format_h2' - }, - h3: - { - title: lang.header3, - func: 'formatBlocks', - className: 'redactor_format_h3' - }, - h4: - { - title: lang.header4, - func: 'formatBlocks', - className: 'redactor_format_h4' - }, - h5: - { - title: lang.header5, - func: 'formatBlocks', - className: 'redactor_format_h5' - } - } - }, - bold: - { - title: lang.bold, - exec: 'bold' - }, - italic: - { - title: lang.italic, - exec: 'italic' - }, - deleted: - { - title: lang.deleted, - exec: 'strikethrough' - }, - underline: - { - title: lang.underline, - exec: 'underline' - }, - unorderedlist: - { - title: '• ' + lang.unorderedlist, - exec: 'insertunorderedlist' - }, - orderedlist: - { - title: '1. ' + lang.orderedlist, - exec: 'insertorderedlist' - }, - outdent: - { - title: '< ' + lang.outdent, - func: 'indentingOutdent' - }, - indent: - { - title: '> ' + lang.indent, - func: 'indentingIndent' - }, - image: - { - title: lang.image, - func: 'imageShow' - }, - video: - { - title: lang.video, - func: 'videoShow' - }, - file: - { - title: lang.file, - func: 'fileShow' - }, - table: - { - title: lang.table, - func: 'show', - dropdown: - { - insert_table: - { - title: lang.insert_table, - func: 'tableShow' - }, - separator_drop1: - { - name: 'separator' - }, - insert_row_above: - { - title: lang.insert_row_above, - func: 'tableAddRowAbove' - }, - insert_row_below: - { - title: lang.insert_row_below, - func: 'tableAddRowBelow' - }, - insert_column_left: - { - title: lang.insert_column_left, - func: 'tableAddColumnLeft' - }, - insert_column_right: - { - title: lang.insert_column_right, - func: 'tableAddColumnRight' - }, - separator_drop2: - { - name: 'separator' - }, - add_head: - { - title: lang.add_head, - func: 'tableAddHead' - }, - delete_head: - { - title: lang.delete_head, - func: 'tableDeleteHead' - }, - separator_drop3: - { - name: 'separator' - }, - delete_column: - { - title: lang.delete_column, - func: 'tableDeleteColumn' - }, - delete_row: - { - title: lang.delete_row, - func: 'tableDeleteRow' - }, - delete_table: - { - title: lang.delete_table, - func: 'tableDeleteTable' - } - } - }, - link: { - title: lang.link, - func: 'show', - dropdown: - { - link: - { - title: lang.link_insert, - func: 'linkShow' - }, - unlink: - { - title: lang.unlink, - exec: 'unlink' - } - } - }, - alignment: - { - title: lang.alignment, - func: 'show', - dropdown: - { - alignleft: - { - title: lang.align_left, - func: 'alignmentLeft' - }, - aligncenter: - { - title: lang.align_center, - func: 'alignmentCenter' - }, - alignright: - { - title: lang.align_right, - func: 'alignmentRight' - }, - justify: - { - title: lang.align_justify, - func: 'alignmentJustify' - } - } - }, - alignleft: - { - title: lang.align_left, - func: 'alignmentLeft' - }, - aligncenter: - { - title: lang.align_center, - func: 'alignmentCenter' - }, - alignright: - { - title: lang.align_right, - func: 'alignmentRight' - }, - alignjustify: - { - title: lang.align_justify, - func: 'alignmentJustify' - }, - horizontalrule: - { - exec: 'inserthorizontalrule', - title: lang.horizontalrule - } - - } - }, - - // CALLBACKS - callback: function(type, event, data) - { - var callback = this.opts[ type + 'Callback' ]; - if ($.isFunction(callback)) - { - if (event === false) return callback.call(this, data); - else return callback.call(this, event, data); - } - else return data; - }, - - - // DESTROY - destroy: function() - { - clearInterval(this.autosaveInterval); - - $(window).off('.redactor'); - this.$source.off('redactor-textarea'); - this.$element.off('.redactor').removeData('redactor'); - - var html = this.get(); - - if (this.opts.textareamode) - { - this.$box.after(this.$source); - this.$box.remove(); - this.$source.val(html).show(); - } - else - { - var $elem = this.$editor; - if (this.opts.iframe) $elem = this.$element; - - this.$box.after($elem); - this.$box.remove(); - - $elem.removeClass('redactor_editor').removeClass('redactor_editor_wym').removeAttr('contenteditable').html(html).show(); - } - - if (this.opts.toolbarExternal) - { - $(this.opts.toolbarExternal).html(''); - } - - if (this.opts.air) - { - $('#redactor_air_' + this.uuid).remove(); - } - }, - - // API GET - getObject: function() - { - return $.extend({}, this); - }, - getEditor: function() - { - return this.$editor; - }, - getBox: function() - { - return this.$box; - }, - getIframe: function() - { - return (this.opts.iframe) ? this.$frame : false; - }, - getToolbar: function() - { - return (this.$toolbar) ? this.$toolbar : false; - }, - - // CODE GET & SET - get: function() - { - return this.$source.val(); - }, - getCodeIframe: function() - { - this.$editor.removeAttr('contenteditable').removeAttr('dir'); - var html = this.outerHtml(this.$frame.contents().children()); - this.$editor.attr({ 'contenteditable': true, 'dir': this.opts.direction }); - - return html; - }, - set: function(html, strip, placeholderRemove) - { - html = html.toString(); - html = html.replace(/\$/g, '$'); - - if (this.opts.fullpage) this.setCodeIframe(html); - else this.setEditor(html, strip); - - if (html == '') placeholderRemove = false; - if (placeholderRemove !== false) this.placeholderRemoveFromEditor(); - }, - setEditor: function(html, strip) - { - - if (strip !== false) - { - html = this.cleanSavePreCode(html); - - html = this.cleanStripTags(html); - html = this.cleanConvertProtected(html); - html = this.cleanConvertInlineTags(html, true); - - if (this.opts.linebreaks === false) html = this.cleanConverters(html); - else html = html.replace(/([\w\W]*?)<\/p>/gi, '$2 ' + this.opts.invisibleSpace + ' ' + this.opts.invisibleSpace + ' ' + this.opts.invisibleSpace + ' ' + this.opts.invisibleSpace + ' ').append($(current).clone());
- $(current).replaceWith(node);
- var next = $(node).next();
- if (typeof(next[0]) !== 'undefined' && next[0].tagName == 'BR')
- {
- next.remove();
- }
-
- this.selectionEnd(node);
- }
-
- // convert links
- if ((this.opts.convertLinks || this.opts.convertImageLinks || this.opts.convertVideoLinks) && key === this.keyCode.ENTER)
- {
- this.buildEventKeyupConverters();
- }
-
- // if empty
- if (key === this.keyCode.DELETE || key === this.keyCode.BACKSPACE)
- {
- return this.formatEmpty(e);
- }
-
- this.callback('keyup', e);
- this.sync(e);
- },
- buildEventKeyupConverters: function()
- {
- this.formatLinkify(this.opts.linkProtocol, this.opts.convertLinks, this.opts.convertImageLinks, this.opts.convertVideoLinks, this.opts.linkSize);
-
- setTimeout($.proxy(function()
- {
- if (this.opts.convertImageLinks) this.observeImages();
- if (this.opts.observeLinks) this.observeLinks();
- }, this), 5);
- },
- buildPlugins: function()
- {
- if (!this.opts.plugins ) return;
-
- $.each(this.opts.plugins, $.proxy(function(i, s)
- {
- if (RedactorPlugins[s])
- {
- $.extend(this, RedactorPlugins[s]);
- if ($.isFunction( RedactorPlugins[ s ].init)) this.init();
- }
-
- }, this ));
- },
-
- // IFRAME
- iframeStart: function()
- {
- this.iframeCreate();
-
- if (this.opts.textareamode) this.iframeAppend(this.$source);
- else
- {
- this.$sourceOld = this.$source.hide();
- this.$source = this.buildCodearea(this.$sourceOld);
- this.iframeAppend(this.$sourceOld);
- }
- },
- iframeAppend: function(el)
- {
- this.$source.attr('dir', this.opts.direction).hide();
- this.$box.insertAfter(el).append(this.$frame).append(this.$source);
- },
- iframeCreate: function()
- {
- this.$frame = $('').one('load', $.proxy(function()
- {
- if (this.opts.fullpage)
- {
- this.iframePage();
-
- if (this.content === '') this.content = this.opts.invisibleSpace;
-
- this.$frame.contents()[0].write(this.content);
- this.$frame.contents()[0].close();
-
- var timer = setInterval($.proxy(function()
- {
- if (this.$frame.contents().find('body').html())
- {
- clearInterval(timer);
- this.iframeLoad();
- }
-
- }, this), 0);
- }
- else this.iframeLoad();
-
- }, this));
- },
- iframeDoc: function()
- {
- return this.$frame[0].contentWindow.document;
- },
- iframePage: function()
- {
- var doc = this.iframeDoc();
- if (doc.documentElement) doc.removeChild(doc.documentElement);
-
- return doc;
- },
- iframeAddCss: function(css)
- {
- css = css || this.opts.css;
-
- if (this.isString(css))
- {
- this.$frame.contents().find('head').append('');
- }
-
- if ($.isArray(css))
- {
- $.each(css, $.proxy(function(i, url)
- {
- this.iframeAddCss(url);
-
- }, this));
- }
- },
- iframeLoad: function()
- {
- this.$editor = this.$frame.contents().find('body').attr({ 'contenteditable': true, 'dir': this.opts.direction });
-
- // set document & window
- if (this.$editor[0])
- {
- this.document = this.$editor[0].ownerDocument;
- this.window = this.document.defaultView || window;
- }
-
- // iframe css
- this.iframeAddCss();
-
- if (this.opts.fullpage)
- {
- this.setFullpageOnInit(this.$source.val());
- }
- else this.set(this.content, true, false);
-
- this.buildOptions();
- this.buildAfter();
- },
-
- // PLACEHOLDER
- placeholderInit: function()
- {
- if (this.opts.placeholder !== false)
- {
- this.placeholderText = this.opts.placeholder;
- this.opts.placeholder = true;
- }
- else
- {
- if (typeof this.$element.attr('placeholder') == 'undefined' || this.$element.attr('placeholder') == '')
- {
- this.opts.placeholder = false;
- }
- else
- {
- this.placeholderText = this.$element.attr('placeholder');
- this.opts.placeholder = true;
- }
- }
- },
- placeholderStart: function(html)
- {
- if (this.opts.placeholder === false)
- {
- return false;
- }
-
- if (this.isEmpty(html))
- {
- this.opts.focus = false;
- this.placeholderOnFocus();
- this.placeholderOnBlur();
-
- return this.placeholderGet();
- }
- else
- {
- this.placeholderOnBlur();
- }
-
- return false;
- },
- placeholderOnFocus: function()
- {
- this.$editor.on('focus.redactor_placeholder', $.proxy(this.placeholderFocus, this));
- },
- placeholderOnBlur: function()
- {
- this.$editor.on('blur.redactor_placeholder', $.proxy(this.placeholderBlur, this));
- },
- placeholderGet: function()
- {
- var ph = $('').data('redactor', 'verified')
- .attr('contenteditable', false).text(this.placeholderText);
-
- if (this.opts.linebreaks === false)
- {
- return $(' ').append(ph);
- }
- else return ph;
- },
- placeholderBlur: function()
- {
- var html = this.get();
- if (this.isEmpty(html))
- {
- this.placeholderOnFocus();
- this.$editor.html(this.placeholderGet());
- }
- },
- placeholderFocus: function()
- {
- this.$editor.find('span.redactor_placeholder').remove();
-
- var html = '';
- if (this.opts.linebreaks === false)
- {
- html = this.opts.emptyHtml;
- }
-
- this.$editor.off('focus.redactor_placeholder');
- this.$editor.html(html);
-
- if (this.opts.linebreaks === false)
- {
- // place the cursor inside emptyHtml
- this.selectionStart(this.$editor.children()[0]);
- }
- else
- {
- this.focus();
- }
-
- this.sync();
- },
- placeholderRemoveFromEditor: function()
- {
- this.$editor.find('span.redactor_placeholder').remove();
- this.$editor.off('focus.redactor_placeholder');
- },
- placeholderRemoveFromCode: function(html)
- {
- return html.replace(/(.*?)<\/span>/i, '');
- },
-
- // SHORTCUTS
- shortcuts: function(e, key)
- {
-
- // disable browser's hot keys for bold and italic
- if (!this.opts.shortcuts)
- {
- if ((e.ctrlKey || e.metaKey) && (key === 66 || key === 73))
- {
- e.preventDefault();
- }
-
- return false;
- }
-
- $.each(this.opts.shortcuts, $.proxy(function(str, command)
- {
- var keys = str.split(',');
- for (var i in keys)
- {
- if (typeof keys[i] === 'string')
- {
- this.shortcutsHandler(e, $.trim(keys[i]), $.proxy(function()
- {
- eval(command);
- }, this));
- }
-
- }
-
- }, this));
-
-
- },
- shortcutsHandler: function(e, keys, origHandler)
- {
- // based on https://github.com/jeresig/jquery.hotkeys
- var hotkeysSpecialKeys =
- {
- 8: "backspace", 9: "tab", 10: "return", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
- 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
- 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 59: ";", 61: "=",
- 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
- 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
- 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: "numlock", 145: "scroll", 173: "-", 186: ";", 187: "=",
- 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'"
- };
-
-
- var hotkeysShiftNums =
- {
- "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
- "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
- ".": ">", "/": "?", "\\": "|"
- };
-
- keys = keys.toLowerCase().split(" ");
- var special = hotkeysSpecialKeys[e.keyCode],
- character = String.fromCharCode( e.which ).toLowerCase(),
- modif = "", possible = {};
-
- $.each([ "alt", "ctrl", "meta", "shift"], function(index, specialKey)
- {
- if (e[specialKey + 'Key'] && special !== specialKey)
- {
- modif += specialKey + '+';
- }
- });
-
-
- if (special)
- {
- possible[modif + special] = true;
- }
-
- if (character)
- {
- possible[modif + character] = true;
- possible[modif + hotkeysShiftNums[character]] = true;
-
- // "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
- if (modif === "shift+")
- {
- possible[hotkeysShiftNums[character]] = true;
- }
- }
-
- for (var i = 0, l = keys.length; i < l; i++)
- {
- if (possible[keys[i]])
- {
- e.preventDefault();
- return origHandler.apply(this, arguments);
- }
- }
- },
-
- // FOCUS
- focus: function()
- {
- if (!this.browser('opera'))
- {
- this.window.setTimeout($.proxy(this.focusSet, this, true), 1);
- }
- else
- {
- this.$editor.focus();
- }
- },
- focusWithSaveScroll: function()
- {
- if (this.browser('msie'))
- {
- var top = this.document.documentElement.scrollTop;
- }
-
- this.$editor.focus();
-
- if (this.browser('msie'))
- {
- this.document.documentElement.scrollTop = top;
- }
- },
- focusEnd: function()
- {
- if (!this.browser('mozilla'))
- {
- this.focusSet();
- }
- else
- {
- if (this.opts.linebreaks === false)
- {
- var last = this.$editor.children().last();
-
- this.$editor.focus();
- this.selectionEnd(last);
- }
- else
- {
- this.focusSet();
- }
- }
- },
- focusSet: function(collapse, element)
- {
- this.$editor.focus();
-
- if (typeof element == 'undefined')
- {
- element = this.$editor[0];
- }
-
- var range = this.getRange();
- range.selectNodeContents(element);
-
- // collapse - controls the position of focus: the beginning (true), at the end (false).
- range.collapse(collapse || false);
-
- var sel = this.getSelection();
- sel.removeAllRanges();
- sel.addRange(range);
- },
-
- // TOGGLE
- toggle: function(direct)
- {
- if (this.opts.visual) this.toggleCode(direct);
- else this.toggleVisual();
- },
- toggleVisual: function()
- {
- var html = this.$source.hide().val();
- if (typeof this.modified !== 'undefined')
- {
- var modified = this.modified.replace(/\n/g, '');
-
- var thtml = html.replace(/\n/g, '');
- thtml = this.cleanRemoveSpaces(thtml, false);
-
- this.modified = this.cleanRemoveSpaces(modified, false) !== thtml;
- }
-
- if (this.modified)
- {
- // don't remove the iframe even if cleared all.
- if (this.opts.fullpage && html === '')
- {
- this.setFullpageOnInit(html);
- }
- else
- {
- this.set(html);
- if (this.opts.fullpage)
- {
- this.buildBindKeyboard();
- }
- }
-
- this.callback('change', false, html);
- }
-
- if (this.opts.iframe) this.$frame.show();
- else this.$editor.show();
-
- if (this.opts.fullpage) this.$editor.attr('contenteditable', true );
-
- this.$source.off('keydown.redactor-textarea-indenting');
-
- this.$editor.focus();
- this.selectionRestore();
-
- this.observeStart();
- this.buttonActiveVisual();
- this.buttonInactive('html');
- this.opts.visual = true;
-
-
- },
- toggleCode: function(direct)
- {
- if (direct !== false) this.selectionSave();
-
- var height = null;
- if (this.opts.iframe)
- {
- height = this.$frame.height();
- if (this.opts.fullpage) this.$editor.removeAttr('contenteditable');
- this.$frame.hide();
- }
- else
- {
- height = this.$editor.innerHeight();
- this.$editor.hide();
- }
-
- var html = this.$source.val();
-
- // tidy html
- if (html !== '' && this.opts.tidyHtml)
- {
- this.$source.val(this.cleanHtml(html));
- }
-
- this.modified = html;
-
- this.$source.height(height).show().focus();
-
- // textarea indenting
- this.$source.on('keydown.redactor-textarea-indenting', this.textareaIndenting);
-
- this.buttonInactiveVisual();
- this.buttonActive('html');
- this.opts.visual = false;
- },
- textareaIndenting: function(e)
- {
- if (e.keyCode === 9)
- {
- var $el = $(this);
- var start = $el.get(0).selectionStart;
- $el.val($el.val().substring(0, start) + "\t" + $el.val().substring($el.get(0).selectionEnd));
- $el.get(0).selectionStart = $el.get(0).selectionEnd = start + 1;
- return false;
- }
- },
-
- // AUTOSAVE
- autosave: function()
- {
- var savedHtml = false;
- this.autosaveInterval = setInterval($.proxy(function()
- {
- var html = this.get();
- if (savedHtml !== html)
- {
- var name = this.$source.attr('name');
- $.ajax({
- url: this.opts.autosave,
- type: 'post',
- data: 'name=' + name + '&' + name + '=' + escape(encodeURIComponent(html)),
- success: $.proxy(function(data)
- {
- var json = $.parseJSON(data);
- if (typeof json.error == 'undefined')
- {
- // success
- this.callback('autosave', false, json);
- }
- else
- {
- // error
- this.callback('autosaveError', false, json);
- }
-
- savedHtml = html;
-
- }, this)
- });
- }
- }, this), this.opts.autosaveInterval*1000);
- },
-
- // TOOLBAR
- toolbarBuild: function()
- {
- // hide on mobile
- if (this.isMobile() && this.opts.buttonsHideOnMobile.length > 0)
- {
- $.each(this.opts.buttonsHideOnMobile, $.proxy(function(i, s)
- {
- var index = this.opts.buttons.indexOf(s);
- this.opts.buttons.splice(index, 1);
-
- }, this));
- }
-
- // extend buttons
- if (this.opts.air)
- {
- this.opts.buttons = this.opts.airButtons;
- }
- else
- {
- if (!this.opts.buttonSource)
- {
- var index = this.opts.buttons.indexOf('html');
- this.opts.buttons.splice(index, 1);
- }
- }
-
- // formatting tags
- if (this.opts.toolbar)
- {
- $.each(this.opts.toolbar.formatting.dropdown, $.proxy(function (i, s)
- {
- if ($.inArray(i, this.opts.formattingTags ) == '-1') delete this.opts.toolbar.formatting.dropdown[i];
-
- }, this));
- }
-
- // if no buttons don't create a toolbar
- if (this.opts.buttons.length === 0) return false;
-
- // air enable
- this.airEnable();
-
- // toolbar build
- this.$toolbar = $(' ').append(cloned.contents()));
- }
- else
- {
- var clonedHtml = cloned.html().replace(/ $2 \\s* \\s* \n\t?<\/p>/gi, '');
- htmls[i] = htmls[i].replace(/ <\/p>/gi, '');
-
- if (htmls[i] != '')
- {
- html += ' ' + htmls[i].replace(/^\n+|\n+$/g, "") + " ', 'gi', ' ');
- html = R(' \s? ([^<]+)(div|address|form)>', 'gi', " $1 (?' + blocks + '[^>]*>) ( \s?(?' + blocks + '[^>]*>)', 'gi', "$1");
-
- html = R('(?' + blocks + '[^>]*>)\s? ', 'gi', ' ', 'gi', '');
- //html = R(' (.*?)', 'gi', '');
- // html = R(' ', 'gi', '');
- html = R(' \t?\n? ', 'gi', ' ');
- html = R(' ', 'gi', '');
- html = R(' ', 'gi', '');
- html = R(' \t* \s?<\/p>/gi, '');
-
- if (html === '' || thtml === '')
- {
- e.preventDefault();
-
- var node = $(this.opts.emptyHtml).get(0);
- this.$editor.html(node);
- this.focus();
- }
- }
-
- this.sync();
- },
- formatBlocks: function(tag)
- {
- if (this.browser('mozilla') && this.isFocused())
- {
- this.$editor.focus();
- }
-
- this.bufferSet();
-
- var nodes = this.getBlocks();
- this.selectionSave();
-
- $.each(nodes, $.proxy(function(i, node)
- {
- if (node.tagName !== 'LI')
- {
- var parent = $(node).parent();
-
- if (tag === 'p')
- {
- if ((node.tagName === 'P'
- && parent.size() != 0
- && parent[0].tagName === 'BLOCKQUOTE')
- ||
- node.tagName === 'BLOCKQUOTE')
- {
- this.formatQuote();
- return;
- }
- else if (this.opts.linebreaks)
- {
- if (node && node.tagName.search(/H[1-6]/) == 0)
- {
- $(node).replaceWith(node.innerHTML + ' ([\w\W]*?)<\/p>/gi, '$2 ' + html + ' /gi, ' /gi, ' /gi, ' /gi, '
Revert documentation, name, and value of this element from
+ {{compareCommit.commitSelected._creator}} - {{compareCommit.commitSelected._created | date:'M/d/yy h:mm a'}} on {{compareCommit.ref.type}}: {{compareCommit.ref.name}}
+ to
+ {{baseCommit.commitSelected._creator}} - {{baseCommit.commitSelected._created | date:'M/d/yy h:mm a'}}
+ on {{baseCommit.refSelected.type}}: {{baseCommit.refSelected.name}}. This will create a new commit under your user name on {{compareCommit.ref.name}}. Cross reference contents will NOT be reverted.
');
- }
-
- // $ fix
- html = html.replace(/$/g, '$');
-
- html = this.cleanEmpty(html);
-
- this.$editor.html(html);
-
- // set no editable
- this.setNonEditable();
- this.setSpansVerified();
-
- this.sync();
- },
- setCodeIframe: function(html)
- {
- var doc = this.iframePage();
- this.$frame[0].src = "about:blank";
-
- html = this.cleanConvertProtected(html);
- html = this.cleanConvertInlineTags(html);
- html = this.cleanRemoveSpaces(html);
-
- doc.open();
- doc.write(html);
- doc.close();
-
- // redefine editor for fullpage mode
- if (this.opts.fullpage)
- {
- this.$editor = this.$frame.contents().find('body').attr({ 'contenteditable': true, 'dir': this.opts.direction });
- }
-
- // set no editable
- this.setNonEditable();
- this.setSpansVerified();
- this.sync();
-
- },
- setFullpageOnInit: function(html)
- {
- this.fullpageDoctype = html.match(/^<\!doctype[^>]*>/i);
- if (this.fullpageDoctype && this.fullpageDoctype.length == 1)
- {
- html = html.replace(/^<\!doctype[^>]*>/i, '');
- }
-
- html = this.cleanSavePreCode(html, true);
- html = this.cleanConverters(html);
- html = this.cleanEmpty(html);
-
- // set code
- this.$editor.html(html);
-
- // set no editable
- this.setNonEditable();
- this.setSpansVerified();
- this.sync();
- },
- setFullpageDoctype: function()
- {
- if (this.fullpageDoctype && this.fullpageDoctype.length == 1)
- {
- var source = this.fullpageDoctype[0] + '\n' + this.$source.val();
- this.$source.val(source);
- }
- },
- setSpansVerified: function()
- {
- var spans = this.$editor.find('span');
- var replacementTag = 'inline';
-
- $.each(spans, function() {
- var outer = this.outerHTML;
-
- // Replace opening tag
- var regex = new RegExp('<' + this.tagName, 'gi');
- var newTag = outer.replace(regex, '<' + replacementTag);
-
- // Replace closing tag
- regex = new RegExp('' + this.tagName, 'gi');
- newTag = newTag.replace(regex, '' + replacementTag);
-
- $(this).replaceWith(newTag);
- });
-
- },
- setSpansVerifiedHtml: function(html)
- {
- html = html.replace(//, '
') html = '';
-
- // xhtml
- if (this.opts.xhtml)
- {
- var xhtmlTags = ['br', 'hr', 'img', 'link', 'input', 'meta'];
- $.each(xhtmlTags, function(i,s)
- {
- html = html.replace(new RegExp('<' + s + '(.*?[^\/$]?)>', 'gi'), '<' + s + '$1 />');
- });
-
- }
-
- // before callback
- html = this.callback('syncBefore', false, html);
-
- this.$source.val(html);
- this.setFullpageDoctype();
-
- // onchange & after callback
- this.callback('syncAfter', false, html);
-
- if (this.start === false)
- {
-
- if (typeof e != 'undefined')
- {
- switch(e.which)
- {
- case 37: // left
- break;
- case 38: // up
- break;
- case 39: // right
- break;
- case 40: // down
- break;
-
- default: this.callback('change', false, html);
- }
- }
- else
- {
- this.callback('change', false, html);
- }
- }
-
- },
- syncClean: function(html)
- {
- if (!this.opts.fullpage) html = this.cleanStripTags(html);
-
- // trim
- html = $.trim(html);
-
- // removeplaceholder
- html = this.placeholderRemoveFromCode(html);
-
- // remove space
- html = html.replace(//gi, '');
- html = html.replace(//gi, '');
- html = html.replace(/<\/a> /gi, '<\/a> ');
- html = html.replace(/\u200B/g, '');
-
- if (html == '' || html == '
\n?<\/(P|H[1-6]|LI|ADDRESS|SECTION|HEADER|FOOTER|ASIDE|ARTICLE)>/gi, '$1>');
-
- // remove image resize
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3');
- html = html.replace(/(.*?)<\/span>/gi, '');
- html = html.replace(/(.*?)<\/span>/gi, '');
-
- // remove empty lists
- html = html.replace(/<(ul|ol)>\s*\t*\n*<\/(ul|ol)>/gi, '');
-
- // remove font
- if (this.opts.cleanFontTag)
- {
- html = html.replace(/([\w\W]*?)<\/font>/gi, '$2');
- }
-
- // remove spans
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$2');
- html = html.replace(/
$/i, ''));
- }
-
- return;
- }
- else this.dblEnter++;
- }
- else this.dblEnter++;
- }
-
- // pre
- if (pre === true)
- {
- return this.buildEventKeydownPre(e, current);
- }
- else
- {
- if (!this.opts.linebreaks)
- {
- // lists exit
- if (block && block.tagName == 'LI')
- {
- var listCurrent = this.getBlock();
- if (listCurrent !== false || listCurrent.tagName === 'LI')
- {
- var listText = $.trim($(block).text());
- var listCurrentText = $.trim($(listCurrent).text());
- if (listText == ''
- && listCurrentText == ''
- && $(listCurrent).next('li').size() == 0
- && $(listCurrent).parents('li').size() == 0)
- {
- this.bufferSet();
-
- var $list = $(listCurrent).closest('ol, ul');
- $(listCurrent).remove();
- var node = $('
' + this.opts.invisibleSpace);
-
- $(current).replaceWith(node);
- this.selectionStart(node);
- this.sync();
- }
-
- if (typeof current.nodeValue !== 'undefined' && current.nodeValue !== null)
- {
- if (current.remove && current.nodeType === 3 && current.nodeValue.match(/[^\u200B]/g) == null)
- {
- $(current).prev().remove();
- this.sync();
- }
- }
- },
- buildEventKeydownInsertLineBreak: function(e)
- {
- this.bufferSet();
- e.preventDefault();
- this.insertLineBreak();
- this.callback('enter', e);
- return;
- },
- buildEventKeyup: function(e)
- {
- if (this.rtePaste) return false;
-
- var key = e.which;
- var parent = this.getParent();
- var current = this.getCurrent();
-
- // replace to p before / after the table or body
- if (!this.opts.linebreaks && current.nodeType == 3 && (parent == false || parent.tagName == 'BODY'))
- {
- var node = $('').addClass('redactor_toolbar').attr('id', 'redactor_toolbar_' + this.uuid);
-
- if (this.opts.typewriter)
- {
- this.$toolbar.addClass('redactor-toolbar-typewriter');
- }
-
- if (this.opts.toolbarOverflow && this.isMobile())
- {
- this.$toolbar.addClass('redactor-toolbar-overflow');
- }
-
- if (this.opts.air)
- {
- // air box
- this.$air = $('
$/i, '');
- data += clonedHtml + '
';
- }
-
- if (i == 0)
- {
- $s.addClass('redactor-replaced').empty();
- replaced = this.outerHtml($s);
- }
- else $s.remove();
- }
-
- }, this));
-
-
- html = this.$editor.html().replace(replaced, '' + listTag + '>' + data + '<' + listTag + '>');
-
- this.$editor.html(html);
- this.$editor.find(listTag + ':empty').remove();
-
- }
-
- // insert lists
- else
- {
- var firstParent = $(this.getParent()).closest('td');
-
- if (this.browser('msie') && !this.isIe11() && this.opts.linebreaks)
- {
- var wrapper = this.selectionWrap('div');
- var wrapperHtml = $(wrapper).html();
- var tmpList = $('');
- if (cmd == 'insertorderedlist')
- {
- tmpList = $('
');
- }
-
- var tmpLi = $('
');
- }
-
- if ($list.length)
- {
- // remove block-element list wrapper
- var $listParent = $list.parent();
- if (this.isParentRedactor($listParent) && $listParent[0].tagName != 'LI' && this.nodeTestBlocks($listParent[0]))
- {
- $listParent.replaceWith($listParent.contents());
- }
- }
-
- if (this.browser('mozilla'))
- {
- this.$editor.focus();
- }
- }
-
- this.selectionRestore();
- this.$editor.find('#selection-marker-1').removeAttr('id');
- this.sync();
- this.callback('execCommand', cmd, param);
- return;
- },
-
- // INDENTING
- indentingIndent: function()
- {
- this.indentingStart('indent');
- },
- indentingOutdent: function()
- {
- this.indentingStart('outdent');
- },
- indentingStart: function(cmd)
- {
- this.bufferSet();
-
- if (cmd === 'indent')
- {
- var block = this.getBlock();
-
- this.selectionSave();
-
- if (block && block.tagName == 'LI')
- {
- // li
- var parent = this.getParent();
-
- var $list = $(parent).closest('ol, ul');
- var listTag = $list[0].tagName;
-
- var elems = this.getBlocks();
-
- $.each(elems, function(i,s)
- {
- if (s.tagName == 'LI')
- {
- var $prev = $(s).prev();
- if ($prev.size() != 0 && $prev[0].tagName == 'LI')
- {
- var $childList = $prev.children('ul, ol');
- if ($childList.size() == 0)
- {
- $prev.append($('<' + listTag + '>').append(s));
- }
- else $childList.append(s);
- }
- }
- });
- }
- // linebreaks
- else if (block === false && this.opts.linebreaks === true)
- {
- this.exec('formatBlock', 'blockquote');
- var newblock = this.getBlock();
- var block = $('
');
- }
- // all block tags
- else
- {
- $el.css('margin-left', '');
- this.removeEmptyAttr($el, 'style');
- }
- }
- else
- {
- $el.css('margin-left', left + 'px');
- }
-
- }, this));
- }
-
-
- this.selectionRestore();
- }
-
- this.sync();
-
- },
- insideOutdent: function (li, index, elems)
- {
- if (li && li.tagName == 'LI')
- {
- var $parent = $(li).parent().parent();
- if ($parent.size() != 0 && $parent[0].tagName == 'LI')
- {
- $parent.after(li);
- }
- else
- {
- if (typeof elems[index] != 'undefined')
- {
- li = elems[index];
- index++;
-
- this.insideOutdent(li, index, elems);
- }
- else
- {
- this.execCommand('insertunorderedlist');
- }
- }
- }
- },
-
- // ALIGNMENT
- alignmentLeft: function()
- {
- this.alignmentSet('', 'JustifyLeft');
- },
- alignmentRight: function()
- {
- this.alignmentSet('right', 'JustifyRight');
- },
- alignmentCenter: function()
- {
- this.alignmentSet('center', 'JustifyCenter');
- },
- alignmentJustify: function()
- {
- this.alignmentSet('justify', 'JustifyFull');
- },
- alignmentSet: function(type, cmd)
- {
- this.bufferSet();
-
- if (this.oldIE())
- {
- this.document.execCommand(cmd, false, false);
- return true;
- }
-
- this.selectionSave();
-
- var block = this.getBlock();
- if (!block && this.opts.linebreaks)
- {
- // one element
- this.exec('formatblock', 'div');
-
- var newblock = this.getBlock();
- var block = $('
$/gi) !== -1) html = '
' + this.opts.emptyHtml;
- }
-
- return html;
- },
- cleanConverters: function(html)
- {
- // convert div to p
- if (this.opts.convertDivs && !this.opts.gallery)
- {
- html = html.replace(/\\s*
", "", "", "", "
", "", "
", "
", "\\s*", " ", "
\\s*
\\s*
\s*
/gi, "\n\n");
- html = html.replace(/
/gi, "\n\n");
-
- function R(str, mod, r)
- {
- return html.replace(new RegExp(str, mod), r);
- }
-
- var blocks = '(comment|html|body|head|title|meta|style|script|link|iframe|table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
-
- html = R('(<' + blocks + '[^>]*>)', 'gi', "\n$1");
- html = R('(' + blocks + '>)', 'gi', "$1\n\n");
- html = R("\r\n", 'g', "\n");
- html = R("\r", 'g', "\n");
- html = R("/\n\n+/", 'g', "\n\n");
-
- var htmls = html.split(new RegExp('\n\s*\n', 'g'), -1);
-
- html = '';
- for (var i in htmls)
- {
- if (htmls.hasOwnProperty(i))
- {
- if (htmls[i].search('{replace') == -1)
- {
- htmls[i] = htmls[i].replace(/
', 'gi', "$1");
- html = R('
(\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)', 'gi', '$1');
- html = R("\n", 'gi', '');
-
- html = R('([\w\W]*?)<\/strike>/gi, '$1');
- else html = html.replace(/([\w\W]*?)<\/del>/gi, '$1');
-
- return html;
- },
- cleanStripTags: function(html)
- {
- if (html == '' || typeof html == 'undefined') return html;
-
- var allowed = false;
- if (this.opts.allowedTags !== false) allowed = true;
-
- var arr = allowed === true ? this.opts.allowedTags : this.opts.deniedTags;
-
- var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
- html = html.replace(tags, function ($0, $1)
- {
- if (allowed === true) return $.inArray($1.toLowerCase(), arr) > '-1' ? $0 : '';
- else return $.inArray($1.toLowerCase(), arr) > '-1' ? '' : $0;
- });
-
- html = this.cleanConvertInlineTags(html);
-
- return html;
-
- },
- cleanSavePreCode: function(html, encode)
- {
- var pre = html.match(/<(pre|code)(.*?)>([\w\W]*?)<\/(pre|code)>/gi);
- if (pre !== null)
- {
- $.each(pre, $.proxy(function(i,s)
- {
- var arr = s.match(/<(pre|code)(.*?)>([\w\W]*?)<\/(pre|code)>/i);
-
- arr[3] = arr[3].replace(/ /g, ' ');
-
- if (encode !== false) arr[3] = this.cleanEncodeEntities(arr[3]);
-
- // $ fix
- arr[3] = arr[3].replace(/\$/g, '$');
-
- html = html.replace(s, '<' + arr[1] + arr[2] + '>' + arr[3] + '' + arr[1] + '>');
-
- }, this));
- }
-
- return html;
- },
- cleanEncodeEntities: function(str)
- {
- str = String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
- return str.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
- },
- cleanUnverified: function()
- {
- // label, abbr, mark, meter, code, q, dfn, ins, time, kbd, var
- var $elem = this.$editor.find('li, img, a, b, strong, sub, sup, i, em, u, small, strike, del, span, cite');
-
- $elem.filter('[style*="background-color: transparent;"][style*="line-height"]')
- .css('background-color', '')
- .css('line-height', '');
-
- $elem.filter('[style*="background-color: transparent;"]')
- .css('background-color', '');
-
- $elem.css('line-height', '');
-
- $.each($elem, $.proxy(function(i,s)
- {
- this.removeEmptyAttr(s, 'style');
- }, this));
-
- var $elem2 = this.$editor.find('b, strong, i, em, u, strike, del');
- $elem2.css('font-size', '');
-
- $.each($elem2, $.proxy(function(i,s)
- {
- this.removeEmptyAttr(s, 'style');
- }, this));
-
- // When we paste text in Safari is wrapping inserted div (remove it)
- this.$editor.find('div[style="text-align: -webkit-auto;"]').contents().unwrap();
-
- // Remove all styles in ul, ol, li
- this.$editor.find('ul, ol, li').removeAttr('style');
- },
-
-
- // TEXTAREA CODE FORMATTING
- cleanHtml: function(code)
- {
- var i = 0,
- codeLength = code.length,
- point = 0,
- start = null,
- end = null,
- tag = '',
- out = '',
- cont = '';
-
- this.cleanlevel = 0;
-
- for (; i < codeLength; i++)
- {
- point = i;
-
- // if no more tags, copy and exit
- if (-1 == code.substr(i).indexOf( '<' ))
- {
- out += code.substr(i);
-
- return this.cleanFinish(out);
- }
-
- // copy verbatim until a tag
- while (point < codeLength && code.charAt(point) != '<')
- {
- point++;
- }
-
- if (i != point)
- {
- cont = code.substr(i, point - i);
- if (!cont.match(/^\s{2,}$/g))
- {
- if ('\n' == out.charAt(out.length - 1)) out += this.cleanGetTabs();
- else if ('\n' == cont.charAt(0))
- {
- out += '\n' + this.cleanGetTabs();
- cont = cont.replace(/^\s+/, '');
- }
-
- out += cont;
- }
-
- if (cont.match(/\n/)) out += '\n' + this.cleanGetTabs();
- }
-
- start = point;
-
- // find the end of the tag
- while (point < codeLength && '>' != code.charAt(point))
- {
- point++;
- }
-
- tag = code.substr(start, point - start);
- i = point;
-
- var t;
-
- if ('!--' == tag.substr(1, 3))
- {
- if (!tag.match(/--$/))
- {
- while ('-->' != code.substr(point, 3))
- {
- point++;
- }
- point += 2;
- tag = code.substr(start, point - start);
- i = point;
- }
-
- if ('\n' != out.charAt(out.length - 1)) out += '\n';
-
- out += this.cleanGetTabs();
- out += tag + '>\n';
- }
- else if ('!' == tag[1])
- {
- out = this.placeTag(tag + '>', out);
- }
- else if ('?' == tag[1])
- {
- out += tag + '>\n';
- }
- else if (t = tag.match(/^<(script|style|pre)/i))
- {
- t[1] = t[1].toLowerCase();
- tag = this.cleanTag(tag);
- out = this.placeTag(tag, out);
- end = String(code.substr(i + 1)).toLowerCase().indexOf('' + t[1]);
-
- if (end)
- {
- cont = code.substr(i + 1, end);
- i += end;
- out += cont;
- }
- }
- else
- {
- tag = this.cleanTag(tag);
- out = this.placeTag(tag, out);
- }
- }
-
- return this.cleanFinish(out);
- },
- cleanGetTabs: function()
- {
- var s = '';
- for ( var j = 0; j < this.cleanlevel; j++ )
- {
- s += '\t';
- }
-
- return s;
- },
- cleanFinish: function(code)
- {
- code = code.replace(/\n\s*\n/g, '\n');
- code = code.replace(/^[\s\n]*/, '');
- code = code.replace(/[\s\n]*$/, '');
- code = code.replace(/');
-
- this.cleanlevel = 0;
-
- return code;
- },
- cleanTag: function (tag)
- {
- var tagout = '';
- tag = tag.replace(/\n/g, ' ');
- tag = tag.replace(/\s{2,}/g, ' ');
- tag = tag.replace(/^\s+|\s+$/g, ' ');
-
- var suffix = '';
- if (tag.match(/\/$/))
- {
- suffix = '/';
- tag = tag.replace(/\/+$/, '');
- }
-
- var m;
- while (m = /\s*([^= ]+)(?:=((['"']).*?\3|[^ ]+))?/.exec(tag))
- {
- if (m[2]) tagout += m[1].toLowerCase() + '=' + m[2];
- else if (m[1]) tagout += m[1].toLowerCase();
-
- tagout += ' ';
- tag = tag.substr(m[0].length);
- }
-
- return tagout.replace(/\s*$/, '') + suffix + '>';
- },
- placeTag: function (tag, out)
- {
- var nl = tag.match(this.cleannewLevel);
- if (tag.match(this.cleanlineBefore) || nl)
- {
- out = out.replace(/\s*$/, '');
- out += '\n';
- }
-
- if (nl && '/' == tag.charAt(1)) this.cleanlevel--;
- if ('\n' == out.charAt(out.length - 1)) out += this.cleanGetTabs();
- if (nl && '/' != tag.charAt(1)) this.cleanlevel++;
-
- out += tag;
-
- if (tag.match(this.cleanlineAfter) || tag.match(this.cleannewLevel))
- {
- out = out.replace(/ *$/, '');
- out += '\n';
- }
-
- return out;
- },
-
- // FORMAT
- formatEmpty: function(e)
- {
- var html = $.trim(this.$editor.html());
-
- if (this.opts.linebreaks)
- {
- if (html == '')
- {
- e.preventDefault();
- this.$editor.html('');
- this.focus();
- }
- }
- else
- {
- html = html.replace(/
/i, '');
- var thtml = html.replace(/
');
- }
- else return;
- }
- else
- {
- this.formatBlock(tag, node);
- }
- }
- else
- {
- this.formatBlock(tag, node);
- }
- }
-
- }, this));
-
- this.selectionRestore();
- this.sync();
- },
- formatBlock: function(tag, block)
- {
- if (block === false) block = this.getBlock();
- if (block === false && this.opts.linebreaks === true)
- {
- this.execCommand('formatblock', tag);
- return true;
- }
-
- var contents = '';
- if (tag !== 'pre')
- {
- contents = $(block).contents();
- }
- else
- {
- //contents = this.cleanEncodeEntities($(block).text());
- contents = $(block).html();
- if ($.trim(contents) === '')
- {
- contents = '';
- }
- }
-
- if (block.tagName === 'PRE') tag = 'p';
-
- if (this.opts.linebreaks === true && tag === 'p')
- {
- $(block).replaceWith($('
');
- }
- else
- {
- var parent = this.getParent();
-
- var node = $('<' + tag + '>').append(contents);
- $(block).replaceWith(node);
-
- if (parent && parent.tagName == 'TD')
- {
- $(node).wrapAll('');
- }
- }
- },
- formatChangeTag: function(fromElement, toTagName, save)
- {
- if (save !== false) this.selectionSave();
-
- var newElement = $('<' + toTagName + '/>');
- $(fromElement).replaceWith(function() { return newElement.append($(this).contents()); });
-
- if (save !== false) this.selectionRestore();
-
- return newElement;
- },
-
- // QUOTE
- formatQuote: function()
- {
- if (this.browser('mozilla') && this.isFocused())
- {
- this.$editor.focus();
- }
-
- this.bufferSet();
-
- // paragraphy
- if (this.opts.linebreaks === false)
- {
- this.selectionSave();
-
- var blocks = this.getBlocks();
-
- var blockquote = false;
- var blocksLen = blocks.length;
- if (blocks)
- {
- var data = '';
- var replaced = '';
- var replace = false;
- var paragraphsOnly = true;
-
- $.each(blocks, function(i,s)
- {
- if (s.tagName !== 'P') paragraphsOnly = false;
- });
-
- $.each(blocks, $.proxy(function(i,s)
- {
- if (s.tagName === 'BLOCKQUOTE')
- {
- this.formatBlock('p', s, false);
- }
- else if (s.tagName === 'P')
- {
- blockquote = $(s).parent();
- // from blockquote
- if (blockquote[0].tagName == 'BLOCKQUOTE')
- {
- var count = $(blockquote).children('p').size();
-
- // one
- if (count == 1)
- {
- $(blockquote).replaceWith(s);
- }
- // all
- else if (count == blocksLen)
- {
- replace = 'blockquote';
- data += this.outerHtml(s);
- }
- // some
- else
- {
- replace = 'html';
- data += this.outerHtml(s);
-
- if (i == 0)
- {
- $(s).addClass('redactor-replaced').empty();
- replaced = this.outerHtml(s);
- }
- else $(s).remove();
- }
- }
- // to blockquote
- else
- {
- if (paragraphsOnly === false || blocks.length == 1)
- {
- this.formatBlock('blockquote', s, false);
- }
- else
- {
- replace = 'paragraphs';
- data += this.outerHtml(s);
- }
- }
-
- }
- else if (s.tagName !== 'LI')
- {
- this.formatBlock('blockquote', s, false);
- }
-
- }, this));
-
- if (replace)
- {
- if (replace == 'paragraphs')
- {
- $(blocks[0]).replaceWith(' ' + data + '
');
- $(blocks).remove();
- }
- else if (replace == 'blockquote')
- {
- $(blockquote).replaceWith(data);
- }
- else if (replace == 'html')
- {
- var html = this.$editor.html().replace(replaced, '' + data + '');
-
- this.$editor.html(html);
- this.$editor.find('blockquote').each(function()
- {
- if ($.trim($(this).html()) == '') $(this).remove();
- })
- }
- }
- }
-
- this.selectionRestore();
- }
- // linebreaks
- else
- {
- var block = this.getBlock();
- if (block.tagName === 'BLOCKQUOTE')
- {
- this.selectionSave();
-
- var html = $.trim($(block).html());
- var selection = $.trim(this.getSelectionHtml());
-
- html = html.replace(//gi, '');
-
- if (html == selection)
- {
- $(block).replaceWith($(block).html() + '
' + this.opts.invisibleSpace + '' + selection + '
');
- }
- else
- {
- // replace
- this.inlineFormat('tmp');
- var tmp = this.$editor.find('tmp');
- tmp.empty();
-
- var newhtml = this.$editor.html().replace('');
-
- this.$editor.html(newhtml);
- tmp.remove();
- this.$editor.find('blockquote').each(function()
- {
- if ($.trim($(this).html()) == '') $(this).remove();
- })
- }
-
- this.selectionRestore();
- this.$editor.find('span#selection-marker-1').attr('id', false);
- }
- else
- {
- var wrapper = this.selectionWrap('blockquote');
- var html = $(wrapper).html();
-
- var blocksElemsRemove = ['ul', 'ol', 'table', 'tr', 'tbody', 'thead', 'tfoot', 'dl'];
- $.each(blocksElemsRemove, function(i,s)
- {
- html = html.replace(new RegExp('<' + s + '(.*?)>', 'gi'), '');
- html = html.replace(new RegExp('' + s + '>', 'gi'), '');
- });
-
- var blocksElems = this.opts.blockLevelElements;
- $.each(blocksElems, function(i,s)
- {
- html = html.replace(new RegExp('<' + s + '(.*?)>', 'gi'), '');
- html = html.replace(new RegExp('' + s + '>', 'gi'), '
');
- });
-
- $(wrapper).html(html);
- this.selectionElement(wrapper);
- var next = $(wrapper).next();
- if (next.size() != 0 && next[0].tagName === 'BR')
- {
- next.remove();
- }
- }
- }
-
- this.sync();
- },
-
- // BLOCK
- blockRemoveAttr: function(attr, value)
- {
- var nodes = this.getBlocks();
- $(nodes).removeAttr(attr);
-
- this.sync();
- },
- blockSetAttr: function(attr, value)
- {
- var nodes = this.getBlocks();
- $(nodes).attr(attr, value);
-
- this.sync();
- },
- blockRemoveStyle: function(rule)
- {
- var nodes = this.getBlocks();
- $(nodes).css(rule, '');
- this.removeEmptyAttr(nodes, 'style');
-
- this.sync();
- },
- blockSetStyle: function (rule, value)
- {
- var nodes = this.getBlocks();
- $(nodes).css(rule, value);
-
- this.sync();
- },
- blockRemoveClass: function(className)
- {
- var nodes = this.getBlocks();
- $(nodes).removeClass(className);
- this.removeEmptyAttr(nodes, 'class');
-
- this.sync();
- },
- blockSetClass: function(className)
- {
- var nodes = this.getBlocks();
- $(nodes).addClass(className);
-
- this.sync();
- },
-
- // INLINE
- inlineRemoveClass: function(className)
- {
- this.selectionSave();
-
- this.inlineEachNodes(function(node)
- {
- $(node).removeClass(className);
- this.removeEmptyAttr(node, 'class');
- });
-
- this.selectionRestore();
- this.sync();
- },
- inlineSetClass: function(className)
- {
- var current = this.getCurrent();
- if (!$(current).hasClass(className)) this.inlineMethods('addClass', className);
- },
- inlineRemoveStyle: function (rule)
- {
- this.selectionSave();
-
- this.inlineEachNodes(function(node)
- {
- $(node).css(rule, '');
- this.removeEmptyAttr(node, 'style');
- });
-
- this.selectionRestore();
- this.sync();
- },
- inlineSetStyle: function(rule, value)
- {
- this.inlineMethods('css', rule, value);
- },
- inlineRemoveAttr: function (attr)
- {
- this.selectionSave();
-
- var range = this.getRange(), node = this.getElement(), nodes = this.getNodes();
-
- if (range.collapsed || range.startContainer === range.endContainer && node)
- {
- nodes = $( node );
- }
-
- $(nodes).removeAttr(attr);
-
- this.inlineUnwrapSpan();
-
- this.selectionRestore();
- this.sync();
- },
- inlineSetAttr: function(attr, value)
- {
- this.inlineMethods('attr', attr, value );
- },
- inlineMethods: function(type, attr, value)
- {
- this.bufferSet();
- this.selectionSave();
-
- var range = this.getRange()
- var el = this.getElement();
-
- if ((range.collapsed || range.startContainer === range.endContainer) && el && !this.nodeTestBlocks(el))
- {
- $(el)[type](attr, value);
- }
- else
- {
- var cmd, arg = value;
- switch (attr)
- {
- case 'font-size':
- cmd = 'fontSize';
- arg = 4;
- break;
- case 'font-family':
- cmd = 'fontName';
- break;
- case 'color':
- cmd = 'foreColor';
- break;
- case 'background-color':
- cmd = 'backColor';
- break;
- }
-
- this.document.execCommand(cmd, false, arg);
-
- var fonts = this.$editor.find('font');
- $.each(fonts, $.proxy(function(i, s)
- {
- this.inlineSetMethods(type, s, attr, value);
-
- }, this));
-
- }
-
- this.selectionRestore();
- this.sync();
- },
- inlineSetMethods: function(type, s, attr, value)
- {
- var parent = $(s).parent(), el;
-
- var selectionHtml = this.getSelectionText();
- var parentHtml = $(parent).text();
- var selected = selectionHtml == parentHtml;
-
- if (selected && parent && parent[0].tagName === 'INLINE' && parent[0].attributes.length != 0)
- {
- el = parent;
- $(s).replaceWith($(s).html());
- }
- else
- {
- el = $('
');
- }
-
- // add text in a paragraph
- if (!this.opts.linebreaks && $html.contents().length == 1 && $html.contents()[0].nodeType == 3
- && (this.getRangeSelectedNodes().length > 2 || (!current || current.tagName == 'BODY' && !parent || parent.tagName == 'HTML')))
- {
- html = '
';
- if (twice == true)
- {
- br = '
';
- }
-
- if (this.browser('mozilla'))
- {
- var span = $('').html(this.opts.invisibleSpace);
- this.$editor.find('#selection-marker-1').before(br).before(span).before(this.opts.invisibleSpace);
-
- this.setCaretAfter(span[0]);
- span.remove();
-
- this.selectionRemoveMarkers();
- }
- else
- {
- var parent = this.getParent();
- if (parent && parent.tagName === 'A')
- {
- var offset = this.getCaretOffset(parent);
-
- var text = $.trim($(parent).text()).replace(/\n\r\n/g, '');
- var len = text.length;
-
- if (offset == len)
- {
- this.selectionRemoveMarkers();
-
- var node = $('' + this.opts.invisibleSpace + '', this.document)[0];
- $(parent).after(node);
- $(node).before(br + (this.browser('webkit') ? this.opts.invisibleSpace : ''));
- this.selectionRestore();
-
- return true;
- }
-
- }
-
- this.$editor.find('#selection-marker-1').before(br + (this.browser('webkit') ? this.opts.invisibleSpace : ''));
- this.selectionRestore();
- }
- },
- insertDoubleLineBreak: function()
- {
- this.insertLineBreak(true);
- },
- replaceLineBreak: function(element)
- {
- var node = $('
' + this.opts.invisibleSpace);
- $(element).replaceWith(node);
- this.selectionStart(node);
- },
-
- // PASTE
- pasteClean: function(html)
- {
- html = this.callback('pasteBefore', false, html);
-
- // ie10 fix paste links
- if (this.browser('msie'))
- {
- var tmp = $.trim(html);
- if (tmp.search(/^(.*?)<\/a>$/i) == 0)
- {
- html = html.replace(/^(.*?)<\/a>$/i, "$2");
- }
- }
-
- if (this.opts.pastePlainText)
- {
- var tmp = this.document.createElement('div');
-
- html = html.replace(/
|<\/H[1-6]>|<\/p>|<\/div>/gi, '\n');
-
- tmp.innerHTML = html;
- html = tmp.textContent || tmp.innerText;
-
- html = $.trim(html);
- html = html.replace('\n', '
');
- html = this.cleanParagraphy(html);
-
- this.pasteInsert(html);
- return false;
- }
-
- // clean up table
- var tablePaste = false;
- if (this.currentOrParentIs('TD'))
- {
- tablePaste = true;
- var blocksElems = this.opts.blockLevelElements;
- blocksElems.push('tr');
- blocksElems.push('table');
- $.each(blocksElems, function(i,s)
- {
- html = html.replace(new RegExp('<' + s + '(.*?)>', 'gi'), '');
- html = html.replace(new RegExp('' + s + '>', 'gi'), '
');
- });
- }
-
- // clean up pre
- if (this.currentOrParentIs('PRE'))
- {
- html = this.pastePre(html);
- this.pasteInsert(html);
- return true;
- }
-
- // ms words shapes
- html = html.replace(//gi, '');
-
- // ms word list
- html = html.replace(/
');
- // one line
- html = html.replace(/');
- // remove ms word's bullet
- html = html.replace(/·/g, '');
-
- // remove comments and php tags
- html = html.replace(/|<\?(?:php)?[\s\S]*?\?>/gi, '');
-
- // remove nbsp
- if (this.opts.cleanSpaces === true)
- {
- html = html.replace(/( ){2,}/gi, ' ');
- html = html.replace(/ /gi, ' ');
- }
-
- // remove google docs marker
- html = html.replace(/([\w\W]*?)<\/b>/gi, "$2");
- html = html.replace(/([\w\W]*?)<\/b>/gi, "$3");
-
-
- html = html.replace(/]*(font-style: italic; font-weight: bold|font-weight: bold; font-style: italic)[^>]*>/gi, '');
- html = html.replace(/]*font-style: italic[^>]*>/gi, '');
- html = html.replace(/]*font-weight: bold[^>]*>/gi, '');
- html = html.replace(/]*text-decoration: underline[^>]*>/gi, '');
-
- // strip tags
- //html = this.cleanStripTags(html);
-
-
-
- // prevert
- html = html.replace(/
\u200b*<\/td>/gi, '[td]');
- html = html.replace(/ <\/td>/gi, '[td]');
- html = html.replace(/
<\/td>/gi, '[td]');
- html = html.replace(/([\w\W]*?)<\/td>/gi, '[td colspan="$2"]$4[/td]');
- html = html.replace(/ ([\w\W]*?)<\/td>/gi, '[td rowspan="$2"]$4[/td]');
- html = html.replace(/([\w\W]*?)<\/a>/gi, '[a href="$2"]$4[/a]');
- html = html.replace(/ -->
in progress
@@ -131,15 +132,12 @@ PMA
No runs.
+ No runs.
-
-
diff --git a/src/directives/templates/mmsSpec.html b/src/directives/templates/mmsSpec.html
index e841a3b78..705bb54fe 100644
--- a/src/directives/templates/mmsSpec.html
+++ b/src/directives/templates/mmsSpec.html
@@ -1,24 +1,24 @@
LAST MODIFICATION
- {{element._modified | date:'M/d/yy h:mm a'}} by {{element._modifier}}
+ Last Modification
+ {{element._modified | date:'M/d/yy h:mm a'}} by {{element._modifier}}
PROPERTY VALUE
+ Property Value
PROPERTY VALUE
PROPERTY VALUE
CONSTRAINT SPECIFICATION
+ Constraint Specification
CONSTRAINT SPECIFICATION
DOCUMENTATION
+ Documentation
TYPE
- {{element.type}}
- METATYPES
-
- LOCATION
- {{element._qualifiedName}}
+ Type
+ {{element.type}}
+ Metatypes
+ Location
+ {{element._qualifiedName}}
ID
- {{element.id}}
- BRANCH/TAG
- {{element._refId}}
- PROJECT
- {{element._projectId}}
- FORMATTED MODIFIED TIME
- {{element._modified}}
- COMMIT
- {{element._commitId}}
+ {{element.id}}
+ Branch/Tag
+ {{element._refId}}
+ Project
+ {{element._projectId}}
+ Formatted Modified Time
+ {{element._modified}}
+ Commit
+ {{element._commitId}}
+
{{element.name}}
- LAST MODIFICATION
- {{element._modified | date:'M/d/yy h:mm a'}} by {{element._modifier}}
+ Last Modification
+ {{element._modified | date:'M/d/yy h:mm a'}} by {{element._modifier}}
PROPERTY VALUE
- Property Value
{{value.value}}
- {{value.value}}
- {{value.value}}
- {{value.value}}
-
-
-
- {{value.body[0]}}
- {{value}}
-
+ {{value.value}}
+ {{value.value}}
+ {{value.value}}
+ {{value.value}}
+
+ PROPERTY TYPE
-
+ Property Type
+ SOURCE
-
- TARGET
-
+ Source
+ Target
+ PATH 1
-
- PATH 2
-
+ Path 1
+ Path 2
+ ROLE 1
-
- ROLE 2
-
+ Role 1
+ Role 2
+ CONSTRAINT SPECIFICATION
+ Constraint Specification
{{values[0].value}}
- {{values[0].value}}
- {{values[0].value}}
- {{values[0].value}}
-
-
- {{values[0].body[0]}}
- {{values}}
+ {{values[0].value}}
+ {{values[0].value}}
+ {{values[0].value}}
+ {{values[0].value}}
+
+ CLASSIFIERS
-
+ Classifiers
+ DOCUMENTATION
+ Documentation
TYPE
- {{element.type}}
- METATYPES
-
- LOCATION
- {{element._qualifiedName}}
+ Type
+ {{element.type}}
+ Metatypes
+ Location
+ {{element._qualifiedName}}
ID
- {{element.id}}
- BRANCH/TAG
- {{element._refId}}
- PROJECT
- {{element._projectId}}
- FORMATTED MODIFIED TIME
- {{element._modified}}
- COMMIT
- {{element._commitId}}
+ {{element.id}}
+ Branch/Tag
+ {{element._refId}}
+ Project
+ {{element._projectId}}
+ Formatted Modified Time
+ {{element._modified}}
+ Commit
+ {{element._commitId}}
Name
Value : {{element.name}}
Value : {{element.name}}
+
Reorder contents
+
diff --git a/src/directives/templates/revertConfirm.html b/src/directives/templates/revertConfirm.html
new file mode 100644
index 000000000..befa06cb2
--- /dev/null
+++ b/src/directives/templates/revertConfirm.html
@@ -0,0 +1,23 @@
+
Revert Element Documentation, Name, and Value
+Preview Element
+