Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v
diff -u -r1.200.2.12 -r1.200.2.13
--- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 5 Jun 2016 12:45:53 -0000 1.200.2.12
+++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 10 Sep 2016 10:11:41 -0000 1.200.2.13
@@ -39,6 +39,7 @@
::xo::Page requireCSS "/resources/ajaxhelper/yui/$path"
} else {
::xo::Page requireCSS "//yui.yahooapis.com/$version/build/$path"
+ security::csp::require style-src yui.yahooapis.com
}
}
@@ -47,6 +48,7 @@
::xo::Page requireJS "/resources/ajaxhelper/yui/$path"
} else {
::xo::Page requireJS "//yui.yahooapis.com/$version/build/$path"
+ security::csp::require script-src yui.yahooapis.com
}
}
@@ -1402,8 +1404,8 @@
set save_tag_link [$package_id make_link -link $p_link $__including_page \
save-tags return_url]
set popular_tags_link [$package_id make_link -link $p_link $__including_page \
- popular-tags return_url weblog_page]
-
+ popular-tags]
+
set tags [lsort [::xowiki::Page get_tags -user_id [::xo::cc user_id] \
-item_id [$__including_page item_id] -package_id $package_id]]
set entries [list]
@@ -1414,16 +1416,30 @@
}
set tags_with_links [join [lsort $entries] {, }]
- if {![my exists id]} {my set id [::xowiki::Includelet html_id [self]]}
- set content [subst -nobackslashes {
+ if {![my exists id]} {
+ my set id [::xowiki::Includelet html_id [self]]
+ }
+ set content [subst {
#xowiki.your_tags_label#: $tags_with_links
- (
#xowiki.edit_link#,
-
#xowiki.popular_tags_link#)
+ (
#xowiki.edit_link#,
+
#xowiki.popular_tags_link#)
}]
+
+ template::add_body_script -script [subst {
+ document.getElementById('[my id]-edit-tags-control').addEventListener('click', function () {
+ document.getElementById("[my id]-edit_tags").style.display="block";
+ return false;
+ });
+ document.getElementById('[my id]-popular-tags-control').addEventListener('click', function () {
+ get_popular_tags("[ns_quotehtml $popular_tags_link]","[my id]");
+ return false;
+ });
+ }]
+
return $content
}
@@ -1492,9 +1508,11 @@
my instvar __including_page
set item_id [$__including_page item_id]
set gc_return_url [$package_id url]
+ #
# Even, if general_comments is turned on, don't offer the
# link to add comments, unless the user is logged in.
# Otherwise, this attracts spammers and search bots
+ #
if {[::xo::cc user_id] != 0} {
set gc_link [general_comments_create_link \
-object_name [$__including_page title] \
Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v
diff -u -r1.327.2.21 -r1.327.2.22
--- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 16 Jun 2016 09:36:47 -0000 1.327.2.21
+++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 10 Sep 2016 10:11:41 -0000 1.327.2.22
@@ -1193,7 +1193,8 @@
-groupby "tag" \
-orderby "nr" \
-limit $limit] {
- lappend entries "
[ns_quotehtml $tag ($nr)]"
+ set label [ns_quotehtml "$tag ($nr)"]
+ lappend entries "
$label"
}
ns_return 200 text/html "[_ xowiki.popular_tags_label]: [join $entries {, }]"
}
@@ -1220,7 +1221,7 @@
}
}
#my show_fields $form_fields
- lassign [my get_form_data -field_names $query_field_names $form_fields] validation_erors category_ids
+ lassign [my get_form_data -field_names $query_field_names $form_fields] validation_erors category_ids
if {$validation_errors == 0} {
#
@@ -1559,7 +1560,7 @@
#
::xo::Page requireCSS /resources/xowiki/xowiki.css
if {$footer ne ""} {
- ::xo::Page requireJS {
+ template::add_body_script -script {
function get_popular_tags(popular_tags_link, prefix) {
var http = getHttpObject();
http.open('GET', popular_tags_link, true);
@@ -1579,6 +1580,7 @@
}
}
set header_stuff [::xo::Page header_stuff]
+ #ns_log notice "=== HEADER STUFF <$header_stuff>"
if {![my exists description]} {my set description [my get_description $content]}
if {[info commands ::template::head::add_meta] ne ""} {