Scrapbook Allow position edit, but nothing else

0 views
Skip to first unread message

Clayburn

unread,
Jun 18, 2009, 9:20:49 PM6/18/09
to LimeBits
How can I make it so that other people can move content around and
have it stay where they put it, but not be able to actually edit the
content (copy, delete, change code, etc.)?

Clayburn

unread,
Jun 18, 2009, 10:41:37 PM6/18/09
to LimeBits
I could try setting it to Co-Author and then editing the source code
somehow to keep it from displaying the Edit tab at all. However, I'm
not sure what to edit to best remove the Edit tab. Then, to edit the
page, I'd have to save the original code back into it, make my changes
and then save the edited code again.

Clayburn

unread,
Jun 18, 2009, 10:53:54 PM6/18/09
to LimeBits
Okay, I got something for now. Let me know what you think. I'm not
sure how good of a solution this is, but it seems to get the job
done.

I changed one value on the textbox.js file in the conversations
scripts folder:

this.options = jQuery.extend({
async: true,
image: false,
versioned: false,
editable: false,
controlElement: "button",
className: "textbox",
hoverclass: "textbox-hover",
editHeight: "auto",
editWidth: "clone"
},

editable was set to true initially, I changed it to false and there is
no edit button.

On Jun 18, 9:20 pm, Clayburn <clayb...@gmail.com> wrote:

Clayburn

unread,
Jun 18, 2009, 10:56:52 PM6/18/09
to LimeBits
This file:
(scrapbook)/bits/textbox/scripts/textbox.js

Jonathan A. Marshall

unread,
Jun 19, 2009, 10:48:27 AM6/19/09
to LimeBits forum
There's an easier and better way to set the scrapbook options.  In the scrapbook index.html, change the jQuery scrapbook invocation to:
            jQuery("#scrapbook").scrapbook( { editable: false } );

This way you can use a single scrapbook.js program, without having to modify it for each set of options.

Thanks,
--Jonathan

Chetan Reddy

unread,
Jun 19, 2009, 11:22:37 AM6/19/09
to lime...@googlegroups.com
Another way to do this is to create a new textbox and paste the
following code into it(you should be signed in). You should see an
alert of 200 (works in Firefox). After you see the alert, Delete the
textbox so that the code doesn't get executed again.

====Cut from here=====
<div>Give write-properties priv to all users</div>
<script type="text/javascript" charset="utf-8">
(function() {
var acl = AXIS.WebDAV.getACL({
url: 'content',
asynch: false
});
acl.addAce(true, 'write-properties', AXIS.WebDAV.PRINCIPAL_ALL);
AXIS.WebDAV.setACL({
url: 'content',
asynch: false,
acl: acl,
callback: function(r) {
alert(r.getStatus());
}
});
})();
</script>
=======Paste from here=======

The positions of the various scrapbook elements are stored as
properties, and this piece of code basically gives the
'write-properties' privilege to all users.

-chet

Jonathan A. Marshall

unread,
Jun 19, 2009, 12:53:40 PM6/19/09
to LimeBits forum
Um, I should have tested this first.  My method doesn't work.  It sets an option for scrapbook -- but you need to set the option for the textboxes.  Scrapbook.js should (but doesn't) pass the textbox options through into textbox.

To do this correctly will require a fix of scrapbook.js.  In the meantime, you can add editable:false directly into textboxOptions in scrapbook.js.

Thanks,
--Jonathan

Clayburn

unread,
Jun 20, 2009, 7:52:45 PM6/20/09
to LimeBits
Now, how would I go about making some content movable and making some
fixed (not on screen, but on scrapbook; unmovable)?


On Jun 19, 12:53 pm, "Jonathan A. Marshall" <jmarsh...@limebits.com>
wrote:
> Um, I should have tested this first.  My method doesn't work.  It sets
> an option for *scrapbook* -- but you need to set the option for the
> *textbox*es.  Scrapbook.js should (but doesn't) pass the textbox options
> * *

Jonathan A. Marshall

unread,
Jun 21, 2009, 9:01:48 PM6/21/09
to LimeBits forum
The latest version of scrapbook.js provides the ability to disable dragging
{draggable:false}, but it applies to all items on the scrapbook. See the
instance at http://bits.limebits.com/bits/scrapbook-introduction/ . You can
probably modify it to do what you want. Post here if you need more help on
that.

Thanks,
--Jonathan

Tim Olsen

unread,
Jun 22, 2009, 11:01:51 AM6/22/09
to lime...@googlegroups.com
Clayburn wrote:
> Now, how would I go about making some content movable and making some
> fixed (not on screen, but on scrapbook; unmovable)?

To enforce this at the server, you will need to set the appropriate ACL.
What you want to do is DENY the write-properties privilege to ALL on
the content in question. Note that such an ACE (access control entry)
will always be overridden by a protected ACE that grants ALL privileges
to a resource's owner, so you yourself will still be able to move the
content, as well as change its ACL.

See Chetan's prior email for an example on how to set an ACL.

Tim

Reply all
Reply to author
Forward
0 new messages