From 57a4d385a1d2806d5877f53b1fdb0bd94efa2dbb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Sun, 7 Nov 2010 03:08:56 +0100 Subject: [PATCH 1/2] Importation initiale. --- HistoryAdapters.py | 41 +++ PlinnDocument.py | 273 ++++++++++++++++ __init__.py | 35 +++ configure.zcml | 32 ++ graphics/delete_rectangle.psd | Bin 0 -> 24724 bytes graphics/layer_status.psd | Bin 0 -> 21548 bytes graphics/resize_handle.psd | Bin 0 -> 23898 bytes interfaces.py | 5 + license.txt | 340 ++++++++++++++++++++ profiles/default/types.xml | 4 + profiles/default/types/Plinn_Document.xml | 42 +++ skins/color_utils.js | 117 +++++++ skins/color_utils.js.metadata | 2 + skins/dd_trigger.js | 69 ++++ skins/dd_trigger.js.metadata | 2 + skins/degrad_rectangle_header.gif | Bin 0 -> 92 bytes skins/delete_rectangle.gif | Bin 0 -> 305 bytes skins/delete_rectangle_hover.gif | Bin 0 -> 304 bytes skins/layout_controlers.js | 365 ++++++++++++++++++++++ skins/layout_controlers.js.metadata | 2 + skins/layout_objects.js | 269 ++++++++++++++++ skins/layout_objects.js.metadata | 2 + skins/plinn_attachment_form.py | 28 ++ skins/plinn_attachment_template.pt | 56 ++++ skins/plinn_blank_iframe.html.pt | 43 +++ skins/plinn_doc.gif | Bin 0 -> 135 bytes skins/plinn_doc.thumb.gif | Bin 0 -> 1054 bytes skins/plinn_file_upload.gif | Bin 0 -> 386 bytes skins/plinn_icons/hidden_layer.gif | Bin 0 -> 333 bytes skins/plinn_icons/imagebox.gif | Bin 0 -> 301 bytes skins/plinn_icons/layer.gif | Bin 0 -> 257 bytes skins/plinn_icons/textarea.gif | Bin 0 -> 239 bytes skins/plinn_icons/visible_layer.gif | Bin 0 -> 536 bytes skins/plinn_image_upload.gif | Bin 0 -> 1046 bytes skins/plinn_init_javascript_code.dtml | 8 + skins/plinn_macros.pt | 66 ++++ skins/plinn_multilingual.js.pt | 17 + skins/plinn_multilingual.js.pt.metadata | 2 + skins/plinndocument_edit_control.py | 15 + skins/plinndocument_edit_form.py | 13 + skins/plinndocument_edit_template.pt | 69 ++++ skins/plinndocument_view.pt | 13 + skins/resize_handle.png | Bin 0 -> 184 bytes skins/xml_io.js | 132 ++++++++ skins/xml_io.js.metadata | 2 + 45 files changed, 2064 insertions(+) create mode 100755 HistoryAdapters.py create mode 100644 PlinnDocument.py create mode 100644 __init__.py create mode 100644 configure.zcml create mode 100644 graphics/delete_rectangle.psd create mode 100644 graphics/layer_status.psd create mode 100644 graphics/resize_handle.psd create mode 100755 interfaces.py create mode 100755 license.txt create mode 100644 profiles/default/types.xml create mode 100644 profiles/default/types/Plinn_Document.xml create mode 100644 skins/color_utils.js create mode 100644 skins/color_utils.js.metadata create mode 100644 skins/dd_trigger.js create mode 100644 skins/dd_trigger.js.metadata create mode 100644 skins/degrad_rectangle_header.gif create mode 100644 skins/delete_rectangle.gif create mode 100644 skins/delete_rectangle_hover.gif create mode 100644 skins/layout_controlers.js create mode 100644 skins/layout_controlers.js.metadata create mode 100644 skins/layout_objects.js create mode 100644 skins/layout_objects.js.metadata create mode 100644 skins/plinn_attachment_form.py create mode 100644 skins/plinn_attachment_template.pt create mode 100755 skins/plinn_blank_iframe.html.pt create mode 100644 skins/plinn_doc.gif create mode 100644 skins/plinn_doc.thumb.gif create mode 100644 skins/plinn_file_upload.gif create mode 100644 skins/plinn_icons/hidden_layer.gif create mode 100644 skins/plinn_icons/imagebox.gif create mode 100644 skins/plinn_icons/layer.gif create mode 100644 skins/plinn_icons/textarea.gif create mode 100644 skins/plinn_icons/visible_layer.gif create mode 100644 skins/plinn_image_upload.gif create mode 100644 skins/plinn_init_javascript_code.dtml create mode 100644 skins/plinn_macros.pt create mode 100644 skins/plinn_multilingual.js.pt create mode 100644 skins/plinn_multilingual.js.pt.metadata create mode 100644 skins/plinndocument_edit_control.py create mode 100644 skins/plinndocument_edit_form.py create mode 100644 skins/plinndocument_edit_template.pt create mode 100644 skins/plinndocument_view.pt create mode 100644 skins/resize_handle.png create mode 100644 skins/xml_io.js create mode 100644 skins/xml_io.js.metadata diff --git a/HistoryAdapters.py b/HistoryAdapters.py new file mode 100755 index 0000000..add0e8b --- /dev/null +++ b/HistoryAdapters.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +####################################################################################### +# Plinn - http://plinn.org # +# Copyright © 2005-2009 Benoît PIN # +# # +# This program is free software; you can redistribute it and/or # +# modify it under the terms of the GNU General Public License # +# as published by the Free Software Foundation; either version 2 # +# of the License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # +####################################################################################### +""" +Adapter to plug PlinnDocument to historycal interface. + +$Id: HistoryAdapters.py 647 2009-06-30 12:55:44Z pin $ +$URL: http://svn.cri.ensmp.fr/svn/PlinnDocument/branches/CMF-2.1/HistoryAdapters.py $ +""" + +from Globals import InitializeClass +from AccessControl import ClassSecurityInfo +from Products.CMFCore.permissions import ModifyPortalContent +from Products.Plinn.HistoryAdapters import DocumentHistory + +class PlinnDocumentHistory(DocumentHistory) : + + security = ClassSecurityInfo() + + security.declareProtected(ModifyPortalContent, 'restore') + def restore(self, key): + rev = self.getHistoricalRevisionByKey(key)[0] + self._content.edit(rev.Format(), rev.XMLBody()) + +InitializeClass(PlinnDocumentHistory) diff --git a/PlinnDocument.py b/PlinnDocument.py new file mode 100644 index 0000000..3267069 --- /dev/null +++ b/PlinnDocument.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- +####################################################################################### +# Plinn - http://plinn.org # +# Copyright (C) 2005-2007 Benoît PIN # +# # +# This program is free software; you can redistribute it and/or # +# modify it under the terms of the GNU General Public License # +# as published by the Free Software Foundation; either version 2 # +# of the License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # +####################################################################################### + +from Globals import InitializeClass +from AccessControl import ClassSecurityInfo +from Products.CMFCore.permissions import View, ModifyPortalContent +from Products.CMFCore.utils import getToolByName +from Products.CMFDefault.Document import Document +from OFS.PropertyManager import PropertyManager +from OFS.Folder import Folder +from OFS.Image import File, cookId +from zope.component.factory import Factory +from zope.interface import implements +from Products.Photo import Photo +from Products.Plinn.utils import makeValidId +from interfaces import IPlinnDocument +from cStringIO import StringIO +from sets import Set +import xml.dom.minidom as minidom +import re + +imgPattern = re.compile('', re.IGNORECASE) +imgWidthPattern = re.compile('style\s*=\s*".*width\s*:\s*([0-9]+)px') +imgHeightPattern = re.compile('style\s*=\s*".*height\s*:\s*([0-9]+)px') +imgSrcPattern = re.compile('src\s*=\s*"(.*)"') + +imgOrLinkPattern = re.compile('(.*?))"(.*?)>|(.*?))"(.*?)>', re.IGNORECASE) +EMPTY_PLINN_DOCUMENT = '' + + +def addPlinnDocument(self, id, title='', description='', text=''): + """ Add a Plinn Document """ + o = PlinnDocument(id, title, description, text) + self._setObject(id,o) + +class PlinnDocument(Document) : + """ Plinn document - WYSIWYG editor + based on XML and javascript + """ + implements(IPlinnDocument) + + security = ClassSecurityInfo() + + _cookedTexts = {} + + def __init__(self, id, title='', description='', text='') : + self.attachments = Folder('attachments') + Document.__init__(self, id, title=title, description=description, text_format='html', text=text) + + security.declareProtected(View, 'EditableBody') + def EditableBody(self, mergeLayers=True): + """ Transforms XML to HTML """ + + if self.text : + if not self._cookedTexts.has_key(self.absolute_url()) : + plinnElement = minidom.parseString(self.text).documentElement + + htmlDom = minidom.parseString('
') + htmlDomDoc = htmlDom.documentElement + + self._transformRectangles(plinnElement, htmlDomDoc) + firstChildStyle = htmlDomDoc.firstChild.getAttribute('style') + htmlDomDoc.setAttribute('style', firstChildStyle.replace('absolute', 'relative')) + + if mergeLayers : + mergedDom = minidom.parseString('
') + mergedDomDoc = mergedDom.documentElement + for layer in htmlDomDoc.childNodes : + for foreignchild in layer.childNodes : + child = mergedDom.importNode(foreignchild, True) + mergedDomDoc.appendChild(child) + + mergedDomDoc.setAttribute('style', htmlDomDoc.getAttribute('style')) + htmlDom = mergedDom + + htmlText = htmlDom.toprettyxml().replace('<', '<').replace('>', '>').replace('"', '"').replace('&', '&') + htmlText = htmlText.encode('utf8') + htmlText = htmlText.split('\n', 1)[1] + + htmlText = imgOrLinkPattern.sub(self._convertSrcOrHref, htmlText) + self._cookedTexts[self.absolute_url()] = htmlText + return htmlText + else : + return self._cookedTexts[self.absolute_url()] + else : + return '' + + def _convertSrcOrHref(self, m) : + dict = m.groupdict() + if dict['src'] : + tag = m.group().replace(dict['src'], self._genAbsoluteUrl(dict['src'])) + if not tag.endswith('/>') : + tag = tag[:-1] + '/>' + return tag + elif dict['href'] : + return m.group().replace(dict['href'], self._genAbsoluteUrl(dict['href'])) + else: + return m.group() + + def _genAbsoluteUrl(self, relUrl) : + if relUrl.find('attachments/') >=0 : + return self.absolute_url() + '/' + relUrl[relUrl.rindex('attachments/'):] + else : + return relUrl + + + security.declareProtected(ModifyPortalContent, 'XMLBody') + def XMLBody(self, REQUEST=None) : + """ return raw xml text """ + + if REQUEST is not None : + RESPONSE = REQUEST['RESPONSE'] + RESPONSE.setHeader('content-type', 'text/xml; charset=utf-8') + + manager = getToolByName(self, 'caching_policy_manager', None) + if manager is not None: + view_name = 'XMLBody' + headers = manager.getHTTPCachingHeaders( + self, view_name, {} + ) + + for key, value in headers: + if key == 'ETag': + RESPONSE.setHeader(key, value, literal=1) + else: + RESPONSE.setHeader(key, value) + if headers: + RESPONSE.setHeader('X-Cache-Headers-Set-By', + 'CachingPolicyManager: %s' % + '/'.join(manager.getPhysicalPath())) + + + return Document.EditableBody(self) or EMPTY_PLINN_DOCUMENT + + + security.declareProtected(ModifyPortalContent, 'addAttachment') + def addAttachment(self, file, formId) : + """ Add attachment """ + id, title = cookId('', '', file) + + id = makeValidId(self.attachments, id) + + if formId == 'ImageUploadForm': + fileOb = Photo(id, title, file, thumb_height=300, thumb_width=300) + else : + fileOb = File(id, title, '') + fileOb.manage_upload(file) + + self.attachments._setObject(id, fileOb) + fileOb = getattr(self.attachments, id) + return fileOb + + + def _transformRectangles(self, inNode, outNode) : + + for node in [ node for node in inNode.childNodes if node.nodeName == 'rectangle' ] : + if node.getAttribute('visibility') == 'hidden' : + continue + + divRect = outNode.ownerDocument.createElement('div') + outNode.appendChild(divRect) + + styleAttr = 'position:absolute' + styleAttr += ';width:%spx' % node.getAttribute('width') + styleAttr += ';height:%spx' % node.getAttribute('height') + + for subNode in node.childNodes : + if subNode.nodeName == 'upperLeftCorner' : + for point in subNode.childNodes : + if point.nodeName == 'point' : + styleAttr += ';left:%spx' % point.getAttribute('x') + styleAttr += ';top:%spx' % point.getAttribute('y') + divRect.setAttribute('style', styleAttr) + break + + elif subNode.nodeName == 'rawData' : + rawData = subNode.firstChild + if rawData : + textNode = outNode.ownerDocument.createTextNode(self.getElementTransform(node.getAttribute('elementKey'))(node, rawData.nodeValue)) + divRect.appendChild(textNode) + + self._transformRectangles(node, divRect) + + + security.declarePrivate('renderImg') + def renderImg(self, node, raw) : + width = int(node.getAttribute('width')) + height = int(node.getAttribute('height')) + + photoId = raw.split('/')[-2] + photo = self._resizePhoto(photoId, width, height) + + alt = 'image' + return '%(alt)s' % \ + {'src' : photo.absolute_url(), 'width' : width, 'height' : height, 'alt' : alt} + + + security.declarePrivate('renderEpozImg') + def renderEpozImg(self, node, raw): + for img in imgPattern.findall(raw) : + width = imgWidthPattern.findall(img) + if width : width = int(width[0]) + + height = imgHeightPattern.findall(img) + if height : height = int(height[0]) + + if not (width or height) : continue # default size + + photoId = imgSrcPattern.findall(img)[0].split('/')[-2] + self._resizePhoto(photoId, width, height) + + return raw + + + def _resizePhoto(self, photoId, width, height): + photo = getattr(self.attachments, photoId) + + nts = [width, height] + landscape = width > height + if landscape : + nts.reverse() + + thumbSize = {'width': photo.thumb_width, 'height': photo.thumb_height} + + if thumbSize['width'] != nts[0] or thumbSize['height'] != nts[1] > 1 : + photo.manage_editProperties(thumb_width=nts[0], thumb_height=nts[1]) + + return photo + + + security.declarePrivate('getElementTransform') + def getElementTransform(self, elementKey) : + transforms = {'IMG_ELEMENT': self.renderImg, + 'EPOZ_ELEMENT': self.renderEpozImg} + return transforms.get(elementKey, lambda node, raw : raw) + + def _edit(self, text): + """ Edit the Document and cook the body. + """ + Document._edit(self, text) + self._removeUnusedAttachments() + self._cookedTexts = {} + + + def _removeUnusedAttachments(self) : + if not(self.attachments.objectIds() and self.XMLBody()) : return + + reAttachments = re.compile('|'.join( [r'\b%s\b' % id for id in self.attachments.objectIds()] )) + xml = self.XMLBody() + attSet = Set(self.attachments.objectIds()) + useSet = Set(reAttachments.findall(xml)) + self.attachments.manage_delObjects([att for att in attSet - useSet]) + + +InitializeClass(PlinnDocument) +PlinnDocumentFactory = Factory(PlinnDocument) \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a2dc2a1 --- /dev/null +++ b/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +####################################################################################### +# Plinn - http://plinn.org # +# Copyright (C) 2005-2007 Benoît PIN # +# # +# This program is free software; you can redistribute it and/or # +# modify it under the terms of the GNU General Public License # +# as published by the Free Software Foundation; either version 2 # +# of the License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # +####################################################################################### + +from Products.CMFCore import utils +from Products.CMFCore.permissions import AddPortalContent + +import PlinnDocument + +contentClasses = (PlinnDocument.PlinnDocument,) +contentConstructors = (PlinnDocument.addPlinnDocument,) + +def initialize(registrar) : + utils.ContentInit( + 'Plinn Content', + content_types = contentClasses, + permission = AddPortalContent, + extra_constructors = contentConstructors, + ).initialize(registrar) \ No newline at end of file diff --git a/configure.zcml b/configure.zcml new file mode 100644 index 0000000..e72308a --- /dev/null +++ b/configure.zcml @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/graphics/delete_rectangle.psd b/graphics/delete_rectangle.psd new file mode 100644 index 0000000000000000000000000000000000000000..8a6823c8b40188de90c889682e5842a37a50ac50 GIT binary patch literal 24724 zcmeHP3s_TEw%$pA1Vj+Uw)FL-wiTTg0{8+h;zjV)5v771+xh%@LvnzWki_JmsB@=N zwYJkvt8J&+YRAXS)aUfhOlOoj^MNz%%oGw|tuMm+74o9iJ_IWyxohon@1i`(rKHWskPYNP z?VNm`s)A9k$WfIs8Uyq-bNWnPcpxLV#N+-F$tX97^GedSg?bdXkRTT{ZGvowx8nfw3 z^(qGL4TN`Qa)#_W8lr^~S1e-;T6H-UoRuQ;$_A2svX2ig8%Xxa`bC#(RBUDn--iL@ zTcf%P`4Dpsi~z+!EdN(M>c5l<8KY)!Oa=g6GCx|SBE3kfFO##Ga-B}C zQqbF0wpyd)9hh&x88W}<;Dg{SI`~oWs4}0A1`B%&KBJ9{NXet>8dcYbG%zCJQFM)} zYeX6tk?<(GM%6VU4U9;56kVh08j%J@Bs_|)QFV<-10xb1Mc1ghMx=oe34dL5Mfi95 z84YahuYo;$f=>ZN4txr5&pzOnsimtKJ#I43o&e46HP7`P{{evZa#}WU?&Sx?rT)+A>`^%jjjYoPr!_-r`011+c-N zB$LfsGD$iqU_&2wIvBb&4}u0+o?feC^z7QjP-_AdNK~@QNzfkGOi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@>>>Sn~|M`Nytvckk3n33a$|hcw zy)rIgWscr$i?Kp@L6LC;0}9(ue_P>NKz`b9BUX^Kh)bEc`J3)gmiAj>F}6ThSS(!@ z%QGLeRxD`!U<1Iyh_H~nGB5A__jk;HrNiAWg7D(9`?IJsRTLN7-|he4`Tlpe^?`9g zOuW4M;DI$SQ%qEy>goa)!eQdg_pBG+djp(EoEH;&Uxe95e*%BtML0~~N8QS6FYLW2v$z*Vyl&Te{!@WSXvLKu$( z^d*P^7hoim3n%~yV~Ld7goh!9kO2zt98c~d<8junLcq{v6qt+9wXGbPodZk32-M)XU*ZmwSCmHysiAN{myHSvE1ZYH{$GXw7TpP zhwWHxM`z73o68>Iux{MG^pWiwt#*gY9%Z7w|4{nvTe5FYKL{Q|48Eha1$;-pZS0|i z6_3PKEIf#_YsE?Jiq)kpy8YorX{*pzSdW~%2%h8Q5m#5Zbyeo-Gp0n|`WhK;!RMuO-Tch6q-cw5rv*Qd)N>Qw%6Y6afZ_Ump$FzE~E{D32+_Frk6@~?kIW5)ZZdGUwx{x^HlXYa3kR- zUR?Q$pR9cGLAM&9IjnL@FHLCq6;Zp nUFE^93(W|~kj`OfLoqaPMjguc&7q7sjqj7w7%RD6UG= literal 0 HcmV?d00001 diff --git a/graphics/layer_status.psd b/graphics/layer_status.psd new file mode 100644 index 0000000000000000000000000000000000000000..5725cb700aa1f2e2fe0364d89390890818fb7a6e GIT binary patch literal 21548 zcmeG^3v?XSb#Hg||62ZllN8RPfCWwVE6bAhNOEP#wv=k^MOuTQ?V+%Mn#4((lGwDEgikmVrc9I8BupJ*&K~|HCYzN z1b7%$R7+qLp5I7R6nn> zijdX>S@L4jOhV3R-7T4nz(rQIwTD_0?O|U>YbWCig}6>%VpS&xAeR_rSBBc!S+1qV zYc|PG3Rzxr8pRx|S+BPX!APGh%E}06obOo~?p)cqsy*D<))mOlgW3)Hm@vtUoBM?n zFR8$5PpH)-&d$OY zVGBuH*^VBwaghN*)nsL=rzl7e{rI%p83V84kq(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G!_0=Q$_r0y_PaS!2@BI(l`^-;|J@HHZ zwSU^N<9m1CwPW|gho9H~{pFo|^_@F+9^L)O|LAYN`7k7R{{8Wn{}F1K(f91w@$Kp9 zdw&kVcYgNz^z`Y24<3cIe&*QT$NzN?O(HmR>Xgx)2sn-sJE#m>J4TmTSBIW*U*P3H YIe?=G7=;5uBe9P>Ae%*7HpnpfzvMI#K>z>% literal 0 HcmV?d00001 diff --git a/graphics/resize_handle.psd b/graphics/resize_handle.psd new file mode 100644 index 0000000000000000000000000000000000000000..2baf5c073d21cb754249d74ef06f69be560be8b9 GIT binary patch literal 23898 zcmeG^2Y6J))^oRKv+0Enn-CJ(W_QyQQV1y|kdTmsDhgX}k|o>Nl7fXIq5@A45ot;h zK|}!y)dmQn!lNlg5nqspfFK4TblCsQY+sUKe9HHJUv9p8@0oMX%$zxMX6D>8J4qT) zT#6`Uy;$%Pkei2?R#b^LX+VA<3sVr{c4i>NfIoukL2&-Lg5REx+%o*T4NIuy8&=P$ zA+!igYuAvPQLC3Js%Vo?PFJY3X;Hs^_-T|-rA&(&5nm`N)MwF^s=SE?x^&`@GR4Fy zMY1v~Bb}dGn^LRMYiN^9SgTQMjVZNhQ8J}YPNx8j(c&l}VKG&uMU5;h7MgTAb(P8_ zjE$CvVv_m_%MCIOU86Hp38m2qQBa^kS)Njooog!&QfX0@CX+rzEUu}kiLQx_))^|q z(&Xf1u_Q(u6C(l+k+Du|lGTc|#_muX5koc7kxgriCK5#}bQ-a0q*xj)5kp0MA*m{x zHYyA%y-B6h3USpkxz21#i!z&4%9NyXI!Rd`7bi+q#41HnsZu6NN|48j6y=iG#3Y46 zo*0`P#TVMDq-#}9S=}nd6nnKoVJc3hWa-p8Ln&ySPM4;NJyB4om91D+ORGm_t2DIM z2qLCSV{FWx1os@Hn#(J&;iRb%tI4~MOVAV-$a zMxEMB7!zZ}c3xMsgLhQZysl^muak9{R%J>Dt0mQWpdXIvYGuvzIS^bF2dR`S11&Sr z*>I=FNF)g&Nem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ss`h+C-{ZCz>f`Tww$i?HY`t7E(hLyY#vcu^aYIIzZL}FHWqOi!jy5h%|COW7 zzTf9C5%{WV`mfQ_^dH#Re`5~33Nzq~g9kef@ClB5Vc)^u&V-l!kjmdz?sZL z=%$ky@b}OyxAa|f+bw+u-Em9bMt9xPx6nPe^iB8*aR>wD-$34|6OkFqop&9`ya){8 z`x<2C*r<(AFpE&GLY2_+yeoiV0QEOWqln9}vC@1WH`n(Uo^9RV-=YSxni7u!52u*P z@WA7@7~Cg}z@CBQI_H2a=jJ-#b8}DHVGq#8kFhp>D@gd80D<3*1%4-Z(gn0vh2L%R u*c9WcA8W6Xr^E?M&N^T`o@|!~XyeCN8^0AK{7rzsZ^r_^6U=h~(f + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/profiles/default/types.xml b/profiles/default/types.xml new file mode 100644 index 0000000..04e5f83 --- /dev/null +++ b/profiles/default/types.xml @@ -0,0 +1,4 @@ + + + + diff --git a/profiles/default/types/Plinn_Document.xml b/profiles/default/types/Plinn_Document.xml new file mode 100644 index 0000000..bce5392 --- /dev/null +++ b/profiles/default/types/Plinn_Document.xml @@ -0,0 +1,42 @@ + + + Plinn Document + Plinn Documents contain text and images that can be layout with WYSIWYG and drag&drop editor. + plinn_doc.gif + Plinn Document + + plinndocument + object/edit + True + True + + False + + + + + + + + + + + + + + + + + + diff --git a/skins/color_utils.js b/skins/color_utils.js new file mode 100644 index 0000000..7c70d07 --- /dev/null +++ b/skins/color_utils.js @@ -0,0 +1,117 @@ +// (c) Benoît PIN 2006-2007 +// http://plinn.org +// Licence GPL + +function HSVColor(h, s, v) { + this.h = h; // 0-360° + this.s = s; // 0-100% + this.v = v; // 0-100% +} + +HSVColor.prototype.toRGBString = function() { + var rgb = this.toRGB(); + return "rgb(" + String(rgb[0]) + ", " + String(rgb[1]) + ", " + String(rgb[2]) + ")"; +}; + +HSVColor.prototype.toRGB = function () { + var h = this.h; var s = this.s/100.0; + var v = this.v/100.0; + if( s == 0 ) // achromatic (grey) + r = g = b = v; + + h = h/60; // sector 0 to 5 + var i = Math.floor( h ); + var f = h - i; // factorial part of h + var p = v * ( 1 - s ); + var q = v * ( 1 - s * f ); + var t = v * ( 1 - s * ( 1 - f ) ); + switch( i ) { + case 0: + r = v; + g = t; + b = p; + break; + case 1: + r = q; + g = v; + b = p; + break; + case 2: + r = p; + g = v; + b = t; + break; + case 3: + r = p; + g = q; + b = v; + break; + case 4: + r = t; + g = p; + b = v; + break; + default: // case 5: + r = v; + g = p; + b = q; + break; + } + + r = Math.round(r*255); + g = Math.round(g*255); + b = Math.round(b*255); + return [r, g, b]; +}; + + +function ColorIterator(baseH, baseS, baseV, step) { + this.baseColor = new HSVColor(baseH, baseS, baseV); + this.currentH = baseH; + this.step = step; +} + +ColorIterator.prototype.next = function() { + var c = new HSVColor(this.currentH, this.baseColor.s, this.baseColor.v); + this.currentH += this.step; + + if (this.currentH >= 360) + this.currentH -= 360; + + return c; +}; + +function setBorderColor(ob, colorString) { + var s = ob.style; + s.borderBottomColor = colorString; + s.borderLeftColor = colorString; + s.borderRightColor = colorString; + s.borderTopColor = colorString; +} + + +function setBorderStyle(ob, borderStyle) { + var s= ob.style; + s.borderBottomStyle = borderStyle; + s.borderLeftStyle = borderStyle; + s.borderRightStyle = borderStyle; + s.borderTopStyle = borderStyle; +} + + +function setBorderWidth(ob, borderWidth) { + var s= ob.style; + s.borderBottomWidth = borderWidth; + s.borderLeftWidth = borderWidth; + s.borderRightWidth = borderWidth; + s.borderTopWidth = borderWidth; +} + +function zfill(number, digits) { + number = Math.floor(number); + var nStr = String(number); + while (nStr.length < digits) + nStr = "0" + nStr; + return nStr; +} + diff --git a/skins/color_utils.js.metadata b/skins/color_utils.js.metadata new file mode 100644 index 0000000..855fecc --- /dev/null +++ b/skins/color_utils.js.metadata @@ -0,0 +1,2 @@ +[default] +cache=HTTPCache diff --git a/skins/dd_trigger.js b/skins/dd_trigger.js new file mode 100644 index 0000000..b79f37e --- /dev/null +++ b/skins/dd_trigger.js @@ -0,0 +1,69 @@ +// (c) Benoît PIN 2006-2007 +// http://plinn.org +// Licence GPL + +function ddEventDispatch() { + addListener(document, 'mousedown', raisemousedown); + addListener(document, 'mousemove', raisemousemove); + addListener(document, 'mouseup', raisemouseup); +} + + +function getRectangleNode() { + var docid = document.id; + docid = document.id.slice(DocPrefixLength); + var frameId = IFramePrefix + docid; + iframe = window.parent.document.getElementById(frameId); + if (!iframe) + iframe = window.parent.document.getElementById("EpozEditor"); + return iframe.parentNode; +} + +var raisemousedown, raisemousemove, raisemouseup; + +if (browser.isIE55 || browser.isIE6up) { + raisemousedown = function() { + var rect = getRectangleNode(); + rect.fireEvent('onmousedown', window.event); + }; + + raisemousemove = function() { + var rect = getRectangleNode(); + rect.fireEvent('onmousemove', window.event); + rect.fireEvent('onmouseover', window.event); + }; + + raisemouseup = function() { + var rect = getRectangleNode(); + rect.fireEvent('onmouseup', window.event); + }; +} +else if (browser.isDOM2Event) { + // initMouseEvent("eventType", bubblesFlas, cancelableFlag, view, detailVal, screenX, screenY, clientX, clientY, ctrlKeyFlag, altKeyFlag, shiftKeyFlag, metaKeyFlag, buttonCode, relatedTargetNodeRef) + + raisemousedown = function(e) { + var event = document.createEvent("MouseEvents"); + var rect = getRectangleNode() + event.initMouseEvent("mousedown", true, true, window.parent, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, rect); + rect.dispatchEvent(event); + }; + + + raisemousemove = function(e) { + var overEvent = document.createEvent("MouseEvents"); + overEvent.initMouseEvent("mouseover", true, true, window.parent, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, rect); + var event = document.createEvent("MouseEvents"); + var rect = getRectangleNode() + event.initMouseEvent("mousemove", true, true, window.parent, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, rect); + rect.dispatchEvent(event); + rect.dispatchEvent(overEvent); + }; + + + raisemouseup = function(e) { + var event = document.createEvent("MouseEvents"); + var rect = getRectangleNode() + event.initMouseEvent("mouseup", true, true, window.parent, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, rect); + rect.dispatchEvent(event); + }; +} diff --git a/skins/dd_trigger.js.metadata b/skins/dd_trigger.js.metadata new file mode 100644 index 0000000..855fecc --- /dev/null +++ b/skins/dd_trigger.js.metadata @@ -0,0 +1,2 @@ +[default] +cache=HTTPCache diff --git a/skins/degrad_rectangle_header.gif b/skins/degrad_rectangle_header.gif new file mode 100644 index 0000000000000000000000000000000000000000..721dc3571638bff4cda185476305264b4f08e92f GIT binary patch literal 92 zcmZ?wbhEHbWMtrG*v!E2`0=9$5AMHw_2Sme8?Ro!eE#Cu)2B~fzj^ij`}aF{Zr{9l fg8>yN{$v3Q=zvI&84N6(0_s*)-tJ>Py_V3&O z^5ygIKfX_&KKgCH9tAV=O z+x7v$-n|bWK4@=mI{^g8k2f_nZQr)-?3puHu3Uce=JnmXw`WYB{_Xp>*4CEKpFiEY zb#uXj`4cAe-@A8r#mW_FX(?w;pMLu6$;($SzJLGr`t_^t-@o6wdE@5I8~^|RXFvst zKUu&6Iv^6{Ck8e@hhuNUR^JUW?RhKI&FizxmFd}s17?D~TnCaESvn4Qgv~m^wWwcZ vbJRtRX>CsK*9!yKoY<49Lp<0Ob@lXg71S;CjZI99^(`$eCQi0+WUvMRp*^Rj literal 0 HcmV?d00001 diff --git a/skins/delete_rectangle_hover.gif b/skins/delete_rectangle_hover.gif new file mode 100644 index 0000000000000000000000000000000000000000..fba2ab657c7e8ed46c15983441b3208ffb827b4a GIT binary patch literal 304 zcmV-00nh$NNk%w1VF&;V0M!5hZag}KYiD~#L)zNegllNXnwW)zgP@_HgmQ7NcW8uh zaLLHX@4~m~>geg|=-H{8-rn8c-`%r>gRH8m#$;0K?CPyVIqdA}iBL_(Wm0ZCI@ze2 zdqqR7c4+ta_n@GlkBf_|si|5mEX|gWr>Lj*`1jo0+oq?c$jHdu-Q13gimXF9@4~i3 z7#4Wn-F-joR7RmywX@=;!S0>%Lt{<>utf%*%U5L`4}F_xJYM+1LO8 z00000A^8LV00000EC2ui00;mJ000I}K%P+ODe)?{Q!GZZU23iu4E8eACYs$yumgk? ztJ_X=vmgSQolerC5NI3>i&4#}u Cq?f+{ literal 0 HcmV?d00001 diff --git a/skins/layout_controlers.js b/skins/layout_controlers.js new file mode 100644 index 0000000..c0a383e --- /dev/null +++ b/skins/layout_controlers.js @@ -0,0 +1,365 @@ +// (c) Benoît PIN 2006-2007 +// http://plinn.org +// Licence GPL + +// Global variables +var CURRENT_LAYER; +var LAYER_MANAGER; +var XML_OUTPUT; +var PLINN_DOCUMENT_URL; +var GLOBAL_DD_CONTROLER; + +function initPlinn(root_container, xmlDataUrl) { + PLINN_DOCUMENT_URL = document.getElementById("PlinnDocumentUrl").innerHTML; + form_path = PLINN_DOCUMENT_URL+'/'; // for epoz + initElementsPool(); + initWidgets(); + var imp = new XMLImport(xmlDataUrl, root_container); + GLOBAL_DD_CONTROLER = new GlobalPlinnDDControler(root_container); +} + + +function initWidgets() { + // Global control widgets + XML_OUTPUT = document.getElementById("xml_output") +} + +function initLayerManager(root_container) { + LAYER_MANAGER = new LayerManager(root_container, new ColorIterator(240, 80, 60, 83)); // todo : move in config file +} + +function Point(x, y) { + this.x = x; + this.y = y; +} +Point.prototype.difference = function(point) { return new Point(this.x - point.x, this.y - point.y); }; +Point.prototype.addition = function(point) { return new Point(this.x + point.x, this.y + point.y); }; +Point.prototype.toString = function() { return "(" + String(this.x) + ", " + String(this.y) + ")"; }; + + +function GlobalPlinnDDControler(root_container) { + this.root_container = root_container; + this.dragInProgress = false; + + this.currentRect = null; + this.dragAllowed = null; + this.resizeAllowed = null; + this.scalable = null; + this.deleteAllowed = null; + + + //Constants + this.DRAG_MODE = 0; + this.RESIZE_MODE = 1; + + this.mode = this.DRAG_MODE; + this.ddEventCaptureElmt = document; + + // event listeners + var thisControler = this; + with (this.root_container) { + onmouseover = function(evt){thisControler.onmouseover(evt);}; + onmouseout = function(evt){thisControler.onmouseout(evt);}; + } + with (this.ddEventCaptureElmt) { + onmousedown = function(evt){thisControler.onmousedown(evt);}; + onmousemove = function(evt){thisControler.onmousemove(evt);}; + onmouseup = function(evt){thisControler.onmouseup(evt);}; + } +} + +GlobalPlinnDDControler.prototype.onmouseover = function(evt) { + if (this.dragInProgress) return; + var ob = getTargetedObject(evt); + var rect = ob.rectangle; + if (!rect) return; + rect.showHandles(); +}; + +GlobalPlinnDDControler.prototype.onmouseout = function(evt) { + if (this.dragInProgress) return; + var ob = getTargetedObject(evt); + var rect = ob.rectangle; + if (!rect) return; + rect.hideHandles(); +}; + +GlobalPlinnDDControler.prototype.onmousedown = function(evt) { + var ob = getTargetedObject(evt); + var rect = ob.rectangle; + + if (!rect) return; + + this.currentRect = rect; + this.setDDOptions(rect.ddOptions); + + var evt = getEventObject(evt); + if (this.deleteAllowed && ( + (evt.shiftKey && evt.altKey) || + (ob.tagName == "IMG" && ob.className=="rectangle_delimg")) ) { + if (confirm(PlinnLang["Do you realy want to delete ?"])) { + var hostDiv = rect.hostDiv; + hostDiv.parentNode.removeChild(hostDiv); + } + return; + } + + this.originalClickPoint = new Point(evt.screenX, evt.screenY); + this.originalSize = new Point(rect.width, rect.height); + this.offsetPoint = rect.upperLeftCorner.difference(this.originalClickPoint); + + if (evt.shiftKey || (ob.tagName == "SPAN" && ob.className=="resize_handle")) { + this.mode = this.RESIZE_MODE; + this.startDrag(evt, rect); + } + else if(evt.altKey || (ob.tagName == "DIV" && ob.className=="rectangle_header")){ + this.mode = this.DRAG_MODE; + this.startDrag(evt, rect); + } +}; + +GlobalPlinnDDControler.prototype.onmousemove = function(evt) { + var evt = getEventObject(evt); + if (this.dragInProgress) { + var rectangle = this.currentRect; + if (this.dragAllowed && (this.mode == this.DRAG_MODE)) { + var relativeEvtPoint = new Point(evt.screenX, evt.screenY).addition(this.offsetPoint); + rectangle.moveTo(relativeEvtPoint); + } + else if (this.resizeAllowed && (this.mode == this.RESIZE_MODE)) { + var delta = new Point(evt.screenX, evt.screenY).difference(this.originalClickPoint); + var size = this.originalSize.addition(delta); + if (this.scalable) { + size = new Point(size.x, Math.round(size.x * rectangle.ratio)); + } + + rectangle.resizeTo(size); + } + if (browser.isIE) { + try {document.selection.clear();} + catch (e){return;} + } + } +}; + +GlobalPlinnDDControler.prototype.onmouseup = function(evt) { + this.drop() + var rectangle = this.currentRect; + if (rectangle && rectangle.ondrop) + rectangle.ondrop(); +}; + + +GlobalPlinnDDControler.prototype.startDrag = function(evt, rect) { + disablePropagation(evt); + disableDefault(evt); + this.dragInProgress = true; +}; + +GlobalPlinnDDControler.prototype.drop = function() {this.dragInProgress = false;}; + +GlobalPlinnDDControler.prototype.setDDOptions = function(options){ + this.dragAllowed = (options & 1) == 1; + this.resizeAllowed = (options & 2) == 2; + this.scalable = (options & 4) == 4; + this.deleteAllowed = (options & 8) == 8; +}; + + + +function LayerManager(main_space, colorIterator) { + this.space = main_space; + this.layers = new Array(); + this.defaultLayerWidth = 800; + this.defaultLayerHeight = 600; + this.colorIterator = colorIterator; + this.layerSelector = document.getElementById('layerSelector'); + var thisManager = this; + + // add layer selector commands + // separator between layers list and layer commandes + var sepOpt = document.createElement("option"); + sepOpt.innerHTML = "--------"; + sepOpt.disabled = "disabled"; + sepOpt.style.color = "#888"; + + // new layer command + var addLayerOpt = document.createElement("option"); + addLayerOpt.value = "add"; + addLayerOpt.innerHTML = PlinnLang["New layer"]; + addLayerOpt.style.color = "#000"; + + // remove layer command + var removeLayerOpt = document.createElement("option"); + removeLayerOpt.value = "rm"; + removeLayerOpt.innerHTML = PlinnLang["Remove layer"]; + removeLayerOpt.disabled = "disabled"; + + with (this.layerSelector) { + appendChild(sepOpt); + appendChild(addLayerOpt); + appendChild(removeLayerOpt); + } + addListener(this.layerSelector, 'change', function(){thisManager.activateLayer();}); +} + +LayerManager.prototype.addLayer = function(position) { + var color = this.colorIterator.next(); + var mode = 6; // resize and delete + if (this.layers.length <= 1) + mode = 2; // resize only + var l = new Rectangle(new Point(0, 0), this.defaultLayerWidth, this.defaultLayerHeight, "DIV_ELEMENT", 2); + setBorderColor(l, color.toRGBString()); + l.onresize = resizeOnMouseMove; + l.ondrop = resizeOnDrop; + l.style.overflow = "hidden"; + l.draw(this.space, position); + var index = this.layers.push(l) - 1; + + var opt = document.createElement("option"); + strId = String(index); + opt.value = strId; + opt.id = "layer_" + strId; + opt.innerHTML = PlinnLang["Layer "] + strId; + opt.style.color = color.toRGBString(); + this.layerSelector.insertBefore(opt, this.layerSelector.childNodes[this.layers.length-1]); + + // If there's only one layer, the remove command is disabled. + if (this.layers.length > 1) { + var rmCommand = this.layerSelector.childNodes[this.layerSelector.length -1] + rmCommand.removeAttribute("disabled"); + rmCommand.style.color="#000"; + } + this.activateLayer(index); +}; + +LayerManager.prototype.activateLayer = function(index) { + var layerSelector = this.layerSelector; + var index = (index != null) ? index : layerSelector.value; + // handle commands + index = ( Number(index) || Number(index ) == 0 ) ? Number(index) : index + + if (typeof(index) == typeof('')) { + switch (index) { + case "add" : + this.addLayer(); + break; + case "rm" : + this.removeCurrentLayer(); + break; + }; + return; + } + + CURRENT_LAYER = this.layers[index]; + this._syncLayerStatusImage(); + var opt = document.getElementById("layer_" + String(index)); + layerSelector.selectedIndex = opt.index; + layerSelector.style.color = opt.style.color; + this.putCurrentLayerOnTop(); +}; + + +LayerManager.prototype.putCurrentLayerOnTop = function() { + for(var i = 0 ; i < this.layers.length ; i++) { + layer = this.layers[i]; + if (layer == CURRENT_LAYER) + layer.style.zIndex = String(this.layers.length); + else + layer.style.zIndex = String(i); + } +}; + +LayerManager.prototype.toggleLayerVisibility = function(){ + var currentVisibility = CURRENT_LAYER.style.visibility; + if (currentVisibility == "hidden") + CURRENT_LAYER.style.visibility = "visible"; + else + CURRENT_LAYER.style.visibility = "hidden"; + + this._syncLayerStatusImage(); +}; + +LayerManager.prototype._syncLayerStatusImage = function() { + var layerStatusImage = document.getElementById("layer_status"); + if (CURRENT_LAYER.style.visibility == "hidden") { + layerStatusImage.src = "plinn_icons/hidden_layer.gif"; + layerStatusImage.title = PlinnLang["Show layer"]; + } + else { + layerStatusImage.src = "plinn_icons/visible_layer.gif"; + layerStatusImage.title = PlinnLang["Hide layer"]; + } +}; + +LayerManager.prototype.removeCurrentLayer = function() { + var layersLength = this.layers.length; + var layerSelector = this.layerSelector; + var layer, deletedLayerIndex; + for (var i = 0 ; i < layersLength ; i++) { + layer = this.layers[i]; + if (layer == CURRENT_LAYER) { + if (confirm(PlinnLang["confirm_layer_delete"] + i + "\" ?")) { + this.space.removeChild(layer.hostDiv); + this.layers.splice(i, 1); + layerSelector.removeChild(layerSelector.childNodes[i]); + deletedLayerIndex = i; + break; + } + else { + this.activateLayer(i); + return; + } + } + } + + // update layer indexes + for (var i = 0 ; i < this.layers.length ; i++) { + layerSelector.childNodes[i].value = String(i); + layerSelector.childNodes[i].id = "layer_" + String(i); + layerSelector.childNodes[i].innerHTML = PlinnLang["Layer "] + String(i); + } + + if (this.layers.length == 1) { + var removeCmdOpt = layerSelector.childNodes[layerSelector.childNodes.length - 1]; + removeCmdOpt.disabled = "disabled"; + removeCmdOpt.style.color = "#888"; + } + + if (deletedLayerIndex == 0) + this.layers[0].style.position = "relative"; + + // activate previous layer + this.activateLayer((deletedLayerIndex > 0) ? --deletedLayerIndex : 0); + +}; + +function resizeOnMouseMove() { + if (LAYER_MANAGER.layers.length > 5) + return; // to expensive + else + _resizeAllLayers(this); +} + +function resizeOnDrop() { _resizeAllLayers(this);} + +function _resizeAllLayers(layer) { + var layers = LAYER_MANAGER.layers; + var size = new Point(layer.width, layer.height); + var l; + for(var i = 0 ; i < layers.length ; i++) { + l = layers[i]; + if (layer != l) + l.resizeTo(size, true); + } + LAYER_MANAGER.defaultLayerWidth = size.x; + LAYER_MANAGER.defaultLayerHeight = size.y; +} + +function CreateAttachmentLink(data) { + // data like that : "title[attachment/a_file] + var title = data.split("\[", 1)[0]; + var url =data.match(/\[(.*)\]/)[1]; + var link ="" + title + ""; + InsertHTML(link); +} \ No newline at end of file diff --git a/skins/layout_controlers.js.metadata b/skins/layout_controlers.js.metadata new file mode 100644 index 0000000..855fecc --- /dev/null +++ b/skins/layout_controlers.js.metadata @@ -0,0 +1,2 @@ +[default] +cache=HTTPCache diff --git a/skins/layout_objects.js b/skins/layout_objects.js new file mode 100644 index 0000000..2d4ca89 --- /dev/null +++ b/skins/layout_objects.js @@ -0,0 +1,269 @@ +// (c) Benoît PIN 2006-2007 +// http://plinn.org +// Licence GPL + +var ELEMENTS_POOL = {}; + +function initElementsPool() { + // Element pool (for cloning) + ELEMENTS_POOL["DIV_ELEMENT"] = {"node" : document.getElementById("div"), + "beforeDraw" : null, + "getRawData" : null, + "putData" : null }; + + imgBeforeDraw = function() { + if (!this.node.src) { + var dispatch = document.getElementById("ImgDispatcher"); + var strRatio = dispatch.value.split("_", 1)[0]; + var src = dispatch.value.substring(strRatio.length+1); + this.ratio = new Number(strRatio).valueOf(); + this.node.src = PLINN_DOCUMENT_URL + '/' + src; + var w = this.width; + var size = (this.ratio > 1) ? + new Point(w, Math.round(w * this.ratio)) : + new Point(Math.round(w / this.ratio), w); + + this.resizeTo(size); + } + } + + ELEMENTS_POOL["IMG_ELEMENT"] = {"node" : document.getElementById("img"), + "beforeDraw" : imgBeforeDraw, + "getRawData" : function() { + var src = this.node.src; + src = src.split('/'); + return "attachments/" + src[src.length - 2] + "/getThumbnail"; + }, + "putData" : function(raw) { + this.node.src = PLINN_DOCUMENT_URL+"/attachments/"+raw; + } + }; + + epozBeforeDraw = function() { + var rect = this + var iframe = this.node.childNodes[0]; + var name = String(Math.floor(Math.random() * 10000)); + addListener(iframe, 'load', function(){initTextRectangle(iframe, name, rect);}); + + var ta = this.node.childNodes[1]; + ta.name = name; + ta.id = name; + } + + ELEMENTS_POOL["EPOZ_ELEMENT"] = {"node" : document.getElementById("epoz"), + "beforeDraw" : epozBeforeDraw, + "getRawData" : function() { + return this.node.childNodes[0].contentWindow.document.body.innerHTML; + }, + "putData" : function(raw) { + this.node.childNodes[1].value = raw; + } + }; + + for (var i = 0 ; i < ELEMENTS_POOL.length ; i++) + ELEMENTS_POOL[i].removeAttribute("id"); +} + +function Rectangle(upperLeftCorner, width, height, elementKey, ddOptions, ratio) { + this.meta_type = "Rectangle"; // ;-) + this.upperLeftCorner = upperLeftCorner; + this.width = width; + this.height = height; + this.elementKey = elementKey; + this.node = ELEMENTS_POOL[elementKey]["node"].cloneNode(true); + with (this.node.style) { + width="100%"; + height="100%"; + } + this.beforeDraw = ELEMENTS_POOL[elementKey]["beforeDraw"]; + this.getRawData = ELEMENTS_POOL[elementKey]["getRawData"]; + this.ddOptions = (!ddOptions) ? 11 : ddOptions; // 11-> drag, resize, delete + this.ratio = ratio; + + this.hostDiv = document.createElement("div"); + this.hostDiv.appendChild(this.node); + + this.resizeHandle = document.createElement("span"); + this.resizeHandle.className = "resize_handle"; + this.hostDiv.appendChild(this.resizeHandle); + + if((this.ddOptions & 8) == 8) { // move allowed + this.movDelHandle = document.createElement("div"); + this.movDelHandle.className = "rectangle_header"; + var delImg = document.createElement("img"); + delImg.src = "delete_rectangle.gif"; + delImg.className = "rectangle_delimg"; + delImg.onmouseover=function(){this.src="delete_rectangle_hover.gif";} + delImg.onmouseout=function(){this.src="delete_rectangle.gif";} + this.movDelHandle.appendChild(delImg); + this.hostDiv.appendChild(this.movDelHandle); + this.movDelHandle.rectangle = this; + delImg.rectangle = this; + + } + + // backward references + this.style = this.hostDiv.style; + this.node.rectangle = this; + this.hostDiv.rectangle = this; + this.resizeHandle.rectangle = this; +} + +Rectangle.prototype.showHandles = function() { + if (this.resizeHandle) + this.resizeHandle.style.visibility = "visible"; + if (this.movDelHandle) + this.movDelHandle.style.visibility = "visible"; +}; + +Rectangle.prototype.hideHandles = function() { + if (this.resizeHandle) + this.resizeHandle.style.visibility = "hidden"; + if (this.movDelHandle) + this.movDelHandle.style.visibility = "hidden"; +}; + +Rectangle.prototype._mac_moveDelHandle = function() { + // fix height + var epozWindow = this.node.childNodes[0].contentWindow; + if (epozWindow.scrollMaxY) + this.resizeHandle.style.right = "15px"; + else + this.resizeHandle.style.right = "0px"; + + // fix width + if (epozWindow.scrollMaxX) + this.resizeHandle.style.bottom = "15px"; + else + this.resizeHandle.style.bottom = "0px"; +}; + + +Rectangle.prototype.draw = function(container, position) { + if (this.beforeDraw) + this.beforeDraw(); + var style = this.style; + style.left = String(this.upperLeftCorner.x) + "px"; + style.top = String(this.upperLeftCorner.y) + "px"; + style.width = String(this.width) + "px"; + style.height = String(this.height) + "px"; + + style.display="block"; + var pos; + if (!position) + pos = "absolute"; + else + pos = position; + style.position = pos; + setBorderStyle(this, "solid"); + setBorderWidth(this, "1px"); + style.visibility = "inherit"; +/* style.overflow = "hidden";*/ + if (container.meta_type == "Rectangle") + setBorderColor(this, container.style.borderTopColor); + + container.appendChild(this.hostDiv); +}; + + +Rectangle.prototype.moveTo = function(upperLeftCorner) { + this.upperLeftCorner = upperLeftCorner; + var style = this.style; + style.left = String(this.upperLeftCorner.x) + "px"; + style.top = String(this.upperLeftCorner.y) + "px"; +}; + +Rectangle.prototype.resizeTo = function(size, cancelOnresize) { + if (size.x >= 10) + this.width = size.x; + if (size.y >= 10) + this.height = size.y; + + var style = this.style; + style.width = String(this.width) + "px"; + style.height = String(this.height) + "px"; + if (this.onresize && !cancelOnresize) + this.onresize(); +}; + +Rectangle.prototype.appendChild = function(node) { + this.node.appendChild(node); +}; + +Rectangle.prototype.setId = function(id) { + this.node.id = id; +}; + + + +function initTextRectangle(iframe, name, rect) { + var ta = iframe.nextSibling; // ta -> textarea + var data = ta.value; + + if (browser.isGecko) { + // Just a few cleanups for Mozilla + data = data.replace(//ig,''); + data = data.replace(/]*)>/ig,''); + data = data.replace(/<\/strong>/ig,''); + + data = data.replace(//ig,''); + data = data.replace(/]*)>/ig,''); + data = data.replace(/<\/em>/ig,''); + } + + // change iframe id + iframe.id = IFramePrefix + name; + iframe.style.border = "0px none transparent"; + + + iframe.contentWindow.document.body.innerHTML = data; + iframe.contentWindow.document.id = DocPrefix + name; + addListener(iframe, "click", handlePlinnEpozRedirect); + if (browser.isMac) { + addListener(iframe.contentWindow.document, 'overflow', function(){rect._mac_moveDelHandle();}); + addListener(iframe.contentWindow.document, 'underflow', function(){rect._mac_moveDelHandle();}); + } + + if (browser.isGecko) { + scriptExpr = 'EnableDesignMode("' + iframe.id + '");'; + window.setTimeout(scriptExpr, 10); + } +} + +// « overloads » + +function handlePlinnEpozRedirect(evt) { + redirectPlinnEpoz(getTargetedObject(evt)); +} + +function redirectPlinnEpoz(iframe) { + if(EpozElement) { + if (EpozElement == iframe) + return; + unwrapPlinnEpozVariables(); + } + + // update Epoz variables + wrapPlinnEpozVariables(iframe); + EpozElement.contentWindow.focus(); +} + +function wrapPlinnEpozVariables(iframe) { + fieldId = iframe.contentWindow.document.id.slice(DocPrefixLength); + + iframe.id = Epoz ; + EpozElement=iframe; + EpozTextArea = document.getElementById(fieldId); +} + + +function unwrapPlinnEpozVariables() { + if (!EpozElement) // no redirection happens yet. + return; + try { + fieldId = EpozElement.contentWindow.document.id.slice(DocPrefixLength); + } + catch (e) { } + + EpozElement.id = IFramePrefix + fieldId; +} diff --git a/skins/layout_objects.js.metadata b/skins/layout_objects.js.metadata new file mode 100644 index 0000000..855fecc --- /dev/null +++ b/skins/layout_objects.js.metadata @@ -0,0 +1,2 @@ +[default] +cache=HTTPCache diff --git a/skins/plinn_attachment_form.py b/skins/plinn_attachment_form.py new file mode 100644 index 0000000..090c57b --- /dev/null +++ b/skins/plinn_attachment_form.py @@ -0,0 +1,28 @@ +##parameters= +form = context.REQUEST.form +formId = form.get('formId') +epozInsert = form.get('epozInsert', False) +file = form.get('file', None) +fileOb = None + +if file : fileOb = context.addAttachment(file, formId) + +onload = None +if fileOb is not None : + if fileOb.meta_type == 'Photo' : + fileUrl = 'attachments/%s/getThumbnail' % fileOb.getId() + if epozInsert : + onload = "dispatchImageAndHideUploadForm('%s', '%s', true);" % (fileUrl, formId) + else : + ratio = float(fileOb.height)/fileOb.width + dispatchValue = "%f_%s" % (ratio, fileUrl) + onload = "dispatchImageAndHideUploadForm('%s','%s', false);" % (dispatchValue, formId) + else : + dispatchValue = '%s[%s]' % (fileOb.getId(), 'attachments/'+fileOb.getId()) + onload = "dispatchFileAndHideUploadForm('%s', '%s');" % (dispatchValue, formId) + +hideFormCode = "hideUploadForm('%s');" % formId + +return context.plinn_attachment_template(onload=onload, + hideFormCode=hideFormCode, + formId=formId) \ No newline at end of file diff --git a/skins/plinn_attachment_template.pt b/skins/plinn_attachment_template.pt new file mode 100644 index 0000000..062bfdc --- /dev/null +++ b/skins/plinn_attachment_template.pt @@ -0,0 +1,56 @@ + + + + + + + + + + + + + Image upload form + + + +

    Insert image

    +

    Insert file

    +
    + +
    + +
    + + + + \ No newline at end of file diff --git a/skins/plinn_blank_iframe.html.pt b/skins/plinn_blank_iframe.html.pt new file mode 100755 index 0000000..7029a91 --- /dev/null +++ b/skins/plinn_blank_iframe.html.pt @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/skins/plinn_doc.gif b/skins/plinn_doc.gif new file mode 100644 index 0000000000000000000000000000000000000000..a92c9aec8c5c990ebad6df4a6c85d9def42a5fa0 GIT binary patch literal 135 zcmV;20C@jLNk%w1VGsZi0FeU#V`_28*W~~J0RR90A^sRVLr+jyK0;+~Z|-y;P)SZ8 zEg(>AX>M)+A^8LW00093EC2ui01yBW0006!oQ{dZ5)Xl523omVP!0>~IFN{enAX>M)+A^8LW00093EC2ui0Du6100092oNuDb?GK}zv{r<(PPY3GhRjB4;)$kU z$sXzp$4cAE_WjW;&i9aB@(G1N((s5YZXkiC^9hYgr&K2Z8Bv-Z)votz#XhtdCiskg zUd1Ca!kmtS*KC3N&6VrDbn)GlwH0oBC98q#2-R8l^rdnSf?NYgDegL(2wI)(UcC8B4NmpuMFn#X`d`kr}%Qk)u26a4i z@1VkN4iEmKcxKnTfF*yt?1eHJ%bvA@c3ahO$JHnnPpF%^GV8o%TWh8O+d*8UDqKs* zy}5D4&a`{qel1uxXRN$a_>KUavFhg3PdryDS_|po&X5029(+3Y>LRYo&8}qoU*@!* zy9X~_HhIXz*H=+bAGLDfB=Oq+uic(^{neM>eX)%;+ke<4SYToYYRBMk?EUxNV-gy; zpLhyJIG}#x1!$oi%Y8N9g$|b3A%@|}_u+=65oqFq8M5eNiw#!j-;Dz9W}}HX!kFTT zD=Y;f^B$h@_4o8mVG@MD`e@j8sNP){^-7C?J$VN(o_+UBcI(m0+gFp_g8o znI(Vbq3D5{O1dfFmLJF&B9FM$*#Vw8&Y)$Vd|Kcqka{8)Vw__V_8^*Ya;WH&WCBWO zqL2zIDWfw^+2nVY61pg6jTV7eW|@k*X_z3Qx@uVGjS57mr$y=HpCVRj+KXuEO5%{J zCaGzwy9(RunWWCjWUa2#@|rBA8Y+7vv~jTMERE8Bc`cS)=DDP{LGtx#s*Vzi?Y6m+ zi{7!!7CJ1jwwC2>EY#lmthu2f%Wko4*8A#w}w`Z}(=_m<-? z!ofasaJT-7Q8BK|T9Yxq;6gm{zSi0sZ5Pu)5^V9E`v^ z6pS;#H4nUQ&kBocv%^B?4C~JL9__QSK;O)CWIrn%bkrCT{d7E9i_GcPT5sdEHDHH* Y%-CeJVfNWrq^^`1bSXpHH8@fA{X|$B#c=z54v%!JDsN|GaG{Qdj?)2E-8FF(9`^~v??Pfwn_b>__N8#kVv zJ9qcnx4*xB{eSZ0-K9$pZrytR^5v%=KmOgj_xi<)kGF5XxNzbAoH^V6g8>6IfZ|UU zMg|5A1|5)LAU`p%&3Bkm;GrYce_}~dr;g=(KjGjAt4L-}fdwk5VQYH=QoLVk?N<+W zU^Liy)_1ja0)vi@_z%I{Bp)t$DTyk#_WY_en%WT}tuExT&HbkA1S&f%9|G*ArVO}ml_PM9h ad6=2ma@hIzAJoXd{~-9$<0nrY8LR;* literal 0 HcmV?d00001 diff --git a/skins/plinn_icons/hidden_layer.gif b/skins/plinn_icons/hidden_layer.gif new file mode 100644 index 0000000000000000000000000000000000000000..8b85acb848f08e9403a7498b3600f8d4d6bc6e37 GIT binary patch literal 333 zcmZ?wbhEHbK78fMmCKhe-??+=#fukPwrp9wdiAwy*XGWhyKddOt5>g{ zK7D%U&YjDbFTZ{J_Q#JOFI>3r>({Txj~^dBdUVd5Ih!_ZTDEN2%9ShU&!4|y#fn|K zcAYtMX2XUJd-v|$w{PFKZ{Hq1e0cx<{bR?Defjcb)~s2xXV3l*1`N1?;!hSv1_m<* z9gq@`pBUJ(9A+1Is9Y1<;F2@5k~eFc)T4chP09011bN~PV literal 0 HcmV?d00001 diff --git a/skins/plinn_icons/imagebox.gif b/skins/plinn_icons/imagebox.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb90831781b1b33991862325e7aa45a51ddccffc GIT binary patch literal 301 zcmV+|0n+|QNk%w1VHp4!0J8u9h=_H-FJ6)s;a8HySwi0 z?wOgH%*@PYW@Z2Y0RR90A^8LV00000EC2ui02u%o000Eq@X1N5y;vER&=Oc^8Ac$U z&jy$%W+XrYww40hY|9*y!W6*5pk*jD9tsU7kr*Z7z8Y@0#s&zm z07%PJB-hZeJk?d$B+p-MhQHnVFf0h=?L0BFxOpL_|dM^YhWs z(W5!y(U7<-50N`Q} zj?t;Ie12xtRAvDkjw9yo^wti`hcf^aRS11pdNU1yA{h>ZbRCcx2nYda5`C916_b>f zOfR6IoTG|{69)$a0}BfT1O){z0Rdy4N>osaw-<&6k-r;I4hx~h#>ERj5(2Ev&d<*R H0ucZ^3|VFS literal 0 HcmV?d00001 diff --git a/skins/plinn_icons/textarea.gif b/skins/plinn_icons/textarea.gif new file mode 100644 index 0000000000000000000000000000000000000000..21822d6d23da9ab95edde575269768ad443b81ff GIT binary patch literal 239 zcmZ?wbhEHblw^=(*v!Ci_Uzfackia9otZs*c6oXEs#U9Q-u%zN!0`V+h{ObnKUu(n zIv^5c1_R3+fs>xA*Q&oh`+MenRV8_WNgWH<<#;n44)mCxmQtQKSxRuh&IOJetX2f5 z9C{;sgtM0|#D}xRsr~5V^j$uYy~jelx*sq_r=*osFPP_&pSj!Gsp(X)wM=vQ^{+*B zrG+_7)%mR@^&*`O-MxkVwcc`5rI^!HCn_;>sO1^3&se-OWE5nu1^_rh5%Wj%lXeB;KACr_SSxpHN6baZTNY;|>YU0q#fX6B3;GcqzVu3o+B>+4%oRJ35h zf)y)PoH%i!qM~By(xo$J&b)W;UT<%2a&q#E7cUwb8ft56o0^&e0s?mL-o0bTj?bSz z-@0{c!h{JP9vS88`7Ti<_+zwy|N6YqA#8X1XfNARuAg%xY=QudHIlGoj6pi;MYf IQzL^l0Ga8TlmGw# literal 0 HcmV?d00001 diff --git a/skins/plinn_image_upload.gif b/skins/plinn_image_upload.gif new file mode 100644 index 0000000000000000000000000000000000000000..9020ace866925f229563524ce23385584906356b GIT binary patch literal 1046 zcmZ?wbhEHb6lV})_}*!a>(vu2bfC#+bpB5=#CSFb+A?7Fw&)XmcBs)Mz~Gp@dRdgbcbv$witt-XHz z`k_M?Pn@{6r(^P!D-Rybnoz#H$acoD+YcUYDM(&8f5E}MdzLI-GS9*1OHaYgn~#%r zM?WixnSXuSvW*+|@4w(5RF<2U*VotYU9mVmp>+Gf!~4vQ_Fp~Rd+teFTidZ?M~@u2 zeDB`#Gf4>-F5EeN`sRY8vl<#2T%x+-;}e&ySm{vfd+^fz&!4~LoqgSN&m*i z^-+;8S1+D;wD0r8yvw^cO_?&qqSEiEnU=*uvvcQepFDYe>eQ*nk00N%4G6dT7Q_}6 z6`e~@+`MVil&;R%^B13*KIilM_x^!tU%q^gPbfR&U|q8(ee2dOCapW}-@pI)&%d|P zR&V<2*E_pkymZcz&c6G{>wg3PBXBY)^2?52QEQ|~c z?F>2~+dz4Of#Wj+Kc|exh6M+kIfS)hR&1DXxSfyJP$Z(mq0y4xNk=fiL+NlAtAxyg z2Mx)R{k*zeH47XX7EagTHClO@iMvCvY1bDI1BTZA87$iq4qQCm(!t?Yk@MrC%So;U z%-$6ziZdcgny literal 0 HcmV?d00001 diff --git a/skins/plinn_init_javascript_code.dtml b/skins/plinn_init_javascript_code.dtml new file mode 100644 index 0000000..f83f7e8 --- /dev/null +++ b/skins/plinn_init_javascript_code.dtml @@ -0,0 +1,8 @@ + diff --git a/skins/plinn_macros.pt b/skins/plinn_macros.pt new file mode 100644 index 0000000..fd79963 --- /dev/null +++ b/skins/plinn_macros.pt @@ -0,0 +1,66 @@ + + + + + + + Plinn macros + + + +
    + +BoldItalicUnderlineStrikethrough SubscriptSuperscript RemoveFormat TextColorBackColor AlignLeftCenterAlignRight OrderedListUnorderedListOutdentIndent + +InsertImage
    +
    +
    + +InsertFile
    +
    +
    + +InsertLinkInsertAnchor +InsertRuleInsertTable UndoRedo +
    + + \ No newline at end of file diff --git a/skins/plinn_multilingual.js.pt b/skins/plinn_multilingual.js.pt new file mode 100644 index 0000000..bd0d5c7 --- /dev/null +++ b/skins/plinn_multilingual.js.pt @@ -0,0 +1,17 @@ +var PlinnLang=[]; + +PlinnLang[""]=""; + \ No newline at end of file diff --git a/skins/plinn_multilingual.js.pt.metadata b/skins/plinn_multilingual.js.pt.metadata new file mode 100644 index 0000000..855fecc --- /dev/null +++ b/skins/plinn_multilingual.js.pt.metadata @@ -0,0 +1,2 @@ +[default] +cache=HTTPCache diff --git a/skins/plinndocument_edit_control.py b/skins/plinndocument_edit_control.py new file mode 100644 index 0000000..a2e55b6 --- /dev/null +++ b/skins/plinndocument_edit_control.py @@ -0,0 +1,15 @@ +## Script (Python) "plinndocument_edit" +##parameters=text='', file='', SafetyBelt='', **kw +##title=Edit a document +## + +from Products.CMFDefault.exceptions import EditingConflict, ResourceLockedError + +if text != context.text : + try: + context.edit( 'html', text, file, safety_belt = SafetyBelt) + return context.setStatus(True, 'Document changed.') + except (ResourceLockedError, EditingConflict), msg: + return context.setStatus(False, msg) +else : + return context.setStatus(False, 'Nothing to change.') diff --git a/skins/plinndocument_edit_form.py b/skins/plinndocument_edit_form.py new file mode 100644 index 0000000..5484bcf --- /dev/null +++ b/skins/plinndocument_edit_form.py @@ -0,0 +1,13 @@ +##parameters=change='', change_and_view='', ajax='' + +form = context.REQUEST.form +if change and \ + context.plinndocument_edit_control(**form) and \ + context.setRedirect(context, 'object/edit', ajax=ajax) : + return +elif change_and_view and \ + context.plinndocument_edit_control(**form) and \ + context.setRedirect(context, 'object/view', ajax=ajax) : + return + +return context.plinndocument_edit_template() diff --git a/skins/plinndocument_edit_template.pt b/skins/plinndocument_edit_template.pt new file mode 100644 index 0000000..ef54386 --- /dev/null +++ b/skins/plinndocument_edit_template.pt @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + +
    +
    generic_header macro
    +
    + +
    + + + Add text    + + + + + Toggle layer visibility + +
    + + +
    + + + +
    + + +
    +
    + +
    + + diff --git a/skins/plinndocument_view.pt b/skins/plinndocument_view.pt new file mode 100644 index 0000000..c14b64d --- /dev/null +++ b/skins/plinndocument_view.pt @@ -0,0 +1,13 @@ + + + + + Plinn document edit + + + +

    + + + \ No newline at end of file diff --git a/skins/resize_handle.png b/skins/resize_handle.png new file mode 100644 index 0000000000000000000000000000000000000000..2ecfaa1917db89c0f0e51de86f3931edea24d6a5 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kmUKs7M+Sy#H?H_c7y Date: Mon, 22 Dec 2014 15:09:50 +0100 Subject: [PATCH 2/2] eggification --- .../PlinnDocument/HistoryAdapters.py | 0 .../PlinnDocument/PlinnDocument.py | 0 .../PlinnDocument/__init__.py | 0 .../PlinnDocument/configure.zcml | 0 .../graphics}/delete_rectangle.psd | Bin .../PlinnDocument/graphics}/layer_status.psd | Bin .../PlinnDocument/graphics}/resize_handle.psd | Bin .../PlinnDocument/interfaces.py | 0 .../PlinnDocument/license.txt | 0 .../PlinnDocument/profiles}/default/types.xml | 0 .../profiles}/default/types/Plinn_Document.xml | 0 .../PlinnDocument/skins}/color_utils.js | 0 .../skins}/color_utils.js.metadata | 0 .../PlinnDocument/skins}/dd_trigger.js | 0 .../skins}/dd_trigger.js.metadata | 0 .../skins}/degrad_rectangle_header.gif | Bin .../PlinnDocument/skins}/delete_rectangle.gif | Bin .../skins}/delete_rectangle_hover.gif | Bin .../PlinnDocument/skins}/layout_controlers.js | 0 .../skins}/layout_controlers.js.metadata | 0 .../PlinnDocument/skins}/layout_objects.js | 0 .../skins}/layout_objects.js.metadata | 0 .../skins}/plinn_attachment_form.py | 0 .../skins}/plinn_attachment_template.pt | 0 .../skins}/plinn_blank_iframe.html.pt | 0 .../PlinnDocument/skins}/plinn_doc.gif | Bin .../PlinnDocument/skins}/plinn_doc.thumb.gif | Bin .../PlinnDocument/skins}/plinn_file_upload.gif | Bin .../skins}/plinn_icons/hidden_layer.gif | Bin .../skins}/plinn_icons/imagebox.gif | Bin .../PlinnDocument/skins}/plinn_icons/layer.gif | Bin .../skins}/plinn_icons/textarea.gif | Bin .../skins}/plinn_icons/visible_layer.gif | Bin .../skins}/plinn_image_upload.gif | Bin .../skins}/plinn_init_javascript_code.dtml | 0 .../PlinnDocument/skins}/plinn_macros.pt | 0 .../skins}/plinn_multilingual.js.pt | 0 .../skins}/plinn_multilingual.js.pt.metadata | 0 .../skins}/plinndocument_edit_control.py | 0 .../skins}/plinndocument_edit_form.py | 0 .../skins}/plinndocument_edit_template.pt | 0 .../PlinnDocument/skins}/plinndocument_view.pt | 0 .../PlinnDocument/skins}/resize_handle.png | Bin .../PlinnDocument/skins}/xml_io.js | 0 .../PlinnDocument/skins}/xml_io.js.metadata | 0 Products/__init__.py | 5 +++++ setup.py | 17 +++++++++++++++++ 47 files changed, 22 insertions(+) rename HistoryAdapters.py => Products/PlinnDocument/HistoryAdapters.py (100%) rename PlinnDocument.py => Products/PlinnDocument/PlinnDocument.py (100%) rename __init__.py => Products/PlinnDocument/__init__.py (100%) rename configure.zcml => Products/PlinnDocument/configure.zcml (100%) rename {graphics => Products/PlinnDocument/graphics}/delete_rectangle.psd (100%) rename {graphics => Products/PlinnDocument/graphics}/layer_status.psd (100%) rename {graphics => Products/PlinnDocument/graphics}/resize_handle.psd (100%) rename interfaces.py => Products/PlinnDocument/interfaces.py (100%) rename license.txt => Products/PlinnDocument/license.txt (100%) rename {profiles => Products/PlinnDocument/profiles}/default/types.xml (100%) rename {profiles => Products/PlinnDocument/profiles}/default/types/Plinn_Document.xml (100%) rename {skins => Products/PlinnDocument/skins}/color_utils.js (100%) rename {skins => Products/PlinnDocument/skins}/color_utils.js.metadata (100%) rename {skins => Products/PlinnDocument/skins}/dd_trigger.js (100%) rename {skins => Products/PlinnDocument/skins}/dd_trigger.js.metadata (100%) rename {skins => Products/PlinnDocument/skins}/degrad_rectangle_header.gif (100%) rename {skins => Products/PlinnDocument/skins}/delete_rectangle.gif (100%) rename {skins => Products/PlinnDocument/skins}/delete_rectangle_hover.gif (100%) rename {skins => Products/PlinnDocument/skins}/layout_controlers.js (100%) rename {skins => Products/PlinnDocument/skins}/layout_controlers.js.metadata (100%) rename {skins => Products/PlinnDocument/skins}/layout_objects.js (100%) rename {skins => Products/PlinnDocument/skins}/layout_objects.js.metadata (100%) rename {skins => Products/PlinnDocument/skins}/plinn_attachment_form.py (100%) rename {skins => Products/PlinnDocument/skins}/plinn_attachment_template.pt (100%) rename {skins => Products/PlinnDocument/skins}/plinn_blank_iframe.html.pt (100%) rename {skins => Products/PlinnDocument/skins}/plinn_doc.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_doc.thumb.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_file_upload.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_icons/hidden_layer.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_icons/imagebox.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_icons/layer.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_icons/textarea.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_icons/visible_layer.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_image_upload.gif (100%) rename {skins => Products/PlinnDocument/skins}/plinn_init_javascript_code.dtml (100%) rename {skins => Products/PlinnDocument/skins}/plinn_macros.pt (100%) rename {skins => Products/PlinnDocument/skins}/plinn_multilingual.js.pt (100%) rename {skins => Products/PlinnDocument/skins}/plinn_multilingual.js.pt.metadata (100%) rename {skins => Products/PlinnDocument/skins}/plinndocument_edit_control.py (100%) rename {skins => Products/PlinnDocument/skins}/plinndocument_edit_form.py (100%) rename {skins => Products/PlinnDocument/skins}/plinndocument_edit_template.pt (100%) rename {skins => Products/PlinnDocument/skins}/plinndocument_view.pt (100%) rename {skins => Products/PlinnDocument/skins}/resize_handle.png (100%) rename {skins => Products/PlinnDocument/skins}/xml_io.js (100%) rename {skins => Products/PlinnDocument/skins}/xml_io.js.metadata (100%) create mode 100644 Products/__init__.py create mode 100644 setup.py diff --git a/HistoryAdapters.py b/Products/PlinnDocument/HistoryAdapters.py similarity index 100% rename from HistoryAdapters.py rename to Products/PlinnDocument/HistoryAdapters.py diff --git a/PlinnDocument.py b/Products/PlinnDocument/PlinnDocument.py similarity index 100% rename from PlinnDocument.py rename to Products/PlinnDocument/PlinnDocument.py diff --git a/__init__.py b/Products/PlinnDocument/__init__.py similarity index 100% rename from __init__.py rename to Products/PlinnDocument/__init__.py diff --git a/configure.zcml b/Products/PlinnDocument/configure.zcml similarity index 100% rename from configure.zcml rename to Products/PlinnDocument/configure.zcml diff --git a/graphics/delete_rectangle.psd b/Products/PlinnDocument/graphics/delete_rectangle.psd similarity index 100% rename from graphics/delete_rectangle.psd rename to Products/PlinnDocument/graphics/delete_rectangle.psd diff --git a/graphics/layer_status.psd b/Products/PlinnDocument/graphics/layer_status.psd similarity index 100% rename from graphics/layer_status.psd rename to Products/PlinnDocument/graphics/layer_status.psd diff --git a/graphics/resize_handle.psd b/Products/PlinnDocument/graphics/resize_handle.psd similarity index 100% rename from graphics/resize_handle.psd rename to Products/PlinnDocument/graphics/resize_handle.psd diff --git a/interfaces.py b/Products/PlinnDocument/interfaces.py similarity index 100% rename from interfaces.py rename to Products/PlinnDocument/interfaces.py diff --git a/license.txt b/Products/PlinnDocument/license.txt similarity index 100% rename from license.txt rename to Products/PlinnDocument/license.txt diff --git a/profiles/default/types.xml b/Products/PlinnDocument/profiles/default/types.xml similarity index 100% rename from profiles/default/types.xml rename to Products/PlinnDocument/profiles/default/types.xml diff --git a/profiles/default/types/Plinn_Document.xml b/Products/PlinnDocument/profiles/default/types/Plinn_Document.xml similarity index 100% rename from profiles/default/types/Plinn_Document.xml rename to Products/PlinnDocument/profiles/default/types/Plinn_Document.xml diff --git a/skins/color_utils.js b/Products/PlinnDocument/skins/color_utils.js similarity index 100% rename from skins/color_utils.js rename to Products/PlinnDocument/skins/color_utils.js diff --git a/skins/color_utils.js.metadata b/Products/PlinnDocument/skins/color_utils.js.metadata similarity index 100% rename from skins/color_utils.js.metadata rename to Products/PlinnDocument/skins/color_utils.js.metadata diff --git a/skins/dd_trigger.js b/Products/PlinnDocument/skins/dd_trigger.js similarity index 100% rename from skins/dd_trigger.js rename to Products/PlinnDocument/skins/dd_trigger.js diff --git a/skins/dd_trigger.js.metadata b/Products/PlinnDocument/skins/dd_trigger.js.metadata similarity index 100% rename from skins/dd_trigger.js.metadata rename to Products/PlinnDocument/skins/dd_trigger.js.metadata diff --git a/skins/degrad_rectangle_header.gif b/Products/PlinnDocument/skins/degrad_rectangle_header.gif similarity index 100% rename from skins/degrad_rectangle_header.gif rename to Products/PlinnDocument/skins/degrad_rectangle_header.gif diff --git a/skins/delete_rectangle.gif b/Products/PlinnDocument/skins/delete_rectangle.gif similarity index 100% rename from skins/delete_rectangle.gif rename to Products/PlinnDocument/skins/delete_rectangle.gif diff --git a/skins/delete_rectangle_hover.gif b/Products/PlinnDocument/skins/delete_rectangle_hover.gif similarity index 100% rename from skins/delete_rectangle_hover.gif rename to Products/PlinnDocument/skins/delete_rectangle_hover.gif diff --git a/skins/layout_controlers.js b/Products/PlinnDocument/skins/layout_controlers.js similarity index 100% rename from skins/layout_controlers.js rename to Products/PlinnDocument/skins/layout_controlers.js diff --git a/skins/layout_controlers.js.metadata b/Products/PlinnDocument/skins/layout_controlers.js.metadata similarity index 100% rename from skins/layout_controlers.js.metadata rename to Products/PlinnDocument/skins/layout_controlers.js.metadata diff --git a/skins/layout_objects.js b/Products/PlinnDocument/skins/layout_objects.js similarity index 100% rename from skins/layout_objects.js rename to Products/PlinnDocument/skins/layout_objects.js diff --git a/skins/layout_objects.js.metadata b/Products/PlinnDocument/skins/layout_objects.js.metadata similarity index 100% rename from skins/layout_objects.js.metadata rename to Products/PlinnDocument/skins/layout_objects.js.metadata diff --git a/skins/plinn_attachment_form.py b/Products/PlinnDocument/skins/plinn_attachment_form.py similarity index 100% rename from skins/plinn_attachment_form.py rename to Products/PlinnDocument/skins/plinn_attachment_form.py diff --git a/skins/plinn_attachment_template.pt b/Products/PlinnDocument/skins/plinn_attachment_template.pt similarity index 100% rename from skins/plinn_attachment_template.pt rename to Products/PlinnDocument/skins/plinn_attachment_template.pt diff --git a/skins/plinn_blank_iframe.html.pt b/Products/PlinnDocument/skins/plinn_blank_iframe.html.pt similarity index 100% rename from skins/plinn_blank_iframe.html.pt rename to Products/PlinnDocument/skins/plinn_blank_iframe.html.pt diff --git a/skins/plinn_doc.gif b/Products/PlinnDocument/skins/plinn_doc.gif similarity index 100% rename from skins/plinn_doc.gif rename to Products/PlinnDocument/skins/plinn_doc.gif diff --git a/skins/plinn_doc.thumb.gif b/Products/PlinnDocument/skins/plinn_doc.thumb.gif similarity index 100% rename from skins/plinn_doc.thumb.gif rename to Products/PlinnDocument/skins/plinn_doc.thumb.gif diff --git a/skins/plinn_file_upload.gif b/Products/PlinnDocument/skins/plinn_file_upload.gif similarity index 100% rename from skins/plinn_file_upload.gif rename to Products/PlinnDocument/skins/plinn_file_upload.gif diff --git a/skins/plinn_icons/hidden_layer.gif b/Products/PlinnDocument/skins/plinn_icons/hidden_layer.gif similarity index 100% rename from skins/plinn_icons/hidden_layer.gif rename to Products/PlinnDocument/skins/plinn_icons/hidden_layer.gif diff --git a/skins/plinn_icons/imagebox.gif b/Products/PlinnDocument/skins/plinn_icons/imagebox.gif similarity index 100% rename from skins/plinn_icons/imagebox.gif rename to Products/PlinnDocument/skins/plinn_icons/imagebox.gif diff --git a/skins/plinn_icons/layer.gif b/Products/PlinnDocument/skins/plinn_icons/layer.gif similarity index 100% rename from skins/plinn_icons/layer.gif rename to Products/PlinnDocument/skins/plinn_icons/layer.gif diff --git a/skins/plinn_icons/textarea.gif b/Products/PlinnDocument/skins/plinn_icons/textarea.gif similarity index 100% rename from skins/plinn_icons/textarea.gif rename to Products/PlinnDocument/skins/plinn_icons/textarea.gif diff --git a/skins/plinn_icons/visible_layer.gif b/Products/PlinnDocument/skins/plinn_icons/visible_layer.gif similarity index 100% rename from skins/plinn_icons/visible_layer.gif rename to Products/PlinnDocument/skins/plinn_icons/visible_layer.gif diff --git a/skins/plinn_image_upload.gif b/Products/PlinnDocument/skins/plinn_image_upload.gif similarity index 100% rename from skins/plinn_image_upload.gif rename to Products/PlinnDocument/skins/plinn_image_upload.gif diff --git a/skins/plinn_init_javascript_code.dtml b/Products/PlinnDocument/skins/plinn_init_javascript_code.dtml similarity index 100% rename from skins/plinn_init_javascript_code.dtml rename to Products/PlinnDocument/skins/plinn_init_javascript_code.dtml diff --git a/skins/plinn_macros.pt b/Products/PlinnDocument/skins/plinn_macros.pt similarity index 100% rename from skins/plinn_macros.pt rename to Products/PlinnDocument/skins/plinn_macros.pt diff --git a/skins/plinn_multilingual.js.pt b/Products/PlinnDocument/skins/plinn_multilingual.js.pt similarity index 100% rename from skins/plinn_multilingual.js.pt rename to Products/PlinnDocument/skins/plinn_multilingual.js.pt diff --git a/skins/plinn_multilingual.js.pt.metadata b/Products/PlinnDocument/skins/plinn_multilingual.js.pt.metadata similarity index 100% rename from skins/plinn_multilingual.js.pt.metadata rename to Products/PlinnDocument/skins/plinn_multilingual.js.pt.metadata diff --git a/skins/plinndocument_edit_control.py b/Products/PlinnDocument/skins/plinndocument_edit_control.py similarity index 100% rename from skins/plinndocument_edit_control.py rename to Products/PlinnDocument/skins/plinndocument_edit_control.py diff --git a/skins/plinndocument_edit_form.py b/Products/PlinnDocument/skins/plinndocument_edit_form.py similarity index 100% rename from skins/plinndocument_edit_form.py rename to Products/PlinnDocument/skins/plinndocument_edit_form.py diff --git a/skins/plinndocument_edit_template.pt b/Products/PlinnDocument/skins/plinndocument_edit_template.pt similarity index 100% rename from skins/plinndocument_edit_template.pt rename to Products/PlinnDocument/skins/plinndocument_edit_template.pt diff --git a/skins/plinndocument_view.pt b/Products/PlinnDocument/skins/plinndocument_view.pt similarity index 100% rename from skins/plinndocument_view.pt rename to Products/PlinnDocument/skins/plinndocument_view.pt diff --git a/skins/resize_handle.png b/Products/PlinnDocument/skins/resize_handle.png similarity index 100% rename from skins/resize_handle.png rename to Products/PlinnDocument/skins/resize_handle.png diff --git a/skins/xml_io.js b/Products/PlinnDocument/skins/xml_io.js similarity index 100% rename from skins/xml_io.js rename to Products/PlinnDocument/skins/xml_io.js diff --git a/skins/xml_io.js.metadata b/Products/PlinnDocument/skins/xml_io.js.metadata similarity index 100% rename from skins/xml_io.js.metadata rename to Products/PlinnDocument/skins/xml_io.js.metadata diff --git a/Products/__init__.py b/Products/__init__.py new file mode 100644 index 0000000..d407605 --- /dev/null +++ b/Products/__init__.py @@ -0,0 +1,5 @@ +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9676046 --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from setuptools import setup, find_packages + + +setup(name='Products.PlinnDocument', + version='3.0', + description='Plinn wysiwyg document for Plinn content management framework', + url='http://plinn.org', + author="Benoît Pin – MINES ParisTech – Armines", + author_email="benoit.pin@mines-paristech.fr", + license="GPL", + packages=find_packages(), + include_package_data=True, + namespace_packages=['Products'], + zip_safe=False, + install_requires=[] #TODO + ) -- 2.20.1