Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2b73e694
Commit
2b73e694
authored
Nov 19, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some copy/paste bugs
parent
841db065
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+11
-4
lib/python/OFS/Moniker.py
lib/python/OFS/Moniker.py
+7
-1
lib/python/OFS/main.dtml
lib/python/OFS/main.dtml
+4
-4
No files found.
lib/python/OFS/CopySupport.py
View file @
2b73e694
"""Copy interface"""
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
Globals
,
Moniker
,
rPickle
from
cPickle
import
loads
,
dumps
...
...
@@ -16,11 +16,18 @@ class CopyContainer:
# Interface for containerish objects which allow
# objects to be copied into them.
pasteDialog
=
Globals
.
HTMLFile
(
'OFS/pasteDialog'
)
def
_getMoniker
(
self
):
# Ask an object to return a moniker for itself.
return
Moniker
.
Moniker
(
self
)
pasteDialog
=
Globals
.
HTMLFile
(
'OFS/pasteDialog'
)
def
validClipData
(
self
):
# Return true if clipboard data is valid.
try
:
moniker
=
rPickle
.
loads
(
unquote
(
self
.
REQUEST
[
'clip_data'
]))
except
:
return
0
v
=
self
.
REQUEST
[
'validClipData'
]
=
moniker
.
assert
()
return
v
def
pasteFromClipboard
(
self
,
clip_id
=
''
,
clip_data
=
''
,
REQUEST
=
None
):
""" """
...
...
@@ -78,8 +85,8 @@ class CopySource:
except
:
return
eNotSupported
REQUEST
[
'RESPONSE'
].
setCookie
(
'clip_data'
,
quote
(
dumps
(
moniker
)),
path
=
'
/'
,
expires
=
'Friday, 31-Dec-99 23:59:59 GMT'
)
path
=
'
%s'
%
REQUEST
[
'SCRIPT_NAME'
])
...
...
lib/python/OFS/Moniker.py
View file @
2b73e694
...
...
@@ -8,7 +8,7 @@ Object monikers
"""
__version__
=
'$Revision: 1.
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
import
Globals
...
...
@@ -28,8 +28,14 @@ class Moniker:
try
:
self
.
aqp
=
Moniker
(
obj
.
aq_parent
,
0
)
except
:
self
.
aqp
=
None
def
assert
(
self
):
# Return true if the named object exists
if
self
.
jar
is
None
:
jar
=
Globals
.
Bobobase
.
_jar
else
:
jar
=
Globals
.
SessionBase
[
self
.
jar
].
jar
return
jar
.
has_key
(
self
.
oid
)
def
bind
(
self
):
# Return the real object named by this moniker
if
self
.
jar
is
None
:
jar
=
Globals
.
Bobobase
.
_jar
else
:
jar
=
Globals
.
SessionBase
[
self
.
jar
].
jar
obj
=
jar
[
self
.
oid
]
...
...
lib/python/OFS/main.dtml
View file @
2b73e694
...
...
@@ -57,20 +57,20 @@ click on the item's title and id.
<TD></TD>
<TD>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Copy">
<!--#if
clip_d
ata-->
<!--#if
validClipD
ata-->
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Paste">
<!--#/if
clip_d
ata-->
<!--#/if
validClipD
ata-->
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Delete">
</TD>
</TR>
</TABLE>
</FORM>
<!--#else objectValues-->
<!--#if
clip_d
ata-->
<!--#if
validClipD
ata-->
<FORM ACTION="manage_delObjects" METHOD="POST">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Paste">
</FORM>
<!--#/if
clip_d
ata-->
<!--#/if
validClipD
ata-->
<!--#/if objectValues-->
<TABLE>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment