Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css?rev=1178141&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css Sun Oct 2 08:06:49 2011 @@ -0,0 +1,301 @@ +/* конÑÐµÐ¹Ð½ÐµÑ */ +.el-rte { + font-family: Trebuchet MS, Verdana, Geneva,sans-serif; + overflow:hidden; +/* border:1px solid #aaa;*/ +} +.el-rte.el-fullscreen { + position:absolute; + width:99%; +/* height:100%;*/ + top:0; + left:0; + margin:0; + z-index:10; +} + +.elrte-swf-placeholder { + width:1px; + background: url('../images/swf.png') 0 0 no-repeat; +} + +/* style to detect images url */ +/*.el-rte */ +.elrtetesturl { color:red; background-image:url(../images/pixel.gif);} + +/* Ð¿Ð°Ð½ÐµÐ»Ñ Ð¸Ð½ÑÑÑÑменÑов */ +.el-rte .toolbar { background-color:#eee; padding:3px 7px 2px 7px; border:1px solid #ccc; white-space:normal; } + +.el-rte-rtl .toolbar { direction: rtl; } + +/* Ð¿Ð°Ð½ÐµÐ»Ñ ÐºÐ½Ð¾Ð¿Ð¾Ðº */ +.el-rte .toolbar ul { + position:relative; + display:inline-block; + display: -moz-inline-stack; + display: inline-block; + vertical-align: top; + zoom: 1; + *display: inline; + margin:0; + list-style:none; + padding:0 2px 0 5px; + background: url('../images/elrte-toolbar.png') -934px -2px no-repeat; +} +/* пеÑÐ²Ð°Ñ Ð¿Ð°Ð½ÐµÐ»Ñ ÐºÐ½Ð¾Ð¿Ð¾Ðº */ +.el-rte .toolbar ul.first { + background:transparent; + padding-left:0; +} +/* кнопка */ +.el-rte .toolbar ul li { + display:inline-block; + display: -moz-inline-stack; + display: inline-block; + height:22px; + width:22px; + vertical-align: top; + zoom: 1; + *display: inline; + margin:1px 1px; + padding:0; /* Joomla 1.6 compat */ + background:url('../images/elrte-toolbar.png') no-repeat; + border:1px solid #ccc; + z-index:100; + +} +/* акÑÐ¸Ð²Ð½Ð°Ñ Ð¸ подÑвеÑÐµÐ½Ð½Ð°Ñ Ð¸ неакÑÐ¸Ð²Ð½Ð°Ñ ÐºÐ½Ð¾Ð¿ÐºÐ° */ +.el-rte .toolbar ul li.hover { border:1px solid #54b9bf; } +.el-rte .toolbar ul li.active { background-color:#c3dbef; border:1px solid #fff; } +.el-rte .toolbar ul li.disabled { opacity:alpha(0.3); opacity: 0.3; filter:Alpha(Opacity=30);} +/* кнопки */ +.el-rte .toolbar ul li.about {background-position:-829px -5px;} +.el-rte .toolbar ul li.save {background-position:-30px -2px;} +.el-rte .toolbar ul li.new {background-position:-55px -2px} +.el-rte .toolbar ul li.copy {background-position:-78px -2px} +.el-rte .toolbar ul li.css {background-position:-801px -5px} +.el-rte .toolbar ul li.cut {background-position:-104px -2px} +.el-rte .toolbar ul li.paste {background-position:-128px -2px} +.el-rte .toolbar ul li.pastetext {background-position:-534px -2px} +.el-rte .toolbar ul li.pasteformattext {background-position:-154px -2px} +.el-rte .toolbar ul li.removeformat {background-position:-180px -2px} +.el-rte .toolbar ul li.docstructure {background-position:-712px -4px} +.el-rte .toolbar ul li.undo {background-position:-205px -2px} +.el-rte .toolbar ul li.redo {background-position:-230px -2px} +.el-rte .toolbar ul li.bold {background-position:-252px -2px; } +.el-rte .toolbar ul li.italic {background-position:-270px -2px;} +.el-rte .toolbar ul li.underline {background-position:-290px -2px; } +.el-rte .toolbar ul li.strikethrough {background-position:-149px -29px} +.el-rte .toolbar ul li.subscript {background-position:-54px -29px} +.el-rte .toolbar ul li.superscript {background-position:-76px -29px} +.el-rte .toolbar ul li.justifyleft {background-position:-311px -2px} +.el-rte .toolbar ul li.justifycenter {background-position:-335px -2px} +.el-rte .toolbar ul li.justifyright {background-position:-360px -2px} +.el-rte .toolbar ul li.justifyfull {background-position:-174px -29px} +.el-rte .toolbar ul li.insertunorderedlist {background-position:-100px -29px} +.el-rte .toolbar ul li.insertorderedlist {background-position:-124px -29px} +.el-rte .toolbar ul li.outdent {background-position:-6px -29px} +.el-rte .toolbar ul li.indent {background-position:-32px -29px} +.el-rte .toolbar ul li.blockquote {background-position:-220px -30px} +.el-rte .toolbar ul li.div {background-position:-655px -29px} +.el-rte .toolbar ul li.stopfloat {background-position:-771px -5px} +.el-rte .toolbar ul li.nbsp {background-position:-580px -2px} +.el-rte .toolbar ul li.forecolor {background-position:-372px -30px} +.el-rte .toolbar ul li.hilitecolor {background-position:-395px -30px} +.el-rte .toolbar ul li.link {background-position:-244px -29px} +.el-rte .toolbar ul li.unlink {background-position:-270px -29px} +.el-rte .toolbar ul li.anchor {background-position:-296px -30px} +.el-rte .toolbar ul li.image {background-position:-384px -2px} +.el-rte .toolbar ul li.flash {background-position:-410px -2px} +.el-rte .toolbar ul li.file {background-position:-436px -3px} +.el-rte .toolbar ul li.table {background-position:-421px -30px} +.el-rte .toolbar ul li.tableprops {background-position:-602px -29px} +.el-rte .toolbar ul li.tbcellprops {background-position:-806px -27px} +.el-rte .toolbar ul li.tablerm {background-position:-461px -2px} +.el-rte .toolbar ul li.tbrowbefore {background-position:-683px -4px} +.el-rte .toolbar ul li.tbrowafter {background-position:-654px -4px} +.el-rte .toolbar ul li.tbrowrm {background-position:-500px -30px} +.el-rte .toolbar ul li.tbcolbefore {background-position:-741px -27px} +.el-rte .toolbar ul li.tbcolafter {background-position:-772px -27px} +.el-rte .toolbar ul li.tbcolrm {background-position:-526px -30px} +.el-rte .toolbar ul li.tbcellsmerge {background-position:-552px -30px} +.el-rte .toolbar ul li.tbcellsplit {background-position:-629px -29px} +.el-rte .toolbar ul li.smiley {background-position:-322px -29px} +.el-rte .toolbar ul li.spec-text {background-position:-487px -2px} +.el-rte .toolbar ul li.print {background-position:-509px -2px} +.el-rte .toolbar ul li.horizontalrule {background-position:-199px -29px} +.el-rte .toolbar ul li.fullscreen {background-position:-348px -30px} +.el-rte .toolbar ul li.elfinder {background-position:-436px -2px} +.el-rte .toolbar ul li.ltr {background-position:-855px -27px} +.el-rte .toolbar ul li.rtl {background-position:-855px -3px} +.el-rte .toolbar ul li.pagebreak {background-position:-711px -28px} + + +/* ÑабоÑÐ°Ñ Ð·Ð¾Ð½Ð° (обеÑÑка над iframe) */ +.el-rte .workzone { border:1px solid #eee; border-top:none; height:400px; overflow:hidden; } +.el-rte.small .workzone { min-height:250px; } + +/* source code */ +.el-rte textarea { width:100%; height:100%; border:none; zoom:1; padding:0; outline:none; } +.el-rte.small textarea { min-height:250px;} +/* ÑедакÑÐ¾Ñ */ +.el-rte iframe { + width: 100%; + height:400px; + display:block; + outline:none; + border:0 solid; + padding:0; + margin:0; + background:#fff; + +} +.el-rte.small iframe { min-height:250px;} + +/* Ð¿Ð°Ð½ÐµÐ»Ñ ÑÑаÑÑÑа (пÑÑÑ) */ +.el-rte .statusbar { + height: 21px; + padding: 0 9px; + font: 11px/21px 'monaco', 'andale mono', 'lucida console', monospace; + background-color:#eee; + border-top:1px solid #ccc; + border-top:none; +} + +.el-rte-rtl .statusbar { + direction:rtl; +/* text-align:right;*/ +} + +/* ÑÐ°Ð±Ñ */ +.el-rte .tabsbar { display: block; } +.el-rte .tabsbar .tab { + float:left; + margin-right:2px; + padding: 6px 17px; + font-size: .82em; + font-weight:bold; + color:#777; + text-align:center; + border:1px solid #eee; + border-top:none; + background: #fff; + cursor: default; +} +.el-rte .tabsbar div.active { background: #eee; color:#444; } +.el-rte-rtl .tabsbar .tab { float:right; } + +/* вÑпадаÑÑие Ð¼ÐµÐ½Ñ */ +/* container for elselect */ +.el-rte .toolbar ul li.el-select { + height:22px; + width : 120px; + border:1px solid #ccc; + font-size:.82em; + cursor: default; + background-position:-475px -30px; +} + +.el-rte .toolbar ul li.el-select.hover { + background-color:#fefefe; +} + +.el-rte .toolbar ul li.el-select label { + height:19px; + padding: 3px 5px 0 5px; + float:none; /* Joomla 1.6 compat */ + width:96px; /* Joomla 1.6 compat */ +} + +/* textarea & iframe в Ð´Ð¸Ð¿Ð»Ð¾Ð³Ð°Ñ Ð²ÑÑавки ÑекÑÑа */ +.el-rte-paste-input { + width : 99%; + height: 250px; + border: 1px solid #ccc; + padding:0; + margin:0; + outline:none; +} +/* индикаÑÐ¾Ñ Ð²ÑбÑаного ÑвеÑа на кнопке */ +.el-rte .toolbar ul li div.color-indicator { + width:18px; + height:4px; + margin:16px 0 2px 2px; + background-color: #000; +} +.el-rte-rtl .toolbar ul li div.color-indicator { + margin:16px 2px 2px 0; +} +.el-rte .toolbar .panel-format { z-index: 10; } + +/* colors palette */ +.el-palette { top:20px; } + +.el-dialogform, .el-dialogform td { font-size:.9em; } +.el-dialogform select { font-size:.9em;} +.ui-dialog .ui-dialog-buttonpane { padding: .4em, 1em;} +.ui-dialog .ui-dialog-buttonpane button { margin: .3em .4em .1em 0; font-size:.9em;} +.ui-dialog .ui-dialog-titlebar { padding: .3em 1em .3em; } +/*.ui-dialog-buttonset { padding:0; background-color:#333;}*/ +/* диалоговÑе окна */ +.el-dialogform label { display:block; } +.el-dialogform label input { margin-right:2px; } +.el-dialogform iframe.el-rte-preview { + width : 100%; + height : 235px; + margin:0; + padding:0; + outline:none; + border:none; +} +.el-dialogform fieldset { + border:1px solid #ccc; + padding : 0; +} +.el-dialogform fieldset legend { + font-size:.9em; + padding: .1em .5em; + margin: 0 0 5px 1em; + border:1px solid #ccc; + background-color: #eee; +} +.el-dialogform p { padding:.2em .3em;} +.el-dialogform h3 { color:#555; padding:1.2em 0 0 0; margin:0; font-size:1.2em; } +.el-dialogform h4 { color:#555;font-size:1em; padding:0; margin: 3px 9px; } + +.elrte-logo { + width:48px; + height:46px; + float:left; + margin:.5em 1em; + background:url('../images/elrte-toolbar.png') -880px -7px no-repeat; +} +.elrte-ver { font-size:.9em; padding-left:.7em; } +.elrte-copy { font-size:.9em; padding-left:.3em; } +table.elrte-authors { margin-bottom:1em; } +table.elrte-authors td { border-bottom:1px solid #eee; } + +/* widgets */ +.el-borderselect {} +.el-borderselect table { margin:0; } +.el-borderselect table td { padding : 0 2px 0 0; vertical-align:middle; } +.el-borderselect input { margin:0; border:1px solid #ccc; } + +.el-paddinginput { display: block; white-space: nowrap; } +.el-paddinginput input { margin :0 1px 0 0; border:1px solid #ccc; } +.el-paddinginput select { padding:0; } + +.el-rte-smiley { margin:5px; } + +.elrte-image-src-fm .ui-state-default { + float:right; +} +.el-dialogform-rtl .elrte-image-src-fm .ui-state-default { float:left;} + +.elrte-image-preview { + font-size:.7em; + overflow:auto; + height:240px; + width:480px; +} + Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/elrte.css ------------------------------------------------------------------------------ svn:mime-type = text/css Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css?rev=1178141&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css Sun Oct 2 08:06:49 2011 @@ -0,0 +1 @@ +.elrte-MYTAG { width: 200px; height: 20px; background: pink; border: 1px solid red; } Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/css/inner-example.css ------------------------------------------------------------------------------ svn:mime-type = text/css Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/ ------------------------------------------------------------------------------ bugtraq:number = true Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/elrte-toolbar.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/elrte-toolbar.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/elrte-toolbar.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/google-maps.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/google-maps.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/google-maps.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/iframe.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/iframe.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/iframe.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-director.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-director.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-director.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-flash.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-flash.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-flash.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-quicktime.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-quicktime.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-quicktime.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-realaudio.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-realaudio.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-realaudio.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-rutube.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-rutube.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-rutube.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-vimeo.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-vimeo.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-vimeo.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-winmedia.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-winmedia.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-winmedia.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-youtube.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-youtube.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/media-youtube.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-div.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-div.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-div.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-p.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-p.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/outline-p.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pagebreak.gif URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pagebreak.gif?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pagebreak.gif ------------------------------------------------------------------------------ svn:mime-type = image/gif Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pixel.gif URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pixel.gif?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/pixel.gif ------------------------------------------------------------------------------ svn:mime-type = image/gif Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/ ------------------------------------------------------------------------------ bugtraq:number = true Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/evilgrin.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/evilgrin.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/evilgrin.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/grin.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/grin.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/grin.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/happy.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/happy.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/happy.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/smile.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/smile.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/smile.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/surprised.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/surprised.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/surprised.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/tongue.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/tongue.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/tongue.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/unhappy.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/unhappy.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/unhappy.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/waii.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/waii.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/waii.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/wink.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/wink.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/smileys/wink.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/yandex-maps.png URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/yandex-maps.png?rev=1178141&view=auto ============================================================================== Binary file - no diff available. Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/images/yandex-maps.png ------------------------------------------------------------------------------ svn:mime-type = image/png Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/ ------------------------------------------------------------------------------ bugtraq:number = true Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js?rev=1178141&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js Sun Oct 2 08:06:49 2011 @@ -0,0 +1,675 @@ +/* + * DOM utilites for elRTE + * + * @author: Dmitry Levashov (dio) [hidden email] + */ +(function($) { +elRTE.prototype.dom = function(rte) { + this.rte = rte; + var self = this; + this.regExp = { + textNodes : /^(A|ABBR|ACRONYM|ADDRESS|B|BDO|BIG|BLOCKQUOTE|CAPTION|CENTER|CITE|CODE|DD|DEL|DFN|DIV|DT|EM|FIELDSET|FONT|H[1-6]|I|INS|KBD|LABEL|LEGEND|LI|MARQUEE|NOBR|NOEMBED|P|PRE|Q|SAMP|SMALL|SPAN|STRIKE|STRONG|SUB|SUP|TD|TH|TT|VAR)$/, + textContainsNodes : /^(A|ABBR|ACRONYM|ADDRESS|B|BDO|BIG|BLOCKQUOTE|CAPTION|CENTER|CITE|CODE|DD|DEL|DFN|DIV|DL|DT|EM|FIELDSET|FONT|H[1-6]|I|INS|KBD|LABEL|LEGEND|LI|MARQUEE|NOBR|NOEMBED|OL|P|PRE|Q|SAMP|SMALL|SPAN|STRIKE|STRONG|SUB|SUP|TABLE|THEAD|TBODY|TFOOT|TD|TH|TR|TT|UL|VAR)$/, + block : /^(APPLET|BLOCKQUOTE|BR|CAPTION|CENTER|COL|COLGROUP|DD|DIV|DL|DT|H[1-6]|EMBED|FIELDSET|LI|MARQUEE|NOBR|OBJECT|OL|P|PRE|TABLE|THEAD|TBODY|TFOOT|TD|TH|TR|UL)$/, + selectionBlock : /^(APPLET|BLOCKQUOTE|BR|CAPTION|CENTER|COL|COLGROUP|DD|DIV|DL|DT|H[1-6]|EMBED|FIELDSET|LI|MARQUEE|NOBR|OBJECT|OL|P|PRE|TD|TH|TR|UL)$/, + header : /^H[1-6]$/, + formElement : /^(FORM|INPUT|HIDDEN|TEXTAREA|SELECT|BUTTON)$/ + }; + + /********************************************************/ + /* УÑилиÑÑ */ + /********************************************************/ + + /** + * ÐозвÑаÑÐ°ÐµÑ body ÑедакÑиÑÑемого докÑменÑа + * + * @return Element + **/ + this.root = function() { + return this.rte.body; + } + + this.create = function(t) { + return this.rte.doc.createElement(t); + } + + /** + * Return node for bookmark with unique ID + * + * @return DOMElement + **/ + this.createBookmark = function() { + var b = this.rte.doc.createElement('span'); + b.id = 'elrte-bm-'+Math.random().toString().substr(2); + $(b).addClass('elrtebm elrte-protected'); + return b; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¸Ð½Ð´ÐµÐºÑ ÑлеменÑа внÑÑÑи ÑодиÑÐµÐ»Ñ + * + * @param Element n нода + * @return integer + **/ + this.indexOf = function(n) { + var ndx = 0; + n = $(n); + while ((n = n.prev()) && n.length) { + ndx++; + } + return ndx; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð·Ð½Ð°Ñение аÑÑÑибÑÑа в нижнем ÑегиÑÑÑе (Ð¾Ñ Ñж ÑÑÐ¾Ñ IE) + * + * @param Element n нода + * @param String attr Ð¸Ð¼Ñ Ð°ÑÑÑибÑÑа + * @return string + **/ + this.attr = function(n, attr) { + var v = ''; + if (n.nodeType == 1) { + v = $(n).attr(attr); + if (v && attr != 'src' && attr != 'href' && attr != 'title' && attr != 'alt') { + v = v.toString().toLowerCase(); + } + } + return v||''; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð±Ð»Ð¸Ð¶Ð°Ð¹Ñий обÑий конÑÐµÐ¹Ð½ÐµÑ Ð´Ð»Ñ 2-Ñ Ñл-Ñов + * + * @param Element n нода1 + * @param Element n нода2 + * @return Element + **/ + this.findCommonAncestor = function(n1, n2) { + if (!n1 || !n2) { + return this.rte.log('dom.findCommonAncestor invalid arguments'); + } + if (n1 == n2) { + return n1; + } else if (n1.nodeName == 'BODY' || n2.nodeName == 'BODY') { + return this.rte.doc.body; + } + var p1 = $(n1).parents(), p2 = $(n2).parents(), l = p2.length-1, c = p2[l]; + for (var i = p1.length - 1; i >= 0; i--, l--){ + if (p1[i] == p2[l]) { + c = p1[i]; + } else { + break; + } + }; + return c; + } + /** + * ÐовÑаÑÐ°ÐµÑ TRUE, еÑли нода пÑÑÑÐ°Ñ + * пÑÑÑой ÑÑиÑаем нодÑ: + * - ÑекÑÑовÑе Ñл-ÑÑ, ÑодеÑжаÑие пÑÑÑÑÑ ÑÑÑÐ¾ÐºÑ Ð¸Ð»Ð¸ Ñег br + * - ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ñ Ð¿ÑÑÑой ÑÑÑокой + * + * @param DOMElement n нода + * @return bool + **/ + this.isEmpty = function(n) { + if (n.nodeType == 1) { + return this.regExp.textNodes.test(n.nodeName) ? $.trim($(n).text()).length == 0 : false; + } else if (n.nodeType == 3) { + return /^(TABLE|THEAD|TFOOT|TBODY|TR|UL|OL|DL)$/.test(n.parentNode.nodeName) + || n.nodeValue == '' + || ($.trim(n.nodeValue).length== 0 && !(n.nextSibling && n.previousSibling && n.nextSibling.nodeType==1 && n.previousSibling.nodeType==1 && !this.regExp.block.test(n.nextSibling.nodeName) && !this.regExp.block.test(n.previousSibling.nodeName) )); + } + return true; + } + + /********************************************************/ + /* ÐеÑемеÑение по DOM */ + /********************************************************/ + + /** + * ÐовÑаÑÐ°ÐµÑ ÑледÑÑÑÑÑ ÑоÑеднÑÑ Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return DOMElement + **/ + this.next = function(n) { + while (n.nextSibling && (n = n.nextSibling)) { + if (n.nodeType == 1 || (n.nodeType == 3 && !this.isEmpty(n))) { + return n; + } + } + return null; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¿ÑедÑдÑÑÑÑÑ ÑоÑеднÑÑ Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return DOMElement + **/ + this.prev = function(n) { + while (n.previousSibling && (n = n.previousSibling)) { + if (n.nodeType == 1 || (n.nodeType ==3 && !this.isEmpty(n))) { + return n; + } + } + return null; + } + + this.isPrev = function(n, prev) { + while ((n = this.prev(n))) { + if (n == prev) { + return true; + } + } + return false; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð²Ñе ÑледÑÑÑие ÑоÑеднии Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return Array + **/ + this.nextAll = function(n) { + var ret = []; + while ((n = this.next(n))) { + ret.push(n); + } + return ret; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð²Ñе пÑедÑдÑÑÑие ÑоÑеднии Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return Array + **/ + this.prevAll = function(n) { + var ret = []; + while ((n = this.prev(n))) { + ret.push(n); + } + return ret; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð²Ñе ÑледÑÑÑие ÑоÑеднии inline Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return Array + **/ + this.toLineEnd = function(n) { + var ret = []; + while ((n = this.next(n)) && n.nodeName != 'BR' && n.nodeName != 'HR' && this.isInline(n)) { + ret.push(n); + } + return ret; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð²Ñе пÑедÑдÑÑÑие ÑоÑеднии inline Ð½Ð¾Ð´Ñ (не вклÑÑаÑÑÑÑ ÑекÑÑовÑе Ð½Ð¾Ð´Ñ Ð½Ðµ ÑоздаÑÑие знаÑимÑе пÑÐ¾Ð±ÐµÐ»Ñ Ð¼ÐµÐ¶Ð´Ñ Ð¸Ð½Ð»Ð°Ð¹Ð½ ÑлеменÑами) + * + * @param DOMElement n нода + * @return Array + **/ + this.toLineStart = function(n) { + var ret = []; + while ((n = this.prev(n)) && n.nodeName != 'BR' && n.nodeName != 'HR' && this.isInline(n) ) { + ret.unshift(n); + } + return ret; + } + + /** + * ÐовÑаÑÐ°ÐµÑ TRUE, еÑли нода - пеÑвÑй непÑÑÑой Ñл-Ñ Ð²Ð½ÑÑÑи ÑодиÑÐµÐ»Ñ + * + * @param Element n нода + * @return bool + **/ + this.isFirstNotEmpty = function(n) { + while ((n = this.prev(n))) { + if (n.nodeType == 1 || (n.nodeType == 3 && $.trim(n.nodeValue)!='' ) ) { + return false; + } + } + return true; + } + + /** + * ÐовÑаÑÐ°ÐµÑ TRUE, еÑли нода - поÑледний непÑÑÑой Ñл-Ñ Ð²Ð½ÑÑÑи ÑодиÑÐµÐ»Ñ + * + * @param Element n нода + * @return bool + **/ + this.isLastNotEmpty = function(n) { + while ((n = this.next(n))) { + if (!this.isEmpty(n)) { + return false; + } + } + return true; + } + + /** + * ÐовÑаÑÐ°ÐµÑ TRUE, еÑли нода - единÑÑвеннÑй непÑÑÑой Ñл-Ñ Ð²Ð½ÑÑÑи ÑодиÑÐµÐ»Ñ + * + * @param DOMElement n нода + * @return bool + **/ + this.isOnlyNotEmpty = function(n) { + return this.isFirstNotEmpty(n) && this.isLastNotEmpty(n); + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¿Ð¾Ñледний непÑÑÑой доÑеÑний Ñл-Ñ Ð½Ð¾Ð´Ñ Ð¸Ð»Ð¸ FALSE + * + * @param Element n нода + * @return Element + **/ + this.findLastNotEmpty = function(n) { + this.rte.log('findLastNotEmpty Who is here 0_o'); + if (n.nodeType == 1 && (l = n.lastChild)) { + if (!this.isEmpty(l)) { + return l; + } + while (l.previousSibling && (l = l.previousSibling)) { + if (!this.isEmpty(l)) { + return l; + } + } + } + return false; + } + + /** + * ÐозвÑаÑÐ°ÐµÑ TRUE, еÑли нода "inline" + * + * @param DOMElement n нода + * @return bool + **/ + this.isInline = function(n) { + if (n.nodeType == 3) { + return true; + } else if (n.nodeType == 1) { + n = $(n); + var d = n.css('display'); + var f = n.css('float'); + return d == 'inline' || d == 'inline-block' || f == 'left' || f == 'right'; + } + return true; + } + + + /********************************************************/ + /* ÐоиÑк ÑлеменÑов */ + /********************************************************/ + + this.is = function(n, f) { + if (n && n.nodeName) { + + if (typeof(f) == 'string') { + f = this.regExp[f]||/.?/; + } + + if (f instanceof RegExp && n.nodeName) { + return f.test(n.nodeName); + } else if (typeof(f) == 'function') { + return f(n); + } + } + + return false; + } + + /** + * ÐовÑаÑÐ°ÐµÑ ÑлеменÑ(Ñ) оÑвеÑаÑÑие ÑÑловиÑм поиÑка + * + * @param DOMElement||Array n нода + * @param RegExp||String filter ÑилÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ Ð¿Ð¾Ð¸Ñка (RegExp или Ð¸Ð¼Ñ ÐºÐ»ÑÑа this.regExp или *) + * @return DOMElement||Array + **/ + this.filter = function(n, filter) { + var ret = [], i; + if (!n.push) { + return this.is(n, filter) ? n : null; + } + for (i=0; i < n.length; i++) { + if (this.is(n[i], filter)) { + ret.push(n[i]); + } + }; + return ret; + } + + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¼Ð°ÑÑив ÑодиÑелÑÑÐºÐ¸Ñ ÑлеменÑов, оÑвеÑаÑÑÐ¸Ñ ÑÑловиÑм поиÑка + * + * @param DOMElement n нода, ÑодиÑелей, коÑоÑой иÑем + * @param RegExp||String filter ÑилÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ Ð¿Ð¾Ð¸Ñка (RegExp или Ð¸Ð¼Ñ ÐºÐ»ÑÑа this.regExp или *) + * @return Array + **/ + this.parents = function(n, filter) { + var ret = []; + + while (n && (n = n.parentNode) && n.nodeName != 'BODY' && n.nodeName != 'HTML') { + if (this.is(n, filter)) { + ret.push(n); + } + } + return ret; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð±Ð»Ð¸Ð¶Ð°Ð¹Ñий ÑодиÑелÑÑкий Ñл-Ñ, оÑвеÑаÑÑий ÑÑловиÑм поиÑка + * + * @param DOMElement n нода, ÑодиÑелÑ, коÑоÑой иÑем + * @param RegExp||String f ÑилÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ Ð¿Ð¾Ð¸Ñка (RegExp или Ð¸Ð¼Ñ ÐºÐ»ÑÑа this.regExp или *) + * @return DOMElement + **/ + this.parent = function(n, f) { + return this.parents(n, f)[0] || null; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¸Ð»Ð¸ ÑÐ°Ð¼Ñ Ð½Ð¾Ð´Ñ Ð¸Ð»Ð¸ ее ближайÑего ÑодиÑелÑ, еÑли вÑполнÑÑÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ sf Ð´Ð»Ñ Ñамой Ð½Ð¾Ð´Ñ Ð¸Ð»Ð¸ pf Ð´Ð»Ñ ÑодиÑÐµÐ»Ñ + * + * @param DOMElement n нода, ÑодиÑелÑ, коÑоÑой иÑем + * @param RegExp||String sf ÑилÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ Ð´Ð»Ñ Ñамой Ð½Ð¾Ð´Ñ + * @param RegExp||String pf ÑилÑÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ñ Ð´Ð»Ñ ÑодиÑÐµÐ»Ñ + * @return DOMElement + **/ + this.selfOrParent = function(n, sf, pf) { + return this.is(n, sf) ? n : this.parent(n, pf||sf); + } + + /** + * ÐовÑаÑÐ°ÐµÑ ÑодиÑелÑÑкÑÑ Ð½Ð¾Ð´Ñ - ÑÑÑÐ»ÐºÑ + * + * @param Element n нода + * @return Element + **/ + this.selfOrParentLink = function(n) { + n = this.selfOrParent(n, /^A$/); + return n && n.href ? n : null; + } + + /** + * ÐовÑаÑÐ°ÐµÑ TRUE, еÑли нода - anchor + * + * @param Element n нода + * @return bool + **/ + this.selfOrParentAnchor = function(n) { + n = this.selfOrParent(n, /^A$/); + return n && !n.href && n.name ? n : null; + } + + /** + * ÐовÑаÑÐ°ÐµÑ Ð¼Ð°ÑÑив доÑеÑÐ½Ð¸Ñ ÑÑÑлок + * + * @param DOMElement n нода + * @return Array + **/ + this.childLinks = function(n) { + var res = []; + $('a[href]', n).each(function() { res.push(this); }); + return res; + } + + this.selectionHas = function(f) { + var n = this.rte.selection.cloneContents(), i; + if (n && n.childNodes && n.childNodes.length) { + for (i=0; i < n.childNodes.length; i++) { + if (typeof(f) == 'function') { + if (f(n.childNodes[i])) { + return true; + } + } else if (n instanceof RegExp) { + if (f.test(n.childNodes[i].nodeName)) { + return true; + } + } + }; + } + + return false; + } + /********************************************************/ + /* ÐÐ·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ DOM */ + /********************************************************/ + + /** + * ÐбоÑаÑÐ¸Ð²Ð°ÐµÑ Ð¾Ð´Ð½Ñ Ð½Ð¾Ð´Ñ Ð´ÑÑгой + * + * @param DOMElement n обоÑаÑÐ¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð½Ð¾Ð´Ð° + * @param DOMElement w нода обеÑÑка или Ð¸Ð¼Ñ Ñега + * @return DOMElement + **/ + this.wrap = function(n, w) { + n = $.isArray(n) ? n : [n]; + w = w.nodeName ? w : this.create(w); + + if (n[0] && n[0].nodeType && n[0].parentNode) { + w = n[0].parentNode.insertBefore(w, n[0]); + $(n).each(function() { + if (this!=w) { + w.appendChild(this); + } + }); + } + + return w; + } + + /** + * Replace node with its contents + * + * @param DOMElement n node + * @return void + **/ + this.unwrap = function(n) { + if (n && n.parentNode) { + while (n.firstChild) { + n.parentNode.insertBefore(n.firstChild, n); + } + n.parentNode.removeChild(n); + + } + } + + /** + * ÐбоÑаÑÐ¸Ð²Ð°ÐµÑ Ð²Ñе ÑодеÑжимое Ð½Ð¾Ð´Ñ + * + * @param DOMElement n обоÑаÑÐ¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð½Ð¾Ð´Ð° + * @param DOMElement w нода обеÑÑка или Ð¸Ð¼Ñ Ñега + * @return DOMElement + **/ + this.wrapContents = function(n, w) { + w = w.nodeName ? w : this.create(w); + for (var i=0; i < n.childNodes.length; i++) { + w.appendChild(n.childNodes[i]); + }; + n.appendChild(w); + return w; + } + + this.cleanNode = function(n) { + + if (n.nodeType != 1) { + return; + } + if (/^(P|LI)$/.test(n.nodeName) && (l = this.findLastNotEmpty(n)) && l.nodeName == 'BR') { + $(l).remove(); + } + $n = $(n); + $n.children().each(function() { + this.cleanNode(this); + }); + if (n.nodeName != 'BODY' && !/^(TABLE|TR|TD)$/.test(n) && this.isEmpty(n)) { + return $n.remove(); + } + if ($n.attr('style') === '') { + $n.removeAttr('style'); + } + if (this.rte.browser.safari && $n.hasClass('Apple-span')) { + $n.removeClass('Apple-span'); + } + if (n.nodeName == 'SPAN' && !$n.attr('style') && !$n.attr('class') && !$n.attr('id')) { + $n.replaceWith($n.html()); + } + } + + this.cleanChildNodes = function(n) { + var cmd = this.cleanNode; + $(n).children().each(function() { cmd(this); }); + } + + /********************************************************/ + /* ТаблиÑÑ */ + /********************************************************/ + + this.tableMatrix = function(n) { + var mx = []; + if (n && n.nodeName == 'TABLE') { + var max = 0; + function _pos(r) { + for (var i=0; i<=max; i++) { + if (!mx[r][i]) { + return i; + } + }; + } + + $(n).find('tr').each(function(r) { + if (!$.isArray(mx[r])) { + mx[r] = []; + } + + $(this).children('td,th').each(function() { + var w = parseInt($(this).attr('colspan')||1); + var h = parseInt($(this).attr('rowspan')||1); + var i = _pos(r); + for (var y=0; y<h; y++) { + for (var x=0; x<w; x++) { + var _y = r+y; + if (!$.isArray(mx[_y])) { + mx[_y] = []; + } + var d = x==0 && y==0 ? this : (y==0 ? x : "-"); + mx[_y][i+x] = d; + } + }; + max= Math.max(max, mx[r].length); + }); + }); + } + return mx; + } + + this.indexesOfCell = function(n, tbm) { + for (var rnum=0; rnum < tbm.length; rnum++) { + for (var cnum=0; cnum < tbm[rnum].length; cnum++) { + if (tbm[rnum][cnum] == n) { + return [rnum, cnum]; + } + + }; + }; + } + + this.fixTable = function(n) { + if (n && n.nodeName == 'TABLE') { + var tb = $(n); + //tb.find('tr:empty').remove(); + var mx = this.tableMatrix(n); + var x = 0; + $.each(mx, function() { + x = Math.max(x, this.length); + }); + if (x==0) { + return tb.remove(); + } + // for (var i=0; i<mx.length; i++) { + // this.rte.log(mx[i]); + // } + + for (var r=0; r<mx.length; r++) { + var l = mx[r].length; + //this.rte.log(r+' : '+l) + + if (l==0) { + //this.rte.log('remove: '+tb.find('tr').eq(r)) + tb.find('tr').eq(r).remove(); +// tb.find('tr').eq(r).append('<td>remove</td>') + } else if (l<x) { + var cnt = x-l; + var row = tb.find('tr').eq(r); + for (i=0; i<cnt; i++) { + row.append('<td> </td>'); + } + } + } + + } + } + + this.tableColumn = function(n, ext, fix) { + n = this.selfOrParent(n, /^TD|TH$/); + var tb = this.selfOrParent(n, /^TABLE$/); + ret = []; + info = {offset : [], delta : []}; + if (n && tb) { + fix && this.fixTable(tb); + var mx = this.tableMatrix(tb); + var _s = false; + var x; + for (var r=0; r<mx.length; r++) { + for (var _x=0; _x<mx[r].length; _x++) { + if (mx[r][_x] == n) { + x = _x; + _s = true; + break; + } + } + if (_s) { + break; + } + } + + // this.rte.log('matrix'); + // for (var i=0; i<mx.length; i++) { + // this.rte.log(mx[i]); + // } + if (x>=0) { + for(var r=0; r<mx.length; r++) { + var tmp = mx[r][x]||null; + if (tmp) { + if (tmp.nodeName) { + ret.push(tmp); + if (ext) { + info.delta.push(0); + info.offset.push(x); + } + } else { + var d = parseInt(tmp); + if (!isNaN(d) && mx[r][x-d] && mx[r][x-d].nodeName) { + ret.push(mx[r][x-d]); + if (ext) { + info.delta.push(d); + info.offset.push(x); + } + } + } + } + } + } + } + return !ext ? ret : {column : ret, info : info}; + } +} + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.DOM.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js?rev=1178141&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js Sun Oct 2 08:06:49 2011 @@ -0,0 +1,873 @@ +(function($) { + /** + * @class Filter - clean editor content + * @param elRTE editor instance + * @author Dmitry (dio) Levashov, [hidden email] + */ + elRTE.prototype.filter = function(rte) { + var self = this, + n = $('<span/>').addClass('elrtetesturl').appendTo(document.body)[0]; + // media replacement image base url + this.url = (typeof(n.currentStyle )!= "undefined" ? n.currentStyle['backgroundImage'] : document.defaultView.getComputedStyle(n, null)['backgroundImage']).replace(/^url\((['"]?)([\s\S]+\/)[\s\S]+\1\)$/i, "$2"); + $(n).remove(); + + this.rte = rte; + // flag - return xhtml tags? + this.xhtml = /xhtml/i.test(rte.options.doctype); + // boolean attributes + this.boolAttrs = rte.utils.makeObject('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'.split(',')); + // tag regexp + this.tagRegExp = /<(\/?)([\w:]+)((?:\s+[a-z\-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*\/?>/g; + // this.tagRegExp = /<(\/?)([\w:]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*\/?>/g; + // opened tag regexp + this.openTagRegExp = /<([\w:]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*\/?>/g; + // attributes regexp + this.attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^\s]+))?/g; + // script tag regexp + this.scriptRegExp = /<script([^>]*)>([\s\S]*?)<\/script>/gi; + // style tag regexp + this.styleRegExp = /(<style([^>]*)>[\s\S]*?<\/style>)/gi; + // link tag regexp + this.linkRegExp = /(<link([^>]+)>)/gi; + // cdata regexp + this.cdataRegExp = /<!\[CDATA\[([\s\S]+)\]\]>/g; + // object tag regexp + this.objRegExp = /<object([^>]*)>([\s\S]*?)<\/object>/gi; + // embed tag regexp + this.embRegExp = /<(embed)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*>/gi; + // param tag regexp + this.paramRegExp = /<(param)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*>/gi; + // iframe tag regexp + this.iframeRegExp = /<iframe([^>]*)>([\s\S]*?)<\/iframe>/gi; + + // yandex maps regexp + this.yMapsRegExp = /<div\s+([^>]*id\s*=\s*('|")?YMapsID[^>]*)>/gi; + // google maps regexp + this.gMapsRegExp = /<iframe\s+([^>]*src\s*=\s*"http:\/\/maps\.google\.\w+[^>]*)>([\s\S]*?)<\/iframe>/gi; + // video hostings url regexp + this.videoHostRegExp = /^(http:\/\/[\w\.]*)?(youtube|vimeo|rutube).*/i; + // elrte services classes regexp + this.serviceClassRegExp = /<(\w+)([^>]*class\s*=\s*"[^>]*elrte-[^>]*)>\s*(<\/\1>)?/gi; + this.pagebreakRegExp = /<(\w+)([^>]*style\s*=\s*"[^>]*page-break[^>]*)>\s*(<\/\1>)?/gi; + + this.pbRegExp = new RegExp('<!-- pagebreak -->', 'gi'); + // allowed tags + this.allowTags = rte.options.allowTags.length ? rte.utils.makeObject(rte.options.allowTags) : null; + // denied tags + this.denyTags = rte.options.denyTags.length ? rte.utils.makeObject(rte.options.denyTags) : null; + // deny attributes + this.denyAttr = rte.options.denyAttr ? rte.utils.makeObject(rte.options.denyAttr) : null; + // deny attributes for pasted html + this.pasteDenyAttr = rte.options.pasteDenyAttr ? rte.utils.makeObject(rte.options.pasteDenyAttr) : null; + // font sizes to convert size attr into css property + this.fontSize = ['medium', 'xx-small', 'small', 'medium','large','x-large','xx-large' ]; + // font families regexp to detect family by font name + this.fontFamily = { + 'sans-serif' : /^(arial|tahoma|verdana)$/i, + 'serif' : /^(times|times new roman)$/i, + 'monospace' : /^courier$/i + } + // scripts storage + this.scripts = {}; + // cached chains of rules + this._chains = {}; + + // cache chains + $.each(this.chains, function(n) { + self._chains[n] = []; + $.each(this, function(i, r) { + typeof(self.rules[r]) == 'function' && self._chains[n].push(self.rules[r]); + }); + }); + + /** + * filtering through required chain + * + * @param String chain name + * @param String html-code + * @return String + **/ + this.proccess = function(chain, html) { + // remove whitespace at the begin and end + html = $.trim(html).replace(/^\s*( )+/gi, '').replace(/( |<br[^>]*>)+\s*$/gi, ''); + // pass html through chain + $.each(this._chains[chain]||[], function() { + html = this.call(self, html); + }); + html = html.replace(/\t/g, ' ').replace(/\r/g, '').replace(/\s*\n\s*\n+/g, "\n")+' '; + return $.trim(html) ? html : ' '; + } + + /** + * wrapper for "wysiwyg" chain filtering + * + * @param String + * @return String + **/ + this.wysiwyg = function(html) { + return this.proccess('wysiwyg', html); + } + + /** + * wrapper for "source" chain filtering + * + * @param String + * @return String + **/ + this.source = function(html) { + return this.proccess('source', html); + } + + /** + * wrapper for "source2source" chain filtering + * + * @param String + * @return String + **/ + this.source2source = function(html) { + return this.proccess('source2source', html); + } + + /** + * wrapper for "wysiwyg2wysiwyg" chain filtering + * + * @param String + * @return String + **/ + this.wysiwyg2wysiwyg = function(html) { + return this.proccess('wysiwyg2wysiwyg', html); + } + + /** + * Parse attributes from string into object + * + * @param String string of attributes + * @return Object + **/ + this.parseAttrs = function(s) { + var a = {}, + b = this.boolAttrs, + m = s.match(this.attrRegExp), + t, n, v; + // this.rte.log(s) + // this.rte.log(m) + m && $.each(m, function(i, s) { + t = s.split('='); + n = $.trim(t[0]).toLowerCase(); + + if (t.length>2) { + t.shift(); + v = t.join('='); + } else { + v = b[n] ||t[1]||''; + } + a[n] = $.trim(v).replace(/^('|")(.*)(\1)$/, "$2"); + }); + + a.style = this.rte.utils.parseStyle(a.style); + // rte.log(a.style) + a['class'] = this.rte.utils.parseClass(a['class']||'') + return a; + } + + /** + * Restore attributes string from hash + * + * @param Object attributes hash + * @return String + **/ + this.serializeAttrs = function(a, c) { + var s = [], self = this; + + $.each(a, function(n, v) { + if (n=='style') { + v = self.rte.utils.serializeStyle(v, c); + } else if (n=='class') { + // self.rte.log(v) + // self.rte.log(self.rte.utils.serializeClass(v)) + v = self.rte.utils.serializeClass(v); + } + v && s.push(n+'="'+v+'"'); + }); + return s.join(' '); + } + + /** + * Remove/replace denied attributes/style properties + * + * @param Object attributes hash + * @param String tag name to wich attrs belongs + * @return Object + **/ + this.cleanAttrs = function(a, t) { + var self = this, ra = this.replaceAttrs; + + // remove safari and mso classes + $.each(a['class'], function(n) { + /^(Apple-style-span|mso\w+)$/i.test(n) && delete a['class'][n]; + }); + + function value(v) { + return v+(/\d$/.test(v) ? 'px' : ''); + } + + $.each(a, function(n, v) { + // replace required attrs with css + ra[n] && ra[n].call(self, a, t); + // remove/fix mso styles + if (n == 'style') { + $.each(v, function(sn, sv) { + switch (sn) { + case "mso-padding-alt": + case "mso-padding-top-alt": + case "mso-padding-right-alt": + case "mso-padding-bottom-alt": + case "mso-padding-left-alt": + case "mso-margin-alt": + case "mso-margin-top-alt": + case "mso-margin-right-alt": + case "mso-margin-bottom-alt": + case "mso-margin-left-alt": + case "mso-table-layout-alt": + case "mso-height": + case "mso-width": + case "mso-vertical-align-alt": + a.style[sn.replace(/^mso-|-alt$/g, '')] = value(sv); + delete a.style[sn]; + break; + + case "horiz-align": + a.style['text-align'] = sv; + delete a.style[sn]; + break; + + case "vert-align": + a.style['vertical-align'] = sv; + delete a.style[sn]; + break; + + case "font-color": + case "mso-foreground": + a.style.color = sv; + delete a.style[sn]; + break; + + case "mso-background": + case "mso-highlight": + a.style.background = sv; + delete a.style[sn]; + break; + + case "mso-default-height": + a.style['min-height'] = value(sv); + delete a.style[sn]; + break; + + case "mso-default-width": + a.style['min-width'] = value(sv); + delete a.style[sn]; + break; + + case "mso-padding-between-alt": + a.style['border-collapse'] = 'separate'; + a.style['border-spacing'] = value(sv); + delete a.style[sn]; + break; + + case "text-line-through": + if (sv.match(/(single|double)/i)) { + a.style['text-decoration'] = 'line-through'; + } + delete a.style[sn]; + break; + + case "mso-zero-height": + if (sv == 'yes') { + a.style.display = 'none'; + } + delete a.style[sn]; + break; + + case 'font-weight': + if (sv == 700) { + a.style['font-weight'] = 'bold'; + } + break; + + default: + if (sn.match(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/)) { + delete a.style[sn] + } + } + }); + } + }); + return a; + } + + } + + // rules to replace tags + elRTE.prototype.filter.prototype.replaceTags = { + b : { tag : 'strong' }, + big : { tag : 'span', style : {'font-size' : 'large'} }, + center : { tag : 'div', style : {'text-align' : 'center'} }, + i : { tag : 'em' }, + font : { tag : 'span' }, + nobr : { tag : 'span', style : {'white-space' : 'nowrap'} }, + menu : { tag : 'ul' }, + plaintext : { tag : 'pre' }, + s : { tag : 'strike' }, + small : { tag : 'span', style : {'font-size' : 'small'}}, + u : { tag : 'span', style : {'text-decoration' : 'underline'} }, + xmp : { tag : 'pre' } + } + + // rules to replace attributes + elRTE.prototype.filter.prototype.replaceAttrs = { + align : function(a, n) { + switch (n) { + case 'img': + a.style[a.align.match(/(left|right)/) ? 'float' : 'vertical-align'] = a.align; + break; + + case 'table': + if (a.align == 'center') { + a.style['margin-left'] = a.style['margin-right'] = 'auto'; + } else { + a.style['float'] = a.align; + } + break; + + default: + a.style['text-align'] = a.align; + } + delete a.align; + }, + border : function(a) { + !a.style['border-width'] && (a.style['border-width'] = (parseInt(a.border)||1)+'px'); + !a.style['border-style'] && (a.style['border-style'] = 'solid'); + delete a.border; + }, + bordercolor : function(a) { + !a.style['border-color'] && (a.style['border-color'] = a.bordercolor); + delete a.bordercolor; + }, + background : function(a) { + !a.style['background-image'] && (a.style['background-image'] = 'url('+a.background+')'); + delete a.background; + }, + bgcolor : function(a) { + !a.style['background-color'] && (a.style['background-color'] = a.bgcolor); + delete a.bgcolor; + }, + clear : function(a) { + a.style.clear = a.clear == 'all' ? 'both' : a.clear; + delete a.clear; + }, + color : function(a) { + !a.style.color && (a.style.color = a.color); + delete a.color; + }, + face : function(a) { + var f = a.face.toLowerCase(); + $.each(this.fontFamily, function(n, r) { + if (f.match(r)) { + a.style['font-family'] = f+','+n; + } + }); + delete a.face; + }, + hspace : function(a, n) { + if (n == 'img') { + var v = parseInt(a.hspace)||0; + !a.style['margin-left'] && (a.style['margin-left'] = v+'px'); + !a.style['margin-right'] && (a.style['margin-right'] = v+'px') + delete a.hspace; + } + }, + size : function(a, n) { + if (n != 'input') { + a.style['font-size'] = this.fontSize[parseInt(a.size)||0]||'medium'; + delete a.size; + } + }, + valign : function(a) { + if (!a.style['vertical-align']) { + a.style['vertical-align'] = a.valign; + } + delete a.valign; + }, + vspace : function(a, n) { + if (n == 'img') { + var v = parseInt(a.vspace)||0; + !a.style['margin-top'] && (a.style['margin-top'] = v+'px'); + !a.style['margin-bottom'] && (a.style['margin-bottom'] = v+'px') + delete a.hspace; + } + } + } + + // rules collection + elRTE.prototype.filter.prototype.rules = { + /** + * If this.rte.options.allowTags is set - remove all except this ones + * + * @param String html code + * @return String + **/ + allowedTags : function(html) { + var a = this.allowTags; + + return a ? html.replace(this.tagRegExp, function(t, c, n) { return a[n.toLowerCase()] ? t : ''; }) : html; + }, + /** + * If this.rte.options.denyTags is set - remove all deny tags + * + * @param String html code + * @return String + **/ + deniedTags : function(html) { + var d = this.denyTags; + + return d ? html.replace(this.tagRegExp, function(t, c, n) { return d[n.toLowerCase()] ? '' : t }) : html; + }, + + /** + * Replace not allowed tags/attributes + * + * @param String html code + * @return String + **/ + clean : function(html) { + var self = this, + rt = this.replaceTags, + ra = this.replaceAttrs, + da = this.denyAttr, + n; + + + html = html.replace(/<!DOCTYPE([\s\S]*)>/gi, '') + .replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>") + .replace(/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s ]*)<\/span>/gi, "$1") + .replace(/(<p[^>]*>\s*<\/p>|<p[^>]*\/>)/gi, '<br>') + .replace(/(<\/p>)(?:\s*<br\s*\/?>\s*|\s* \s*)+\s*(<p[^>]*>)/gi, function(t, b, e) { + return b+"\n"+e; + }) + .replace(this.tagRegExp, function(t, c, n, a) { + n = n.toLowerCase(); + + if (c) { + return '</'+(rt[n] ? rt[n].tag : n)+'>'; + } + // self.rte.log(t) + // create attributes hash and clean it + a = self.cleanAttrs(self.parseAttrs(a||''), n); + // self.rte.log(a) + if (rt[n]) { + rt[n].style && $.extend(a.style, rt[n].style); + n = rt[n].tag; + } + + da && $.each(a, function(na) { + if (da[na]) { + delete a[na]; + } + }); + a = self.serializeAttrs(a); + // self.rte.log(a) + return '<'+n+(a?' ':'')+a+'>'; + }); + + + n = $('<div>'+html+'</div>'); + + // remove empty spans and merge nested spans + n.find('span:not([id]):not([class])').each(function() { + var t = $(this); + + if (!t.attr('style')) { + + $.trim(t.html()).length ? self.rte.dom.unwrap(this) : t.remove(); + // t.children().length ? self.rte.dom.unwrap(this) : t.remove(); + } + }).end().find('span span:only-child').each(function() { + var t = $(this), + p = t.parent().eq(0), + tid = t.attr('id'), + pid = p.attr('id'), id, s, c; + + if (self.rte.dom.isOnlyNotEmpty(this) && (!tid || !pid)) { + c = $.trim(p.attr('class')+' '+t.attr('class')) + c && p.attr('class', c); + s = self.rte.utils.serializeStyle($.extend(self.rte.utils.parseStyle($(this).attr('style')||''), self.rte.utils.parseStyle($(p).attr('style')||''))); + s && p.attr('style', s); + id = tid||pid; + id && p.attr('id', id); + this.firstChild ? $(this.firstChild).unwrap() : t.remove(); + } + }) + .end().find('a[name]').each(function() { + $(this).addClass('elrte-protected elrte-anchor'); + }); + + return n.html() + }, + + /** + * Clean pasted html + * + * @param String html code + * @return String + **/ + cleanPaste : function(html) { + var self = this, d = this.pasteDenyAttr; + + html = html + .replace(this.scriptRegExp, '') + .replace(this.styleRegExp, '') + .replace(this.linkRegExp, '') + .replace(this.cdataRegExp, '') + .replace(/\<\!--[\s\S]*?--\>/g, ''); + + if (this.rte.options.pasteOnlyText) { + html = html.replace(this.tagRegExp, function(t, c, n) { + return /br/i.test(n) || (c && /h[1-6]|p|ol|ul|li|div|blockquote|tr/i) ? '<br>' : ''; + }).replace(/( |<br[^>]*>)+\s*$/gi, ''); + } else if (d) { + html = html.replace(this.openTagRegExp, function(t, n, a) { + a = self.parseAttrs(a); + $.each(a, function(an) { + if (d[an]) { + delete a[an]; + } + }); + a = self.serializeAttrs(a, true); + return '<'+n+(a?' ':'')+a+'>'; + }); + } + return html; + }, + + /** + * Replace script/style/media etc with placeholders + * + * @param String html code + * @return String + **/ + replace : function(html) { + var self = this, r = this.rte.options.replace||[], n; + + // custom replaces if set + if (r.length) { + $.each(r, function(i, f) { + if (typeof(f) == 'function') { + html = f.call(self, html); + } + }); + } + + /** + * Return media replacement - img html code + * + * @param Object object to store in rel attr + * @param String media mime-type + * @return String + **/ + function img(o, t) { + var s = src(), + c = s && self.videoHostRegExp.test(s) ? s.replace(self.videoHostRegExp, "$2") : t.replace(/^\w+\/(.+)/, "$1"), + w = parseInt((o.obj ? o.obj.width || o.obj.style.width : 0)||(o.embed ? o.embed.width || o.embed.style.width : 0))||150, + h = parseInt((o.obj ? o.obj.height || o.obj.style.height : 0)||(o.embed ? o.embed.height || o.embed.style.height : 0))||100, + id = 'media'+Math.random().toString().substring(2), + style ='', + l; + + // find media src + function src() { + if (o.embed && o.embed.src) { + return o.embed.src; + } + if (o.params && o.params.length) { + l = o.params.length; + while (l--) { + if (o.params[l].name == 'src' || o.params[l].name == 'movie') { + return o.params[l].value; + } + } + } + } + if (o.obj && o.obj.style && o.obj.style['float']) { + style = ' style="float:'+o.obj.style['float']+'"'; + } + self.scripts[id] = o; + return '<img src="'+self.url+'pixel.gif" class="elrte-media elrte-media-'+c+' elrte-protected" title="'+(s ? self.rte.utils.encode(s) : '')+'" rel="'+id+'" width="'+w+'" height="'+h+'"'+style+'>'; + } + + html = html + .replace(this.styleRegExp, "<!-- ELRTE_COMMENT$1 -->") + .replace(this.linkRegExp, "<!-- ELRTE_COMMENT$1-->") + .replace(this.cdataRegExp, "<!--[CDATA[$1]]-->") + .replace(this.scriptRegExp, function(t, a, s) { + var id; + if (self.denyTags.script) { + return ''; + } + id = 'script'+Math.random().toString().substring(2); + a = self.parseAttrs(a); + !a.type && (a.type = 'text/javascript'); + self.scripts[id] = '<script '+self.serializeAttrs(a)+">"+s+"</script>"; + return '<!-- ELRTE_SCRIPT:'+(id)+' -->'; + }) + .replace(this.yMapsRegExp, function(t, a) { + a = self.parseAttrs(a); + a['class']['elrte-yandex-maps'] = 'elrte-yandex-maps'; + a['class']['elrte-protected'] = 'elrte-protected'; + return '<div '+self.serializeAttrs(a)+'>'; + }) + .replace(this.gMapsRegExp, function(t, a) { + var id = 'gmaps'+Math.random().toString().substring(2), w, h; + a = self.parseAttrs(a); + w = parseInt(a.width||a.style.width||100); + h = parseInt(a.height||a.style.height||100); + self.scripts[id] = t; + return '<img src="'+self.url+'pixel.gif" class="elrte-google-maps elrte-protected" id="'+id+'" style="width:'+w+'px;height:'+h+'px">'; + }) + .replace(this.objRegExp, function(t, a, c) { + var m = c.match(self.embRegExp), + o = { obj : self.parseAttrs(a), embed : m && m.length ? self.parseAttrs(m[0].substring(7)) : null, params : [] }, + i = self.rte.utils.mediaInfo(o.embed ? o.embed.type||'' : '', o.obj.classid||''); + + if (i) { + if ((m = c.match(self.paramRegExp))) { + $.each(m, function(i, p) { + o.params.push(self.parseAttrs(p.substring(6))); + }); + } + !o.obj.classid && (o.obj.classid = i.classid[0]); + !o.obj.codebase && (o.obj.codebase = i.codebase); + o.embed && !o.embed.type && (o.embed.type = i.type); + // ie bug with empty attrs + o.obj.width == '1' && delete o.obj.width; + o.obj.height == '1' && delete o.obj.height; + if (o.embed) { + o.embed.width == '1' && delete o.embed.width; + o.embed.height == '1' && delete o.embed.height; + } + return img(o, i.type); + } + return t; + }) + .replace(this.embRegExp, function(t, n, a) { + var a = self.parseAttrs(a), + i = self.rte.utils.mediaInfo(a.type||''); + // ie bug with empty attrs + a.width == '1' && delete a.width; + a.height == '1' && delete a.height; + return i ? img({ embed : a }, i.type) : t; + }) + .replace(this.iframeRegExp, function(t, a) { + var a = self.parseAttrs(a); + var w = a.style.width || (parseInt(a.width) > 1 ? parseInt(a.width)+'px' : '100px'); + var h = a.style.height || (parseInt(a.height) > 1 ? parseInt(a.height)+'px' : '100px'); + var id = 'iframe'+Math.random().toString().substring(2); + self.scripts[id] = t; + var img = '<img id="'+id+'" src="'+self.url+'pixel.gif" class="elrte-protected elrte-iframe" style="width:'+w+'; height:'+h+'">'; + return img; + }) + .replace(this.vimeoRegExp, function(t, n, a) { + a = self.parseAttrs(a); + delete a.frameborder; + a.width == '1' && delete a.width; + a.height == '1' && delete a.height; + a.type = 'application/x-shockwave-flash'; + return img({ embed : a }, 'application/x-shockwave-flash'); + }) + .replace(/<\/(embed|param)>/gi, '') + .replace(this.pbRegExp, function() { + return '<img src="'+self.url+'pixel.gif" class="elrte-protected elrte-pagebreak">'; + }); + + + n = $('<div>'+html+'</div>'); + + // remove empty spans and merge nested spans + // n.find('span:not([id]):not([class])').each(function() { + // var t = $(this); + // + // if (!t.attr('style')) { + // $.trim(t.html()).length ? self.rte.dom.unwrap(this) : t.remove(); + // // t.children().length ? self.rte.dom.unwrap(this) : t.remove(); + // } + // }).end().find('span span:only-child').each(function() { + // var t = $(this), + // p = t.parent().eq(0), + // tid = t.attr('id'), + // pid = p.attr('id'), id, s, c; + // + // if (self.rte.dom.is(this, 'onlyChild') && (!tid || !pid)) { + // c = $.trim(p.attr('class')+' '+t.attr('class')) + // c && p.attr('class', c); + // s = self.rte.utils.serializeStyle($.extend(self.rte.utils.parseStyle($(this).attr('style')||''), self.rte.utils.parseStyle($(p).attr('style')||''))); + // s && p.attr('style', s); + // id = tid||pid; + // id && p.attr('id', id); + // this.firstChild ? $(this.firstChild).unwrap() : t.remove(); + // } + // }) + // .end().find('a[name]').each(function() { + // $(this).addClass('elrte-anchor'); + // }); + + + if (!this.rte.options.allowTextNodes) { + // wrap inline nodes with p + var dom = this.rte.dom, + nodes = [], + w = []; + + if ($.browser.msie) { + for (var i = 0; i<n[0].childNodes.length; i++) { + nodes.push(n[0].childNodes[i]) + } + } else { + nodes = Array.prototype.slice.call(n[0].childNodes); + } + + + function wrap() { + if (w.length && dom.filter(w, 'notEmpty').length) { + dom.wrap(w, document.createElement('p')); + } + w = []; + } + $.each(nodes, function(i, n) { + if (dom.is(n, 'block')) { + wrap(); + } else { + if (w.length && n.previousSibling != w[w.length-1]) { + wrap(); + } + w.push(n); + } + }); + wrap(); + } + + return n.html(); + }, + /** + * Restore script/style/media etc from placeholders + * + * @param String html code + * @return String + **/ + restore : function(html) { + var self =this, r = this.rte.options.restore||[]; + + // custom restore if set + if (r.length) { + $.each(r, function(i, f) { + if (typeof(f) == 'function') { + html = f.call(self, html); + } + }); + } + + html = html + .replace(/\<\!--\[CDATA\[([\s\S]*?)\]\]--\>/gi, "<![CDATA[$1]]>") + .replace(/\<\!--\s*ELRTE_SCRIPT\:\s*(script\d+)\s*--\>/gi, function(t, n) { + if (self.scripts[n]) { + t = self.scripts[n]; + delete self.scripts[n]; + } + return t||''; + }) + .replace(/\<\!-- ELRTE_COMMENT([\s\S]*?) --\>/gi, "$1") + .replace(this.serviceClassRegExp, function(t, n, a, e) { + + var a = self.parseAttrs(a), j, o = ''; + // alert(t) + if (a['class']['elrte-google-maps']) { + var t = ''; + if (self.scripts[a.id]) { + t = self.scripts[a.id]; + delete self.scripts[a.id] + } + return t; + } else if (a['class']['elrte-iframe']) { + return self.scripts[a.id] || ''; + } else if (a['class']['elrtebm']) { + return ''; + } else if (a['class']['elrte-media']) { + // alert(a.rel) + // return '' + // j = a.rel ? JSON.parse(self.rte.utils.decode(a.rel)) : {}; + j = self.scripts[a.rel]||{}; + j.params && $.each(j.params, function(i, p) { + o += '<param '+self.serializeAttrs(p)+">\n"; + }); + j.embed && (o+='<embed '+self.serializeAttrs(j.embed)+">"); + j.obj && (o = '<object '+self.serializeAttrs(j.obj)+">\n"+o+"\n</object>\n"); + return o||t; + } else if (a['class']['elrte-pagebreak']) { + return '<!-- pagebreak -->'; + } + $.each(a['class'], function(n) { + if (/^elrte-\w+/i.test(n)) { + delete(a['class'][n]); + } + // /^elrte\w+/i.test(n) && delete(a['class'][n]); + }); + return '<'+n+' '+self.serializeAttrs(a)+'>'+(e||''); + + }); + + return html; + }, + /** + * compact styles and move tags and attributes names in lower case(for ie&opera) + * + * @param String html code + * return String + **/ + compactStyles : function(html) { + var self = this; + + return html.replace(this.tagRegExp, function(t, c, n, a) { + a = !c && a ? self.serializeAttrs(self.parseAttrs(a), true) : ''; + return '<'+c+n.toLowerCase()+(a?' ':'')+a+'>'; + }); + }, + /** + * return xhtml tags + * + * @param String html code + * return String + **/ + xhtmlTags : function(html) { + return this.xhtml ? html.replace(/<(img|hr|br|embed|param|link|area)([^>]*\/*)>/gi, "<$1$2 />") : html; + } + } + + /** + * Chains configuration + * Default chains + * wysiwyg - proccess html from source for wysiwyg editor mode + * source - proccess html from wysiwyg for source editor mode + * paste - clean pasted html + * wysiwyg2wysiwyg - ciclyc rule to clean html from wysiwyg for wysiwyg paste + * source2source - ciclyc rule to clean html from source for source paste + * deniedTags is in the end of chain to protect google maps iframe from removed + **/ + elRTE.prototype.filter.prototype.chains = { + wysiwyg : ['replace', 'clean', 'allowedTags', 'deniedTags', 'compactStyles'], + source : ['clean', 'allowedTags', 'restore', 'compactStyles', 'xhtmlTags'], + paste : ['clean', 'allowedTags', 'cleanPaste', 'replace', 'deniedTags', 'compactStyles'], + wysiwyg2wysiwyg : ['clean', 'allowedTags', 'restore', 'replace', 'deniedTags', 'compactStyles'], + source2source : ['clean', 'allowedTags', 'replace', 'deniedTags', 'restore', 'compactStyles', 'xhtmlTags'] + } + + + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.filter.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js?rev=1178141&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js Sun Oct 2 08:06:49 2011 @@ -0,0 +1,51 @@ +(function($) { +elRTE.prototype.history = function(rte) { + this.rte = rte; + this._prev = [] + this._next = []; + + + this.add = function() { + if (this.rte.options.historyLength>0 && this._prev.length>= this.rte.options.historyLength) { + this._prev.slice(this.rte.options.historyLength); + } + var b = this.rte.selection.getBookmark(); + this._prev.push([$(this.rte.doc.body).html(), b]); + this.rte.selection.moveToBookmark(b); + // this._prev.push($(this.rte.doc.body).html()); + this._next = []; + } + + this.back = function() { + + if (this._prev.length) { + var b = this.rte.selection.getBookmark(), + data = this._prev.pop(); + this._next.push([$(this.rte.doc.body).html(), b]); + + $(this.rte.doc.body).html(data[0]); + this.rte.selection.moveToBookmark(data[1]); + } + } + + this.fwd = function() { + if (this._next.length) { + var b = this.rte.selection.getBookmark(), + data = this._next.pop(); + this._prev.push([$(this.rte.doc.body).html(), b]); + + $(this.rte.doc.body).html(data[0]); + this.rte.selection.moveToBookmark(data[1]); + } + } + + this.canBack = function() { + return this._prev.length; + } + + this.canFwd = function() { + return this._next.length; + } + +} +})(jQuery); \ No newline at end of file Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/plugins/elrte-1.3/src/elrte/js/elRTE.history.js ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |