# HG changeset patch
# User gibus
# Date 1394454259 -3600
# Node ID fda73ac53450393cfc2290063f433dba5319e40c
# Parent 6c2ef083d89faf6f2a3d9583a280e4e683ad0183
Use YUI 3.10 (now that conflict with ASCIIMathML is solved).
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/css/site/text_view_comments/c-style-comment.css
--- a/src/cm/media/css/site/text_view_comments/c-style-comment.css Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/css/site/text_view_comments/c-style-comment.css Mon Mar 10 13:24:19 2014 +0100
@@ -5,7 +5,7 @@
/* font-size: 85%; */
}
-.c-comment .yui-widget-hd, .c-comment .yui-widget-bd, .c-comment .yui-widget-ft,.c-newcomment .yui-widget-hd, .c-newcomment .yui-widget-bd, .c-newcomment .yui-widget-ft {
+.c-comment .yui3-widget-hd, .c-comment .yui3-widget-bd, .c-comment .yui3-widget-ft,.c-newcomment .yui3-widget-hd, .c-newcomment .yui3-widget-bd, .c-newcomment .yui3-widget-ft {
text-align: left;
padding: 2px;
}
@@ -77,7 +77,7 @@
text-decoration: none;
}
-.yui-widget-bd .c-ireplyactions {
+.yui3-widget-bd .c-ireplyactions {
overflow: hidden;
margin-right:3px;
float:right;
@@ -120,7 +120,7 @@
border: 1px solid #C1C1C1;
}
-.c-comment .yui-widget-bd {
+.c-comment .yui3-widget-bd {
padding-bottom: 20px;
}
@@ -129,7 +129,7 @@
border:1px solid #BFD6FF;
}
-.c-focus-comment .c-comment .yui-widget-hd {
+.c-focus-comment .c-comment .yui3-widget-hd {
background-color:#BFD6FF;
}
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/css/site/text_view_comments/c-style-gray.css
--- a/src/cm/media/css/site/text_view_comments/c-style-gray.css Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/css/site/text_view_comments/c-style-gray.css Mon Mar 10 13:24:19 2014 +0100
@@ -1,11 +1,11 @@
/* YUI OVERLAY */
/* Overlay Look/Feel */
-.yui-overlay-content {
+.yui3-overlay-content {
border:1px solid #C1C1C1 ;
background-color:#F7F7F7 ;
}
-.yui-overlay-content .yui-widget-hd {
+.yui3-overlay-content .yui3-widget-hd {
background-color:#ECECEC ;
}
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/css/site/text_view_comments/c-style-notelike.css
--- a/src/cm/media/css/site/text_view_comments/c-style-notelike.css Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/css/site/text_view_comments/c-style-notelike.css Mon Mar 10 13:24:19 2014 +0100
@@ -4,7 +4,7 @@
background-color: #FFFFBD;
}
-.c-comment .yui-widget-hd {
+.c-comment .yui3-widget-hd {
background-color: #FCFC6B;
}
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_addcomment_form.js
--- a/src/cm/media/js/client/c_addcomment_form.js Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/js/client/c_addcomment_form.js Mon Mar 10 13:24:19 2014 +0100
@@ -2,7 +2,7 @@
instanciateICommentForm = function() {
gICommentForm = {
- 'position':[CY.WidgetPositionExt.TL, CY.WidgetPositionExt.TL],
+ 'position':[CY.WidgetPositionAlign.TL, CY.WidgetPositionAlign.TL],
'formId':CY.guid(),
'formTitleId':CY.guid(),
'titleInputId':CY.guid(),
@@ -48,12 +48,12 @@
overlay.render('#leftcolumn');
if (!sv_loggedIn) {
- CY.get("#"+gICommentForm['nameInputId']).set('value',gPrefs.get("user","name")) ;
- CY.get("#"+gICommentForm['emailInputId']).set('value',gPrefs.get("user","email")) ;
+ CY.one("#"+gICommentForm['nameInputId']).set('value',gPrefs.get("user","name")) ;
+ CY.one("#"+gICommentForm['emailInputId']).set('value',gPrefs.get("user","email")) ;
}
- CY.get("#"+gICommentForm['formTitleId']).set('innerHTML', gettext('New comment')) ;
- CY.get("#"+gICommentForm['formatInputId']).set('value',gConf['defaultCommentFormat']) ;
+ CY.one("#"+gICommentForm['formTitleId']).set('innerHTML', gettext('New comment')) ;
+ CY.one("#"+gICommentForm['formatInputId']).set('value',gConf['defaultCommentFormat']) ;
CY.on("click", onSubmitICommentFormClick, "#"+gICommentForm['addBtnId']);
CY.on("click", onCancelICommentFormClick, "#"+gICommentForm['cancelBtnId']);
@@ -85,15 +85,15 @@
}
cleanICommentForm = function() {
- CY.get("#"+gICommentForm['currentSelIdI']).set('innerHTML', gNoSelectionYet) ;
+ CY.one("#"+gICommentForm['currentSelIdI']).set('innerHTML', gNoSelectionYet) ;
var hostNode = gICommentForm['overlay'].getStdModNode(CY.WidgetStdMod.BODY) ;
- hostNode.queryAll(".comment_input").set('value', "") ;
+ hostNode.all(".comment_input").set('value', "") ;
- CY.get("#"+gICommentForm['formatInputId']).set('value',gConf['defaultCommentFormat']) ;// for now ...
+ CY.one("#"+gICommentForm['formatInputId']).set('value',gConf['defaultCommentFormat']) ;// for now ...
if (!sv_loggedIn) {
- hostNode.queryAll(".user_input").set('value', "") ;
+ hostNode.all(".user_input").set('value', "") ;
}
}
@@ -109,10 +109,10 @@
onSubmitICommentFormClick = function() {
if (!sv_loggedIn) {
- var name = CY.get("#"+gICommentForm['nameInputId']).get('value') ;
+ var name = CY.one("#"+gICommentForm['nameInputId']).get('value') ;
gPrefs.persist("user", "name", name) ;
- var email = CY.get("#"+gICommentForm['emailInputId']).get('value') ;
+ var email = CY.one("#"+gICommentForm['emailInputId']).get('value') ;
gPrefs.persist("user", "email", email) ;
}
gSync.saveComment(gICommentForm['formId']) ;
@@ -124,20 +124,20 @@
// record selection info in hidden form fields
_updateICommentFormSelection = function(ids, displayedText, csStartSelection, csEndSelection) {
- var node = CY.Node.get('#'+ids['currentSelIdI']) ;
+ var node = CY.Node.one('#'+ids['currentSelIdI']) ;
if (node != null)
node.set('innerHTML', displayedText) ;
- node = CY.get('#'+ids['startWrapperInputId']) ;
+ node = CY.one('#'+ids['startWrapperInputId']) ;
if (node != null)
node.set('value', csStartSelection['elt'].id.substring("sv_".length)) ;
- node = CY.get('#'+ids['startOffsetInputId']) ;
+ node = CY.one('#'+ids['startOffsetInputId']) ;
if (node != null)
node.set('value', csStartSelection['offset']) ;
- node = CY.get('#'+ids['endWrapperInputId']) ;
+ node = CY.one('#'+ids['endWrapperInputId']) ;
if (node != null)
node.set('value', csEndSelection['elt'].id.substring("sv_".length)) ;
- node = CY.get('#'+ids['endOffsetInputId']) ;
+ node = CY.one('#'+ids['endOffsetInputId']) ;
if (node != null)
node.set('value', csEndSelection['offset']) ;
}
@@ -167,16 +167,16 @@
showICommentForm= function () {
removeFormErrMsg(gICommentForm['formId']) ;
if (!sv_loggedIn) {
- if (CY.get("#"+gICommentForm['nameInputId']).get('value') == '')
- CY.get("#"+gICommentForm['nameInputId']).set('value', gPrefs.get('user','name')) ;
- if (CY.get("#"+gICommentForm['emailInputId']).get('value') == '')
- CY.get("#"+gICommentForm['emailInputId']).set('value', gPrefs.get('user','email')) ;
+ if (CY.one("#"+gICommentForm['nameInputId']).get('value') == '')
+ CY.one("#"+gICommentForm['nameInputId']).set('value', gPrefs.get('user','name')) ;
+ if (CY.one("#"+gICommentForm['emailInputId']).get('value') == '')
+ CY.one("#"+gICommentForm['emailInputId']).set('value', gPrefs.get('user','email')) ;
}
gIComments.hide() ;
hideToc();
positionICommentForm() ;
gICommentForm['overlay'].show() ;
- CY.get("#"+gICommentForm['titleInputId']).focus() ;
+ CY.one("#"+gICommentForm['titleInputId']).focus() ;
}
isICommentFormVisible = function () {
@@ -195,7 +195,7 @@
var pos = gICommentForm['position'] ;
if (commentFormHeight > windowHeight) // trying to have save comment visible ... :
- pos = [CY.WidgetPositionExt.BL, CY.WidgetPositionExt.BL] ;
+ pos = [CY.WidgetPositionAlign.BL, CY.WidgetPositionAlign.BL] ;
overlay.set("align", {points:pos});
if (commentFormHeight <= windowHeight)
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_edit_form.js
--- a/src/cm/media/js/client/c_edit_form.js Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/js/client/c_edit_form.js Mon Mar 10 13:24:19 2014 +0100
@@ -48,42 +48,42 @@
gEditICommentHost['overlay'].setStdModContent(CY.WidgetStdMod.BODY,CY.Node.create(editBody),CY.WidgetStdMod.AFTER);
// FORM TITLE
- CY.get("#"+gEdit['ids']['formTitleId']).set('innerHTML', gettext("Edit comment")) ;
+ CY.one("#"+gEdit['ids']['formTitleId']).set('innerHTML', gettext("Edit comment")) ;
// FETCH FORM VALUES FROM COMMENT
var comment = gDb.getComment(gEditICommentHost.commentId) ;
- CY.get("#"+gEdit['ids']['editCommentId']).set('value', comment.id) ;
- CY.get("#"+gEdit['ids']['keyId']).set('value', comment.key) ;
+ CY.one("#"+gEdit['ids']['editCommentId']).set('value', comment.id) ;
+ CY.one("#"+gEdit['ids']['keyId']).set('value', comment.key) ;
- CY.get("#"+gEdit['ids']['changeScopeInputId']+" input").set('checked', false) ;
+ CY.one("#"+gEdit['ids']['changeScopeInputId']+" input").set('checked', false) ;
// Edit scope and category just for the first comment in a thread
// => hides these inputs for a reply.
if (comment.reply_to_id != null) {
- CY.get("#"+gEdit['ids']['changeScopeInputId']).addClass('displaynone')
- if (CY.get("#"+gEdit['ids']['categoryInputId'])) {
- CY.get("#"+gEdit['ids']['categoryInputId']).addClass('displaynone')
- CY.get("#"+gEdit['ids']['categoryInputId']).ancestor().addClass('displaynone')
+ CY.one("#"+gEdit['ids']['changeScopeInputId']).addClass('displaynone')
+ if (CY.one("#"+gEdit['ids']['categoryInputId'])) {
+ CY.one("#"+gEdit['ids']['categoryInputId']).addClass('displaynone')
+ CY.one("#"+gEdit['ids']['categoryInputId']).ancestor().addClass('displaynone')
}
}
changeScopeFormClick() ; // to adapt
- CY.get("#"+gEdit['ids']['nameInputId']).set('value', comment.name) ;
- CY.get("#"+gEdit['ids']['emailInputId']).set('value', comment.email) ;
+ CY.one("#"+gEdit['ids']['nameInputId']).set('value', comment.name) ;
+ CY.one("#"+gEdit['ids']['emailInputId']).set('value', comment.email) ;
if (comment.logged_author) {
- CY.get("#"+gEdit['ids']['nameInputId']).setAttribute("disabled", true);
- CY.get("#"+gEdit['ids']['emailInputId']).setAttribute("disabled", true);
+ CY.one("#"+gEdit['ids']['nameInputId']).setAttribute("disabled", true);
+ CY.one("#"+gEdit['ids']['emailInputId']).setAttribute("disabled", true);
}
// FORM VALUES
- CY.get("#"+gEdit['ids']['titleInputId']).set('value', comment['title']) ;
- CY.get("#"+gEdit['ids']['contentInputId']).set('value', comment['content']) ;
- CY.get("#"+gEdit['ids']['tagsInputId']).set('value', comment['tags']) ;
- if ( CY.get("#"+gEdit['ids']['categoryInputId']))
- CY.get("#"+gEdit['ids']['categoryInputId']).set('value', comment['category']) ;
+ CY.one("#"+gEdit['ids']['titleInputId']).set('value', comment['title']) ;
+ CY.one("#"+gEdit['ids']['contentInputId']).set('value', comment['content']) ;
+ CY.one("#"+gEdit['ids']['tagsInputId']).set('value', comment['tags']) ;
+ if ( CY.one("#"+gEdit['ids']['categoryInputId']))
+ CY.one("#"+gEdit['ids']['categoryInputId']).set('value', comment['category']) ;
- CY.get("#"+gEdit['ids']['formatInputId']).set('value',gConf['defaultCommentFormat']) ;// for now ...
+ CY.one("#"+gEdit['ids']['formatInputId']).set('value',gConf['defaultCommentFormat']) ;// for now ...
// WIDTH
var width = gLayout.getTopICommentsWidth() ;
@@ -107,14 +107,14 @@
if (readyForAction())
gSync.changeScopeFormClick() ;
else {// (onChangeScopeClick triggers an animation : checking for readyForAction does not prevent the checkbox change ...)
- var chckCtrl = CY.get("#"+gEdit['ids']['changeScopeInputId']+" input") ;
+ var chckCtrl = CY.one("#"+gEdit['ids']['changeScopeInputId']+" input") ;
var chck = chckCtrl.get('checked') ;
chckCtrl.set('checked', !chck) ; // set it back
}
}
changeScopeFormClick = function() {
- var node = CY.get("#"+gEdit['ids']['currentSelId']) ;
- if (CY.get("#"+gEdit['ids']['changeScopeInputId']+" input").get('checked'))
+ var node = CY.one("#"+gEdit['ids']['currentSelId']) ;
+ if (CY.one("#"+gEdit['ids']['changeScopeInputId']+" input").get('checked'))
node.removeClass('displaynone') ;
else
node.addClass('displaynone') ;
@@ -130,9 +130,9 @@
}
// REMOVE EDIT FORM NODES FROM ICOMMENT OVERLAY
- var node = gEditICommentHost['overlay'].get('contentBox').query(".icomment-edit-body") ;
+ var node = gEditICommentHost['overlay'].get('contentBox').get(".icomment-edit-body") ;
node.get('parentNode').removeChild(node) ;
- node = gEditICommentHost['overlay'].get('contentBox').query(".icomment-edit-header") ;
+ node = gEditICommentHost['overlay'].get('contentBox').get(".icomment-edit-header") ;
node.get('parentNode').removeChild(node) ;
// SHOW ICOMMENT OVERLAY
diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_icomment.js
--- a/src/cm/media/js/client/c_icomment.js Mon Mar 10 13:04:40 2014 +0100
+++ b/src/cm/media/js/client/c_icomment.js Mon Mar 10 13:24:19 2014 +0100
@@ -75,19 +75,19 @@
});
// CY.on won't work
- this.overlay.get('contentBox').query(".c-close").on("click", this.onCloseCommentClick, this);
- this.overlay.get('contentBox').query(".c-moderate").on("click", this.onModerateCommentClick, this);
- this.overlay.get('contentBox').query(".c-state-pending").on("click", this.onPendingCommentClick, this);
- this.overlay.get('contentBox').query(".c-state-approved").on("click", this.onApprovedCommentClick, this);
- this.overlay.get('contentBox').query(".c-state-unapproved").on("click", this.onUnapprovedCommentClick, this);
- this.overlay.get('contentBox').query(".c-state-cancel").on("click", this.onCancelStateChangeClick, this);
- this.overlay.get('contentBox').query(".c-edit").on("click", this.onEditCommentClick, this);
- this.overlay.get('contentBox').query(".c-delete").on("click", this.onDeleteCommentClick, this);
- this.overlay.get('contentBox').query(".c-reply").on("click", this.onReplyCommentClick, this);
- this.overlay.get('contentBox').query(".c-readreplies").on("click", this.onReadRepliesCommentClick, this);
+ this.overlay.get('contentBox').one(".c-close").on("click", this.onCloseCommentClick, this);
+ this.overlay.get('contentBox').one(".c-moderate").on("click", this.onModerateCommentClick, this);
+ this.overlay.get('contentBox').one(".c-state-pending").on("click", this.onPendingCommentClick, this);
+ this.overlay.get('contentBox').one(".c-state-approved").on("click", this.onApprovedCommentClick, this);
+ this.overlay.get('contentBox').one(".c-state-unapproved").on("click", this.onUnapprovedCommentClick, this);
+ this.overlay.get('contentBox').one(".c-state-cancel").on("click", this.onCancelStateChangeClick, this);
+ this.overlay.get('contentBox').one(".c-edit").on("click", this.onEditCommentClick, this);
+ this.overlay.get('contentBox').one(".c-delete").on("click", this.onDeleteCommentClick, this);
+ this.overlay.get('contentBox').one(".c-reply").on("click", this.onReplyCommentClick, this);
+ this.overlay.get('contentBox').one(".c-readreplies").on("click", this.onReadRepliesCommentClick, this);
- this.overlay.get('contentBox').query(".icomment-header").on("mouseenter", this.onMouseEnterHeader, this);
- this.overlay.get('contentBox').query(".icomment-header").on("mouseleave", this.onMouseLeaveHeader, this);
+ this.overlay.get('contentBox').one(".icomment-header").on("mouseenter", this.onMouseEnterHeader, this);
+ this.overlay.get('contentBox').one(".icomment-header").on("mouseleave", this.onMouseLeaveHeader, this);
this.overlay.get('contentBox').on("click", this.onCommentClick, this);
}
@@ -105,8 +105,8 @@
onModerateCommentClick : function (e) {
e.halt() ; // prevent click triggered on content box
if (readyForAction() && this.isVisible()) {
- this.overlay.get('contentBox').query(".c-iactions").addClass("displaynone") ;
- this.overlay.get('contentBox').query(".c-state-actions").removeClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-iactions").addClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-state-actions").removeClass("displaynone") ;
}
},
onPendingCommentClick : function (e) {
@@ -130,8 +130,8 @@
onCancelStateChangeClick : function (e) {
e.halt() ; // prevent click triggered on content box
if (readyForAction() && this.isVisible()) {
- this.overlay.get('contentBox').query(".c-iactions").removeClass("displaynone") ;
- this.overlay.get('contentBox').query(".c-state-actions").addClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-iactions").removeClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-state-actions").addClass("displaynone") ;
}
},
onDeleteCommentClick : function (e) {
@@ -199,13 +199,13 @@
onMouseEnterHeader : function () {
if (readyForAction() && this.isVisible()) {
- this.overlay.get('contentBox').query(".c-permalink").removeClass('displaynone');
+ this.overlay.get('contentBox').one(".c-permalink").removeClass('displaynone');
}
},
onMouseLeaveHeader : function () {
if (readyForAction() && this.isVisible()) {
- this.overlay.get('contentBox').query(".c-permalink").addClass('displaynone');
+ this.overlay.get('contentBox').one(".c-permalink").addClass('displaynone');
}
},
@@ -239,12 +239,12 @@
}
},
hideContent:function() {
- this.overlay.get('contentBox').query(".icomment-header").addClass('displaynone') ;
- this.overlay.get('contentBox').query(".icomment-body").addClass('displaynone') ;
+ this.overlay.get('contentBox').one(".icomment-header").addClass('displaynone') ;
+ this.overlay.get('contentBox').one(".icomment-body").addClass('displaynone') ;
},
showContent:function() {
- this.overlay.get('contentBox').query(".icomment-header").removeClass('displaynone') ;
- this.overlay.get('contentBox').query(".icomment-body").removeClass('displaynone') ;
+ this.overlay.get('contentBox').one(".icomment-header").removeClass('displaynone') ;
+ this.overlay.get('contentBox').one(".icomment-body").removeClass('displaynone') ;
},
isVisible:function() {
return this.overlay.get('visible') ;
@@ -254,13 +254,13 @@
return this.overlay.show() ;
},
showReadRepliesLnk:function() {
- this.overlay.get('contentBox').query(".c-readreplies").removeClass('displaynone') ;
+ this.overlay.get('contentBox').one(".c-readreplies").removeClass('displaynone') ;
},
hideReadRepliesLnk:function() {
- this.overlay.get('contentBox').query(".c-readreplies").addClass('displaynone') ;
+ this.overlay.get('contentBox').one(".c-readreplies").addClass('displaynone') ;
},
changeModeration:function(comment) {
- var moderationLnk = this.overlay.get('contentBox').query(".c-moderate") ;
+ var moderationLnk = this.overlay.get('contentBox').one(".c-moderate") ;
moderationLnk.set("innerHTML", gettext(comment.state)) ;
moderationLnk.removeClass("c-state-approved") ;
@@ -268,8 +268,8 @@
moderationLnk.removeClass("c-state-unapproved") ;
moderationLnk.addClass("c-state-" + comment.state) ;
- this.overlay.get('contentBox').query(".c-iactions").removeClass("displaynone") ;
- this.overlay.get('contentBox').query(".c-state-actions").addClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-iactions").removeClass("displaynone") ;
+ this.overlay.get('contentBox').one(".c-state-actions").addClass("displaynone") ;
},
isfetched : function() {
return (this.commentId != null) ;
@@ -309,17 +309,17 @@
var newTitleContent = '