Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F15047463
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
View Options
diff --git a/static/js/postactions.js b/static/js/postactions.js
index d247ad8..90b1f18 100644
--- a/static/js/postactions.js
+++ b/static/js/postactions.js
@@ -1,122 +1,122 @@
var postActions = function() {
var basePath = window.WF_BASE_PATH || "";
var $container = He.get('moving');
var MultiMove = function(el, id, singleUser) {
var lbl = el.options[el.selectedIndex].textContent;
var collAlias = el.options[el.selectedIndex].value;
var $lbl = He.$('label[for=move-'+id+']')[0];
$lbl.textContent = "moving to "+lbl+"...";
var params;
if (collAlias == '|anonymous|') {
params = [id];
} else {
params = [{
id: id
}];
}
var callback = function(code, resp) {
if (code == 200) {
for (var i=0; i<resp.data.length; i++) {
if (resp.data[i].code == 200) {
$lbl.innerHTML = "moved to <strong>"+lbl+"</strong>";
var pre = "/"+collAlias;
if (typeof singleUser !== 'undefined' && singleUser) {
pre = "";
}
- var newPostURL = pre+"/"+resp.data[i].post.slug;
+ var newPostURL = basePath+pre+"/"+resp.data[i].post.slug;
try {
// Posts page
He.$('#post-'+resp.data[i].post.id+' > h3 > a')[0].href = newPostURL;
} catch (e) {
// Blog index
var $article = He.get('post-'+resp.data[i].post.id);
$article.className = 'norm moved';
if (collAlias == '|anonymous|') {
var draftPre = "";
if (typeof singleUser !== 'undefined' && singleUser) {
draftPre = "d/";
}
$article.innerHTML = '<p><a href="'+basePath+'/'+draftPre+resp.data[i].post.id+'">Unpublished post</a>.</p>';
} else {
$article.innerHTML = '<p>Moved to <a style="font-weight:bold" href="'+newPostURL+'">'+lbl+'</a>.</p>';
}
}
} else {
$lbl.innerHTML = "unable to move: "+resp.data[i].error_msg;
}
}
}
};
if (collAlias == '|anonymous|') {
He.postJSON(basePath + "/api/posts/disperse", params, callback);
} else {
He.postJSON(basePath + "/api/collections/"+collAlias+"/collect", params, callback);
}
};
var Move = function(el, id, collAlias, singleUser) {
var lbl = el.textContent;
try {
var m = lbl.match(/move to (.*)/);
lbl = m[1];
} catch (e) {
if (collAlias == '|anonymous|') {
lbl = "draft";
}
}
el.textContent = "moving to "+lbl+"...";
if (collAlias == '|anonymous|') {
params = [id];
} else {
params = [{
id: id
}];
}
var callback = function(code, resp) {
if (code == 200) {
for (var i=0; i<resp.data.length; i++) {
if (resp.data[i].code == 200) {
el.innerHTML = "moved to <strong>"+lbl+"</strong>";
el.onclick = null;
var pre = "/"+collAlias;
if (typeof singleUser !== 'undefined' && singleUser) {
pre = "";
}
- var newPostURL = pre+"/"+resp.data[i].post.slug;
+ var newPostURL = basePath+pre+"/"+resp.data[i].post.slug;
el.href = newPostURL;
el.title = "View on "+lbl;
try {
// Posts page
He.$('#post-'+resp.data[i].post.id+' > h3 > a')[0].href = newPostURL;
} catch (e) {
// Blog index
var $article = He.get('post-'+resp.data[i].post.id);
$article.className = 'norm moved';
if (collAlias == '|anonymous|') {
var draftPre = "";
if (typeof singleUser !== 'undefined' && singleUser) {
draftPre = "d/";
}
$article.innerHTML = '<p><a href="'+basePath+'/'+draftPre+resp.data[i].post.id+'">Unpublished post</a>.</p>';
} else {
$article.innerHTML = '<p>Moved to <a style="font-weight:bold" href="'+newPostURL+'">'+lbl+'</a>.</p>';
}
}
} else {
el.innerHTML = "unable to move: "+resp.data[i].error_msg;
}
}
}
}
if (collAlias == '|anonymous|') {
He.postJSON(basePath + "/api/posts/disperse", params, callback);
} else {
He.postJSON(basePath + "/api/collections/"+collAlias+"/collect", params, callback);
}
};
return {
move: Move,
multiMove: MultiMove,
};
}();
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Dec 2, 12:40 PM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3831886
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment