diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..9bc0ab50
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+hedera-web.js
diff --git a/app.js b/app.js
index 5009b804..0e456ebc 100644
--- a/app.js
+++ b/app.js
@@ -1,9 +1,10 @@
-//Vn.includeCss ('pages/main/style.css');
+var Hedera = require ('hedera/hedera');
+Vn.includeCss ('pages/main/style.css');
-var Hedera = require ('./js/hedera/main');
-var App = require ('./js/hedera/app');
+window.onload = function main ()
+{
+ hederaWeb = new Hedera.App ();
+ hederaWeb.run ();
+}
-hederaWeb = new App ();
-hederaWeb.run ();
-window.hederaWeb = hederaWeb;
diff --git a/conf/apache.conf b/conf/apache.conf
index 0206bd5f..cf8b07c4 100644
--- a/conf/apache.conf
+++ b/conf/apache.conf
@@ -1,5 +1,5 @@
# Alias /hedera-web /usr/share/hedera-web/
-# Alias /vn-image-data /var/lib/hedera-web/image-db/
+# Alias /image-db /var/lib/hedera-web/image-db/
diff --git a/forms/account/address/address.js b/forms/account/address/address.js
index aca0a781..d977a2c3 100644
--- a/forms/account/address/address.js
+++ b/forms/account/address/address.js
@@ -1,7 +1,7 @@
-Vn.Address = new Class
+Hedera.Address = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/account/conf/conf.js b/forms/account/conf/conf.js
index 866563e3..06d387d3 100644
--- a/forms/account/conf/conf.js
+++ b/forms/account/conf/conf.js
@@ -1,7 +1,7 @@
-Vn.Conf = new Class
+Hedera.Conf = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/admin/access-log/access-log.js b/forms/admin/access-log/access-log.js
index f226a950..8efbd52a 100644
--- a/forms/admin/access-log/access-log.js
+++ b/forms/admin/access-log/access-log.js
@@ -1,6 +1,6 @@
-Vn.AccessLog = new Class
+Hedera.AccessLog = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
});
diff --git a/forms/admin/connections/connections.js b/forms/admin/connections/connections.js
index ba3fd12f..ff66f4d3 100644
--- a/forms/admin/connections/connections.js
+++ b/forms/admin/connections/connections.js
@@ -1,7 +1,7 @@
-Vn.Connections = new Class
+Hedera.Connections = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,_timeoutId: null
diff --git a/forms/admin/items/items.js b/forms/admin/items/items.js
index bb42361d..b029e140 100644
--- a/forms/admin/items/items.js
+++ b/forms/admin/items/items.js
@@ -1,7 +1,7 @@
-Vn.Items = new Class
+Hedera.Items = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/admin/links/links.js b/forms/admin/links/links.js
index 41c14fa7..f19f14a1 100644
--- a/forms/admin/links/links.js
+++ b/forms/admin/links/links.js
@@ -1,7 +1,7 @@
-Vn.Links = new Class
+Hedera.Links = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,repeaterFunc: function (res, form)
{
diff --git a/forms/admin/photos/photos.js b/forms/admin/photos/photos.js
index e158aad2..833273de 100644
--- a/forms/admin/photos/photos.js
+++ b/forms/admin/photos/photos.js
@@ -1,7 +1,7 @@
-Vn.Photos = new Class
+Hedera.Photos = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/admin/queries/queries.js b/forms/admin/queries/queries.js
index 4e273761..38b9e581 100644
--- a/forms/admin/queries/queries.js
+++ b/forms/admin/queries/queries.js
@@ -1,7 +1,7 @@
-Vn.Queries = new Class
+Hedera.Queries = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/admin/shelves/shelves.js b/forms/admin/shelves/shelves.js
index d2c0d050..d1753511 100644
--- a/forms/admin/shelves/shelves.js
+++ b/forms/admin/shelves/shelves.js
@@ -1,7 +1,7 @@
-Vn.Shelves = new Class
+Hedera.Shelves = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/admin/users/users.js b/forms/admin/users/users.js
index e04f0b3f..471b4d4b 100644
--- a/forms/admin/users/users.js
+++ b/forms/admin/users/users.js
@@ -1,7 +1,7 @@
-Vn.Users = new Class
+Hedera.Users = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,onAccessLogClick: function (button, form)
{
diff --git a/forms/admin/visits/visits.js b/forms/admin/visits/visits.js
index a8454491..fd4c40b0 100644
--- a/forms/admin/visits/visits.js
+++ b/forms/admin/visits/visits.js
@@ -1,7 +1,7 @@
-Vn.Visits = new Class
+Hedera.Visits = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/agencies/packages/packages.js b/forms/agencies/packages/packages.js
index d3f0db86..b71a13b6 100644
--- a/forms/agencies/packages/packages.js
+++ b/forms/agencies/packages/packages.js
@@ -1,7 +1,7 @@
-Vn.Packages = new Class
+Hedera.Packages = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,onShowClick: function (column, agencyId)
{
diff --git a/forms/agencies/provinces/provinces.js b/forms/agencies/provinces/provinces.js
index fe50c3d1..723fc15c 100644
--- a/forms/agencies/provinces/provinces.js
+++ b/forms/agencies/provinces/provinces.js
@@ -1,6 +1,6 @@
-Vn.Provinces = new Class
+Hedera.Provinces = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
});
diff --git a/forms/cms/about/about.js b/forms/cms/about/about.js
index fa65a1cc..1244f041 100644
--- a/forms/cms/about/about.js
+++ b/forms/cms/about/about.js
@@ -1,6 +1,6 @@
-Vn.About = new Class
+Hedera.About = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
});
diff --git a/forms/cms/contact/contact.js b/forms/cms/contact/contact.js
index c95892a8..509863ae 100644
--- a/forms/cms/contact/contact.js
+++ b/forms/cms/contact/contact.js
@@ -1,7 +1,7 @@
-Vn.Contact = new Class
+Hedera.Contact = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,activate: function ()
{
diff --git a/forms/cms/home/home.js b/forms/cms/home/home.js
index 2306c4c6..d8a544d8 100644
--- a/forms/cms/home/home.js
+++ b/forms/cms/home/home.js
@@ -1,7 +1,7 @@
-Vn.Home = new Class
+Hedera.Home = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,onStartOrderClick: function ()
{
diff --git a/forms/cms/location/location.js b/forms/cms/location/location.js
index a1f051bf..dc823f5f 100644
--- a/forms/cms/location/location.js
+++ b/forms/cms/location/location.js
@@ -1,9 +1,9 @@
var gmapsIsLoaded = false;
-Vn.Location = new Class
+Hedera.Location = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,locations: null
diff --git a/forms/cms/training/training.js b/forms/cms/training/training.js
index 2e7b514b..adb059b7 100644
--- a/forms/cms/training/training.js
+++ b/forms/cms/training/training.js
@@ -1,5 +1,5 @@
-Vn.Training = new Class
+Hedera.Training = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
});
diff --git a/forms/cms/why/why.js b/forms/cms/why/why.js
index a29a3c04..ab2f919a 100644
--- a/forms/cms/why/why.js
+++ b/forms/cms/why/why.js
@@ -1,6 +1,6 @@
-Vn.Why = new Class
+Hedera.Why = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
});
diff --git a/forms/ecomerce/basket/basket.js b/forms/ecomerce/basket/basket.js
index e267c7f0..66f9fe08 100644
--- a/forms/ecomerce/basket/basket.js
+++ b/forms/ecomerce/basket/basket.js
@@ -1,14 +1,14 @@
-Vn.Basket = new Class
+Hedera.Basket = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,open: function ()
{
this.close ();
this.isOpen = true;
- Vn.BasketChecker.check (this.conn,
+ Hedera.BasketChecker.check (this.conn,
this.onBasketCheck.bind (this));
}
diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js
index 95f4f064..2fb2895a 100644
--- a/forms/ecomerce/catalog/catalog.js
+++ b/forms/ecomerce/catalog/catalog.js
@@ -1,7 +1,7 @@
-Vn.Catalog = new Class
+Hedera.Catalog = new Class
({
- Extends: Vn.Form
+ Extends: Hedera.Form
,_menuShown: false
@@ -10,9 +10,9 @@ Vn.Catalog = new Class
this.close ();
this.isOpen = true;
- if (!Vn.Cookie.check ('hedera_guest'))
+ if (!localStorage.getItem ('hederaGuest'))
{
- Vn.BasketChecker.check (this.conn,
+ Hedera.BasketChecker.check (this.conn,
this.onBasketCheck.bind (this));
}
else
@@ -35,9 +35,9 @@ Vn.Catalog = new Class
this.$('items-model').setInfo ('a', 'Articles', 'vn2008', ['item_id']);
if (localStorage.getItem ('hederaView'))
- this.setView (parsetInt (localStorage.getItem ('hederaView')));
+ this.setView (parseInt (localStorage.getItem ('hederaView')));
else
- this.setView (Vn.Catalog.View.GRID);
+ this.setView (Hedera.Catalog.View.GRID);
}
,deactivate: function ()
@@ -49,22 +49,22 @@ Vn.Catalog = new Class
,setView: function (view)
{
- if (view === Vn.Catalog.View.GRID)
+ if (view === Hedera.Catalog.View.GRID)
{
this.$('view-button').setProperties ({
- image: 'image/dark/view-list.svg',
+ icon: 'view-list',
tip: _('List view')
});
- this.view = Vn.Catalog.View.GRID;
+ this.view = Hedera.Catalog.View.GRID;
var className = 'grid-view';
}
else
{
this.$('view-button').setProperties ({
- image: 'image/dark/view-grid.svg',
+ image: 'view-grid',
tip: _('Grid view')
});
- this.view = Vn.Catalog.View.LIST;
+ this.view = Hedera.Catalog.View.LIST;
var className = 'list-view';
}
@@ -75,8 +75,8 @@ Vn.Catalog = new Class
,onSwitchViewClick: function ()
{
- this.setView (this.view === Vn.Catalog.View.LIST ?
- Vn.Catalog.View.GRID : Vn.Catalog.View.LIST);
+ this.setView (this.view === Hedera.Catalog.View.LIST ?
+ Hedera.Catalog.View.GRID : Hedera.Catalog.View.LIST);
}
,onBasketReady: function (form)
@@ -237,7 +237,7 @@ Vn.Catalog = new Class
,isGuest: function ()
{
- if (Vn.Cookie.check ('hedera_guest'))
+ if (localStorage.getItem ('hederaGuest'))
{
Htk.Toast.showError (_('YouMustBeLoggedIn'));
return true;
@@ -348,7 +348,7 @@ Vn.Catalog = new Class
}
});
-Vn.Catalog.extend
+Hedera.Catalog.extend
({
View: {
LIST: 0,
@@ -496,9 +496,11 @@ Vn.Filter = new Class
this._onCloseClick.bind (this, li));
li.appendChild (button);
- var img = document.createElement ('img');
- img.src = 'image/close.svg';
- button.appendChild (img);
+ var icon = new Htk.Icon ({
+ icon: 'close',
+ alt: _('Close')
+ });
+ button.appendChild (icon);
var text = this._label = document.createTextNode ('');
li.appendChild (text);
diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml
index 4722fd6b..f9b61315 100755
--- a/forms/ecomerce/catalog/ui.xml
+++ b/forms/ecomerce/catalog/ui.xml
@@ -450,20 +450,22 @@
"+r+"
":r)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(t){"IMG"==t.target.nodeName&&e.dom.hasClass(t.target,a)&&(t.name="pagebreak")}),e.on("click",function(t){t=t.target,"IMG"===t.nodeName&&e.dom.hasClass(t,a)&&e.selection.select(t)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(n,r)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(a){for(var n,r,c=a.length;c--;)if(n=a[c],r=n.attr("class"),r&&-1!==r.indexOf("mce-pagebreak")){var o=n.parent;if(e.schema.getBlockElements()[o.name]&&e.settings.pagebreak_split_block){o.type=3,o.value=t,o.raw=!0,n.remove();continue}n.type=3,n.value=t,n.raw=!0}})})});!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i)$/,a+"$1"],[/\n/g,"
"]]),-1!=e.indexOf("
")&&(e=a+e)),i(e)}function a(){var t=r.dom,n=r.getBody(),i=r.dom.getViewPort(r.getWin()),o=i.y,a=20,s;if(v=r.selection.getRng(),r.inline&&(s=r.selection.getScrollContainer(),s&&(o=s.scrollTop)),v.getClientRects){var l=v.getClientRects();if(l.length)a=o+(l[0].top-t.getPos(n).y);else{a=o;var c=v.startContainer;c&&(3==c.nodeType&&c.parentNode!=n&&(c=c.parentNode),1==c.nodeType&&(a=t.getPos(c,s||n).y))}}g=t.add(r.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+a+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},b),(e.ie||e.gecko)&&t.setStyle(g,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(g,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),g.focus(),r.selection.select(g,!0)}function s(){if(g){for(var e;e=r.dom.get("mcepastebin");)r.dom.remove(e),r.dom.unbind(e);v&&r.selection.setRng(v)}C=!1,g=v=null}function l(){var e=b,t,n;for(t=r.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var i=t[n].innerHTML;e==b&&(e=""),i.length>e.length&&(e=i)}return e}function c(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var r=0;r
$/i])}function s(e){if(!n.isWordContent(e))return e;var o=[];t.each(i.schema.getBlockElements(),function(e,t){o.push(t)});var a=new RegExp("(?:
[\\s\\r\\n]+|
)*(<\\/?("+o.join("|")+")[^>]*>)(?:
[\\s\\r\\n]+|
)*","g");return e=r.filter(e,[[a,"$1"]]),e=r.filter(e,[[/
/g,"
"],[/
/g," "],[/
/g,"
"]])}function l(e){if(n.isWordContent(e))return e;var t=i.getParam("paste_webkit_styles","color font-size font-family background-color").split(/[, ]/);if(i.settings.paste_remove_styles_if_webkit===!1&&(t="all"),"all"!=t){var r=i.dom,o=i.selection.getNode();e=e.replace(/ style=\"([^\"]+)\"/gi,function(e,n){var i=r.parseStyle(n,"span"),a={};if("none"===t)return"";for(var s=0;s
'),!1):void 0},"childNodes"),t=s(t,!1),d(t,"rowSpan",1),d(t,"colSpan",1),o?t.appendChild(o):n.ie||(t.innerHTML='
'),t}function g(){var e=I.createRng(),t;return i(I.select("tr",a),function(e){0===e.cells.length&&I.remove(e)}),0===I.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),E.setRng(e),void I.remove(a)):(i(I.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&I.remove(e)}),l(),void(B&&(t=A[Math.min(A.length-1,B.y)],t&&(E.select(t[Math.min(t.length-1,B.x)].elm,!0),E.collapse(!0)))))}function h(e,t,n,o){var i,r,a,l,s;for(i=A[t][e].elm.parentNode,a=1;n>=a;a++)if(i=I.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=A[t+a][r].elm,s.parentNode==i){for(l=1;o>=l;l++)I.insertAfter(p(s),s);break}if(-1==r)for(l=1;o>=l;l++)i.insertBefore(p(i.cells[0]),i.cells[0])}}function b(){i(A,function(e,t){i(e,function(e,n){var i,r,a;if(u(e)&&(e=e.elm,i=o(e,"colspan"),r=o(e,"rowspan"),i>1||r>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;i-1>a;a++)I.insertAfter(p(e),e);h(n,t,r-1,i)}})})}function v(t,n,o){var r,a,s,f,m,p,h,v,y,w,x;if(t?(r=T(t),a=r.x,s=r.y,f=a+(n-1),m=s+(o-1)):(B=D=null,i(A,function(e,t){i(e,function(e,n){u(e)&&(B||(B={x:n,y:t}),D={x:n,y:t})})}),B&&(a=B.x,s=B.y,f=D.x,m=D.y)),v=c(a,s),y=c(f,m),v&&y&&v.part==y.part){for(b(),l(),v=c(a,s).elm,d(v,"colSpan",f-a+1),d(v,"rowSpan",m-s+1),h=s;m>=h;h++)for(p=a;f>=p;p++)A[h]&&A[h][p]&&(t=A[h][p].elm,t!=v&&(w=e.grep(t.childNodes),i(w,function(e){v.appendChild(e)}),w.length&&(w=e.grep(v.childNodes),x=0,i(w,function(e){"BR"==e.nodeName&&I.getAttrib(e,"data-mce-bogus")&&x++
'):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),a,l,s;return r&&(a=r.parentNode),l=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==a),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,l||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var o=n.dom.getParent(n.selection.getStart(),"table");if(o){for(var i=n.dom.select("td,th",o),r=i.length;r--;)if(!n.dom.hasClass(i[r],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(r(),s()),t.gecko&&(a(),l()),t.ie>10&&(a(),l())}}),o(m,[s,p,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(l||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=a.getParent(r,"table"),i==c&&(l||(l=new e(o,i),l.setStartCell(s),o.getBody().style.webkitUserSelect="none"),l.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var a=o.dom,l,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=a.getParent(e.target,"td,th"),c=a.getParent(s,"table"))}),o.on("mouseover",r),o.on("remove",function(){a.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(o?i.setStartBefore(e):i.setEndBefore(e))}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,f,m,p;if(s){if(l&&(o.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=a.createRng(),f=d[0],p=d[d.length-1],i.setStartBefore(f),i.setEndAfter(f),e(f,1),u=new t(f,a.getParent(d[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;m=f}while(f=u.next());e(m),r.setRng(i)}o.nodeChanged(),s=l=c=null}}),o.on("KeyUp",function(){i()}),{clear:i}}}),o(g,[s,u,m,c,p,d,h],function(e,t,n,o,i,r,a){function l(o){function i(e){return e?e.replace(/px$/,""):""}function a(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(){var e=o.dom,t,n,c,d;t=e.getParent(o.selection.getStart(),"table"),d={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:t?e.getAttrib(t,"cellspacing"):"",cellpadding:t?e.getAttrib(t,"cellpadding"):"",border:t?e.getAttrib(t,"border"):"",caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(d.align=e)}),t||(n={label:"Cols",name:"cols"},c={label:"Rows",name:"rows"}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:d,defaults:{type:"textbox",maxWidth:50},items:[n,c,{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){t||(t=p(n.cols||1,n.rows||1)),o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:a(n.width),height:a(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),i.innerHTML=r.ie?"\xa0":'
',t.insertBefore(i,t.firstChild)),l(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function d(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],t&&(n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:a(t.width),height:a(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),l(n),t.align&&o.formatter.apply("align"+t.align,{},n)}),o.focus()})}}))}function f(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],r&&(c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:a(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),l(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}}))}function m(e){return function(){o.execCommand(e)}}function p(e,t){var n,i,a;for(a='',n=0;t>n;n++){for(a+="
",o.insertContent(a);var l=o.dom.get("__mce");return o.dom.setAttrib(l,"id",null),l}function g(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function h(){g(this,"table")}function b(){g(this,"td,th")}function v(){var e="";e='",i=0;e>i;i++)a+=" "}a+=""+(r.ie?" ":" ";a+="
")+"';for(var t=0;10>t;t++){e+="
",e+='";for(var n=0;10>n;n++)e+=' "}return e+="";e+=" ",n=0;i>n;n++)d=F*i+n,d>a?l+=" "}return l+=""}function r(t){var o,r=this.parent();(o=t.target.getAttribute("data-mce-color"))&&(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,r.hidePanel(),o="#"+o,r.color(o),e.execCommand(r.settings.selectcmd,!1,o))}function l(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l})});tinymce.PluginManager.add("visualblocks",function(e,s){function o(){var s=this;s.active(a),e.on("VisualBlocks",function(){s.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var l,t,a;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,c=e.dom;l||(l=c.uniqueId(),o=c.create("link",{id:l,rel:"stylesheet",href:s+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(s){a&&c.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==s.type)}),c.toggleClass(e.getBody(),"mce-visualblocks"),a=e.dom.hasClass(e.getBody(),"mce-visualblocks"),t&&t.active(c.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))});tinymce.PluginManager.add("visualchars",function(e){function a(a){var t,s,i,r,c,d,l=e.getBody(),m=e.selection;if(n=!n,o.state=n,e.fire("VisualChars",{state:n}),a&&(d=m.getBookmark()),n)for(s=[],tinymce.walk(l,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&s.push(e)},"childNodes"),i=0;i":(r=o[d],l+=' ');l+="