Permalink
Browse files

Some fixes for hard-caching & refreshing node in UI.

  • Loading branch information...
1 parent f757b32 commit cf6d4dc8fc95a099f63a6dfef322ec5a4a5c0e3a @cdujeu cdujeu committed May 20, 2016
@@ -71,6 +71,7 @@ protected function publishTaskUpdate(Task $task){
foreach($task->nodes as $url){
$n = new AJXP_Node($url);
$n->loadNodeInfo(true, false, "all");
+ Controller::applyHook("node.meta_change", array(&$n));
$nodesDiff->update($n);
}
}
@@ -242,6 +242,11 @@ Class.create("InfoPanel", AjxpPane, {
}else{
uniqNode = passedNode;
}
+ if(this._currentObservedNode){
+ this._currentObservedNode.stopObserving("node_replaced", this.updateHandler);
+ }
+ this._currentObservedNode = uniqNode;
+ this._currentObservedNode.observeOnce("node_replaced", this.updateHandler);
this.updateTitle(uniqNode.getLabel());
var isFile = false;
@@ -171,7 +171,7 @@
}
.infopanel_loading{
opacity: 0;
- transition: opacity ease 0.2s;
+ transition: opacity ease 0.1s;
}
.infopanel_loading_finished{
opacity: 1;
@@ -4102,7 +4102,7 @@ div.menu.rootDirChooser span.rootDirTitle {
#info_panel .infopanel_loading,
.form-ip_content_info_panel .infopanel_loading {
opacity: 0;
- transition: opacity ease 0.2s;
+ transition: opacity ease 0.1s;
}
#info_panel .infopanel_loading_finished,
.form-ip_content_info_panel .infopanel_loading_finished {
@@ -389,13 +389,14 @@ Class.create("MetaCellRenderer", {
htmlElement.select('[data-metatype]').each(function(td){
var metaType = td.readAttribute("data-metatype");
var metaName = td.id.replace(/^ip_/, '');
+ var value;
switch(metaType){
case "stars_rate":
- var value = parseInt(td.innerHTML);
+ value = parseInt(td.innerHTML);
td.update(this.createStars(value, null, metaName));
break;
case "css_label":
- var value = td.innerHTML.strip();
+ value = td.innerHTML.strip();
var rule = this.findCssRule(value);
if(rule){
td.addClassName(rule.cssClass);
@@ -406,14 +407,14 @@ Class.create("MetaCellRenderer", {
if(MetaCellRenderer.staticMetadataCache && MetaCellRenderer.staticMetadataCache.get(metaName)){
var selectorValues = MetaCellRenderer.staticMetadataCache.get(metaName);
if(!selectorValues) break;
- var value = td.innerHTML.strip();
+ value = td.innerHTML.strip();
if(selectorValues[value]){
td.update(selectorValues[value]);
}
}
break;
case "tags":
- var value = td.innerHTML.strip();
+ value = td.innerHTML.strip();
this.displayTagsAsBlocks(metaName, td, value, ajxpNode);
break;
case "text":
@@ -232,8 +232,9 @@ protected function getMetaDefinition()
return $result;
}
- public function editMeta($actionName, $httpVars, $fileVars)
+ public function editMeta(\Psr\Http\Message\ServerRequestInterface &$requestInterface, \Psr\Http\Message\ResponseInterface &$responseInterface)
{
+ $httpVars = $requestInterface->getParsedBody();
if ($this->accessDriver instanceof \Pydio\Access\Driver\StreamProvider\FS\demoAccessDriver) {
throw new Exception("Write actions are disabled in demo mode!");
}
@@ -245,7 +246,7 @@ public function editMeta($actionName, $httpVars, $fileVars)
$selection = new UserSelection($repo, $httpVars);
$nodes = $selection->buildNodes();
- $nodesDiffs = array();
+ $nodesDiffs = new \Pydio\Access\Core\Model\NodesDiff();
$def = $this->getMetaDefinition();
foreach($nodes as $ajxpNode){
@@ -271,13 +272,13 @@ public function editMeta($actionName, $httpVars, $fileVars)
}
$ajxpNode->setMetadata("users_meta", $newValues, false, AJXP_METADATA_SCOPE_GLOBAL);
Controller::applyHook("node.meta_change", array($ajxpNode));
-
- $nodesDiffs[$ajxpNode->getPath()] = $ajxpNode;
+ $ajxpNode->loadNodeInfo(true, false, "all");
+ $nodesDiffs->update($ajxpNode);
}
- XMLWriter::header();
- XMLWriter::writeNodesDiff(array("UPDATE" => $nodesDiffs), true);
- XMLWriter::close();
+ $respStream = new \Pydio\Core\Http\Response\SerializableResponseStream();
+ $responseInterface = $responseInterface->withBody($respStream);
+ $respStream->addChunk($nodesDiffs);
}
/**

0 comments on commit cf6d4dc

Please sign in to comment.