<shortname>My Spaces2</shortname>
<description>Generate the My Spaces2 portlet page</description>
<url>/sample/myspaces2?f={filter?}&p={path?}</url>
dans myspaces2.get.desc.xml<script type="text/javascript" src="/org/alfresco/sample/test/myspaces2.js"></script>
Quelqu un sait ce qu il faut mettre?parseSpacePanels: function()
{
var spaces = $$('#spacePanel .spaceRow');
var items = $$('#spacePanel .spaceItem');
var infos = $$('#spacePanel .spaceInfo');
var details = $$('#spacePanel .spaceDetail');
var icons = $$('#spacePanel .spaceIcon');
var imgs = $$('#spacePanel .spaceIconImage');
var imgs64 = $$('#spacePanel .spaceIconImage64');
var resources = $$('#spacePanel .spaceResource');
var types = $$('#spacePanel .spaceType');
…….
…….
spaces.each(function(space, i)
{
var item = items[i],
icon = icons[i],
info = infos[i],
detail = details[i],
type = types[i],
img = imgs[i],
dzone = new Array(),
nzone = 0;
resource = resources[i];
…….
……
spaces.each(function(ic, i)
{
if (types[i].getProperty('alt')=="space")
{
dzone[nzone]=spaces[i];
nzone++;
}
});
$('spacePanel').addEvent('domready', function() {
if (type.getProperty('alt')=="fichier"){
icon.addEvent('mousedown', function(e) {
e = new Event(e).stop();
var clone = this.clone()
.setStyles(this.getCoordinates()) // this returns an object with left/top/bottom/right, so its perfect
.setStyles({'opacity': 0.4, 'position': 'absolute' })
.addEvent('emptydrop', function() {
this.remove();
// spaces[3].removeEvents();
// spaces[4].removeEvents();
for( var l = 0; l < nzone; l++ ) {
dzone[l].removeEvents();
}
}).inject(document.body);
for( var y = 0; y < nzone; y++ ) {
dzone[y].addEvents({
'drop': function() {
for( var k = 0; k < nzone; k++ ) {
dzone[k].removeEvents();
}
clone.remove();
item.clone().inject(dzone[y]);
},
'over': function() {
},
'leave': function() {
}
});
};
/*
spaces[3].addEvents({
'drop': function() {
spaces[3].removeEvents();
spaces[4].removeEvents();
clone.remove();
item.clone().inject(spaces[3]);
},
'over': function() {
},
'leave': function() {
}
});
spaces[4].addEvents({
'drop': function() {
spaces[4].removeEvents();
spaces[3].removeEvents();
clone.remove();
item.clone().inject(spaces[4]);
},
'over': function() {
},
'leave': function() {
}
});*/
var drag = clone.makeDraggable({
droppables: dzone
//droppables: [spaces[3],spaces[4]]
}); // this returns the dragged element
drag.start(e); // start the event manual
});
}
});
Une petite explication sur mon code <div style="display:none"><img class="spaceType" alt="space" ></div>
sans oublier de donner une def CSS dans myspaces.get.html.ftlel.appendChild is not a function
inject(false, undefined)mootools.v1.1.js (line 28)
drop()myspaces2.js (line 337)
returns()mootools.v1.1.js (line 21)
create(undefined)mootools.v1.1.js (line 21)
fireEvent(function())mootools.v1.1.js (line 48)
fireEvent("drop", [div.spaceIcon, Object options=Object element=div.spaceIcon droppables=[2]], undefined)mootools.v1.1.js (line 48)
checkAgainst()mootools.v1.1.js (line 70)
implement()mootools.v1.1.js (line 9)
returns()mootools.v1.1.js (line 21)
create(mouseup clientX=0, clientY=0)mootools.v1.1.js (line 21)
[Break on this error] default:el.appendChild(this);}
Par contre si j ajoute manuellement les evenements drop (car je fais des tests sur un petit nombre de fichiers et d espace) tout marche sans probleme. J ai un beau drag and drop et lorsque je drop un fichier sur un espace on a le nom du fichier qui s insiere dans la ligne contenant l espace.YAHOO.util.Connect.asyncRequest(
"POST",
getContextPath() + '/ajax/invoke/PortletActionsBean.deleteItem',
{
success: function(response)……….
qui provient du fichier yahoo-min.js mais je ne voit pas trop comment l utiliser… Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.