# 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 = '
' + comment.title + permalink + '
' + infos + '
' ; var newTitleNode = CY.Node.create(newTitleContent) ; - var prevTitleNode = boundingBoxNode.query(".c-header") ; + var prevTitleNode = boundingBoxNode.one(".c-header") ; if (prevTitleNode == null) // first time, no title yet - boundingBoxNode.query('.icomment-header').insertBefore(newTitleNode, boundingBoxNode.query('.c-iactions')) ; + boundingBoxNode.one('.icomment-header').insertBefore(newTitleNode, boundingBoxNode.one('.c-iactions')) ; else prevTitleNode.get('parentNode').replaceChild(newTitleNode, prevTitleNode) ; // TAG var newTagNode = CY.Node.create('
' + 'tags:' + '' + comment.tags + '
') ; - var prevTagNode = boundingBoxNode.query(".c-tags") ; + var prevTagNode = boundingBoxNode.one(".c-tags") ; if (prevTagNode == null) - boundingBoxNode.query('.icomment-header').appendChild(newTagNode) ; + boundingBoxNode.one('.icomment-header').appendChild(newTagNode) ; else prevTagNode.get('parentNode').replaceChild(newTagNode, prevTagNode) ; // NO TAG ? @@ -328,9 +328,9 @@ // CATEGORY var newCatNode = CY.Node.create('
' + gettext("category") + ': ' + categories[comment.category] + '
') ; - var prevCatNode = boundingBoxNode.query(".c-cat") ; + var prevCatNode = boundingBoxNode.one(".c-cat") ; if (prevCatNode == null) - boundingBoxNode.query('.icomment-header').appendChild(newCatNode) ; + boundingBoxNode.one('.icomment-header').appendChild(newCatNode) ; else prevCatNode.get('parentNode').replaceChild(newCatNode, prevCatNode) ; // NO CATEGORY ? @@ -339,19 +339,19 @@ // CONTENT var newContentNode = CY.Node.create('' + comment.content_html + '') ; - var prevContentNode = boundingBoxNode.query(".c-content") ; + var prevContentNode = boundingBoxNode.one(".c-content") ; if (prevContentNode == null) - boundingBoxNode.query('.icomment-body').appendChild(newContentNode) ; + boundingBoxNode.one('.icomment-body').appendChild(newContentNode) ; else prevContentNode.get('parentNode').replaceChild(newContentNode, prevContentNode) ; // PERMALINK if (sv_prefix=="") { - boundingBoxNode.query(".c-permalink").set("href",sv_site_url + comment.permalink) ; + boundingBoxNode.one(".c-permalink").set("href",sv_site_url + comment.permalink) ; } else { comment_id_delta_prefix = sv_delta != '' ? Array(parseInt(sv_delta)+1).join(',') : ''; - boundingBoxNode.query(".c-permalink").set("href", top.location.protocol + '//' + top.location.hostname + top.location.pathname + '?comment_id_key=' + comment_id_delta_prefix + comment.id_key) ; + boundingBoxNode.one(".c-permalink").set("href", top.location.protocol + '//' + top.location.hostname + top.location.pathname + '?comment_id_key=' + comment_id_delta_prefix + comment.id_key) ; } // MODERATION @@ -365,10 +365,10 @@ */ // open links in new window : - var links = boundingBoxNode.queryAll(".c-content a") ; + var links = boundingBoxNode.all(".c-content a") ; if (links != null) links.setAttribute( "target" , "_blank" ) ; - links = boundingBoxNode.queryAll(".c-header-title a") ; + links = boundingBoxNode.all(".c-header-title a") ; if (links != null) links.setAttribute( "target" , "_blank" ) ; @@ -377,7 +377,7 @@ permAdapt : function(comment) { // this comment permissions - var delLnk = this.overlay.get('contentBox').query(".c-delete") ; + var delLnk = this.overlay.get('contentBox').one(".c-delete") ; if (delLnk) { // there will be a server side check anyway if (!comment.can_delete) delLnk.addClass('displaynone') ; @@ -385,7 +385,7 @@ delLnk.removeClass('displaynone') ; } - var editLnk = this.overlay.get('contentBox').query(".c-edit") ; + var editLnk = this.overlay.get('contentBox').one(".c-edit") ; if (editLnk) { if (!comment.can_edit) editLnk.addClass('displaynone') ; @@ -393,7 +393,7 @@ editLnk.removeClass('displaynone') ; } - var replyLnk = this.overlay.get('contentBox').query(".c-reply") ; + var replyLnk = this.overlay.get('contentBox').one(".c-reply") ; if (replyLnk) { if (!hasPerm("can_create_comment")) replyLnk.addClass('displaynone') ; @@ -401,7 +401,7 @@ replyLnk.removeClass('displaynone') ; } - var moderateLnk = this.overlay.get('contentBox').query(".c-moderate") ; + var moderateLnk = this.overlay.get('contentBox').one(".c-moderate") ; if (moderateLnk) { if (!comment.can_moderate) moderateLnk.addClass('displaynone') ; @@ -410,8 +410,8 @@ } }, setThreadPad : function(pad) { // TODO review ... - this.overlay.get('contentBox').query('.yui-widget-hd').setStyle('paddingLeft', pad + 'px') ; - this.overlay.get('contentBox').query('.yui-widget-bd').setStyle('paddingLeft', pad + 'px') ; + this.overlay.get('contentBox').one('.yui-widget-hd').setStyle('paddingLeft', pad + 'px') ; + this.overlay.get('contentBox').one('.yui-widget-bd').setStyle('paddingLeft', pad + 'px') ; }, setPosition : function(xy) { diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_layout.js --- a/src/cm/media/js/client/c_layout.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_layout.js Mon Mar 10 13:24:19 2014 +0100 @@ -54,8 +54,8 @@ }, setLeftColumnWidth : function (colWidth) { - CY.get('#contentcolumn').setStyle('marginLeft', colWidth + 'px'); - CY.get('#leftcolumn').setStyle('width', colWidth + 'px'); + CY.one('#contentcolumn').setStyle('marginLeft', colWidth + 'px'); + CY.one('#leftcolumn').setStyle('width', colWidth + 'px'); }, parentInterfaceUnfreeze : function() { if (this.isInFrame()) diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_reply_form.js --- a/src/cm/media/js/client/c_reply_form.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_reply_form.js Mon Mar 10 13:24:19 2014 +0100 @@ -53,29 +53,29 @@ var newReplyTitle = (gNewReply['val']['title'] == "" || gNewReply['val']['title'].substring(0, REPLYPREF.length) == REPLYPREF) ? REPLYPREF + comment['title'] : gNewReply['val']['title'] ; if (!sv_loggedIn) { - replyNode.query('.n_name').set('value', gNewReply['val']['name']) ; - replyNode.query('.n_email').set('value', gNewReply['val']['email']) ; + replyNode.one('.n_name').set('value', gNewReply['val']['name']) ; + replyNode.one('.n_email').set('value', gNewReply['val']['email']) ; } - replyNode.query('.n_title').set('value', newReplyTitle) ; - replyNode.query('.n_content').set('value', gNewReply['val']['content']) ; - replyNode.query('.n_tags').set('value', gNewReply['val']['tags']) ; + replyNode.one('.n_title').set('value', newReplyTitle) ; + replyNode.one('.n_content').set('value', gNewReply['val']['content']) ; + replyNode.one('.n_tags').set('value', gNewReply['val']['tags']) ; - replyNode.query('#'+gNewReply['ids']['parentCommentId']).set('value', iCommentToAppendTo['commentId']) ; - replyNode.query('#'+gNewReply['ids']['formatInputId']).set('value', gConf['defaultCommentFormat']) ; + replyNode.one('#'+gNewReply['ids']['parentCommentId']).set('value', iCommentToAppendTo['commentId']) ; + replyNode.one('#'+gNewReply['ids']['formatInputId']).set('value', gConf['defaultCommentFormat']) ; - gNewReplyHost['overlay'].get('contentBox').query(".c-reply").addClass('displaynone') ; + gNewReplyHost['overlay'].get('contentBox').one(".c-reply").addClass('displaynone') ; gNewReply['handlers']['addBtnId'] = CY.on("click", onAddNewReplyClick, "#"+gNewReply['ids']['addBtnId']); gNewReply['handlers']['cancelBtnId'] = CY.on("click", onCancelNewReplyClick, "#"+gNewReply['ids']['cancelBtnId']); var width = gLayout.getTopICommentsWidth() ; changeFormFieldsWidth(gNewReply['ids']['formId'], width) ; - CY.get("#"+gNewReply['ids']['contentInputId']).focus(); + CY.one("#"+gNewReply['ids']['contentInputId']).focus(); } cleanNewReplyForm = function() { if (gNewReplyHost != null) { var replyNode = gNewReplyHost['overlay'].getStdModNode(CY.WidgetStdMod.FOOTER) ; - replyNode.queryAll('.comment_input').set('value','') ; + replyNode.all('.comment_input').set('value','') ; } } cancelNewReplyForm = function() { @@ -89,16 +89,16 @@ } } - gNewReplyHost['overlay'].get('contentBox').query(".c-reply").removeClass('displaynone') ; + gNewReplyHost['overlay'].get('contentBox').one(".c-reply").removeClass('displaynone') ; var footer = gNewReplyHost['overlay'].getStdModNode(CY.WidgetStdMod.FOOTER) ; if (!sv_loggedIn) { - gNewReply['val']['name'] = footer.query('.n_name').get('value') ; - gNewReply['val']['email'] = footer.query('.n_email').get('value') ; + gNewReply['val']['name'] = footer.one('.n_name').get('value') ; + gNewReply['val']['email'] = footer.one('.n_email').get('value') ; } - gNewReply['val']['title'] = footer.query('.n_title').get('value') ; - gNewReply['val']['content'] = footer.query('.n_content').get('value') ; - gNewReply['val']['tags'] = footer.query('.n_tags').get('value') ; + gNewReply['val']['title'] = footer.one('.n_title').get('value') ; + gNewReply['val']['content'] = footer.one('.n_content').get('value') ; + gNewReply['val']['tags'] = footer.one('.n_tags').get('value') ; footer.set('innerHTML', '') ; @@ -108,10 +108,10 @@ // event triggered onAddNewReplyClick = function() { if (!sv_loggedIn) { - var name = CY.get("#"+gNewReply['ids']['nameInputId']).get('value') ; + var name = CY.one("#"+gNewReply['ids']['nameInputId']).get('value') ; gPrefs.persist("user", "name", name) ; - var email = CY.get("#"+gNewReply['ids']['emailInputId']).get('value') ; + var email = CY.one("#"+gNewReply['ids']['emailInputId']).get('value') ; gPrefs.persist("user", "email", email) ; } diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_scopes.js --- a/src/cm/media/js/client/c_scopes.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_scopes.js Mon Mar 10 13:24:19 2014 +0100 @@ -185,7 +185,7 @@ // was replaced with : // afterStartElt = _yuiCloneNode(startElt) ; _yuiCloneNode = function (srcElt) { - var ret = CY.Node.getDOMNode(CY.get('#'+srcElt.id).cloneNode(true)) ; + var ret = CY.Node.getDOMNode(CY.one('#'+srcElt.id).cloneNode(true)) ; ret.id = CY.guid(); return ret ; }; @@ -462,7 +462,7 @@ var nIds = getCommentIdsFromClasses(nElt) ; quicksort(nIds) ; if (areSortedArraysEqual(cIds, nIds)) { - cElt.firstChild.data = cElt.firstChild.data + nElt.firstChild.data; + cElt.firstChild.setData(cElt.firstChild.getData() + nElt.firstChild.getData()); toBeRemovedElts.push(nElt) ; } } diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_selection.js --- a/src/cm/media/js/client/c_selection.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_selection.js Mon Mar 10 13:24:19 2014 +0100 @@ -71,7 +71,7 @@ var ind = parseInt(csStartAncestor.id.substring('sv_'.length)) ; while(r3.toString().length < range.toString().length) { ind++ ; - var node = CY.get("#sv_"+ind) ; + var node = CY.one("#sv_"+ind) ; if (node) { next = CY.Node.getDOMNode(node) ; r3.setEndAfter(next) ; @@ -93,7 +93,7 @@ var ind = parseInt(csEndAncestor.id.substring('sv_'.length)) ; while(r3.toString().length < range.toString().length) { ind-- ; - var node = CY.get("#sv_"+ind) ; + var node = CY.one("#sv_"+ind) ; if (node) { prev = CY.Node.getDOMNode(node) ; r3.setStartBefore(prev) ; @@ -110,7 +110,7 @@ // gather nodes with id sv_xxxx as candidates for start ancestor var startNodeInds = [] ; for (var ind = 0 ; ; ind++) { - var svNode = CY.get("#sv_"+ind) ; + var svNode = CY.one("#sv_"+ind) ; if (svNode == null) { break; } @@ -125,7 +125,7 @@ // gather nodes with id sv_xxxx as candidates for end ancestor var endNodeInds = [] ; for (var ind = 0 ; ; ind++) { - var svNode = CY.get("#sv_"+ind) ; + var svNode = CY.one("#sv_"+ind) ; if (svNode == null) { break; } @@ -142,7 +142,7 @@ for (var j = 0 ; j < endNodeInds.length ; j++) { var r4 = document.createRange() ; - var s = CY.Node.getDOMNode(CY.get("#sv_"+startNodeInds[i])) ; var e = CY.Node.getDOMNode(CY.get("#sv_"+endNodeInds[j])) ; + var s = CY.Node.getDOMNode(CY.one("#sv_"+startNodeInds[i])) ; var e = CY.Node.getDOMNode(CY.one("#sv_"+endNodeInds[j])) ; r4.setStartBefore(s) ; r4.setEndAfter(CY.Node.getDOMNode(e)) ; diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_sync.js --- a/src/cm/media/js/client/c_sync.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_sync.js Mon Mar 10 13:24:19 2014 +0100 @@ -397,9 +397,9 @@ var topAncestorComment = path[path.length - 1] ; var topY = 0 ; if (comment['start_wrapper'] != -1) - topY = CY.get(".c-id-"+topAncestorComment.id).getY() ; + topY = CY.one(".c-id-"+topAncestorComment.id).getY() ; else - topY = CY.get(the_scrolling_part).get('scrollTop') ; + topY = CY.one(the_scrolling_part).get('scrollTop') ; this._showComments([topAncestorComment.id], topY, false) ; // optim when browsing comments with no reply @@ -413,9 +413,9 @@ if (topComment != null) { var topY = 0 ; if (topComment['start_wrapper'] != -1) - topY = CY.get(".c-id-"+topComment.id).getY() ; + topY = CY.one(".c-id-"+topComment.id).getY() ; else - topY = CY.get(the_scrolling_part).get('scrollTop') ; + topY = CY.one(the_scrolling_part).get('scrollTop') ; this._showComments([topComment.id], topY, false) ; // optim when browsing comments with no reply @@ -456,11 +456,11 @@ if (commentDbIds.length > 0) { if (atDocumentTop) { - CY.get(the_scrolling_part).set('scrollTop', 0) ; + CY.one(the_scrolling_part).set('scrollTop', 0) ; } else { gIComments.activate(commentDbIds[0]) ; - var scopeStart = CY.get(".c-id-"+commentDbIds[0]) ; + var scopeStart = CY.one(".c-id-"+commentDbIds[0]) ; // scopeStart could be null when comment has no scope if (scopeStart && !scopeStart.inViewportRegion()) { diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/client/c_toc.js --- a/src/cm/media/js/client/c_toc.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/client/c_toc.js Mon Mar 10 13:24:19 2014 +0100 @@ -49,7 +49,7 @@ // attach to DOM overlay.render('#leftcolumn'); - CY.get("#"+gToc['tocTitleId']).set('innerHTML', gettext('Table of contents')) ; + CY.one("#"+gToc['tocTitleId']).set('innerHTML', gettext('Table of contents')) ; gToc['overlay'] = overlay ; diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/site/c_text_view_comments.js --- a/src/cm/media/js/site/c_text_view_comments.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/site/c_text_view_comments.js Mon Mar 10 13:24:19 2014 +0100 @@ -30,7 +30,6 @@ // filter :'raw', timeout :10000 }).use( - "text-modern-style", "cookie", "json", "overlay", @@ -114,7 +113,7 @@ if (selection != null) { updateICommentFormSelection(selection) ; if (gEditICommentHost != null) { - var modifyScope = CY.get("#"+gEdit['ids']['changeScopeInputId']+" input").get('checked') ; + var modifyScope = CY.one("#"+gEdit['ids']['changeScopeInputId']+" input").get('checked') ; if (modifyScope) { gEditICommentHost.scrollIntoView() ; } @@ -241,8 +240,8 @@ gGETValues = CY.JSON.parse(sv_get_params); - CY.get('#maincontainer').setStyle('display', 'block'); - CY.get('#textcontainer').setStyle('display', 'block'); + CY.one('#maincontainer').setStyle('display', 'block'); + CY.one('#textcontainer').setStyle('display', 'block'); var val = (sv_withComments) ? gPrefs.get('layout','comments_col_width') : 0 ; var colWidth = sliderValToPx(val) ; diff -r 6c2ef083d89f -r fda73ac53450 src/cm/media/js/site/f_text_view_frame.js --- a/src/cm/media/js/site/f_text_view_frame.js Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/media/js/site/f_text_view_frame.js Mon Mar 10 13:24:19 2014 +0100 @@ -402,9 +402,9 @@ var wish = $('#c_textpref_style').val() ; for (var key in styles) { if (key == wish) - frames['text_view_comments'].CY.get("#textcontainer").addClass(key) ; + frames['text_view_comments'].CY.one("#textcontainer").addClass(key) ; else - frames['text_view_comments'].CY.get("#textcontainer").removeClass(key) ; + frames['text_view_comments'].CY.one("#textcontainer").removeClass(key) ; } }; diff -r 6c2ef083d89f -r fda73ac53450 src/cm/settings.py --- a/src/cm/settings.py Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/settings.py Mon Mar 10 13:24:19 2014 +0100 @@ -125,8 +125,8 @@ PISTON_IGNORE_DUPE_MODELS = True # YUI version : set to js/lib/ version directory to be used -#YUI_VERSION = 'yui_3.10.3' -YUI_VERSION = 'yui3.0.0' +YUI_VERSION = 'yui_3.10.3' +#YUI_VERSION = 'yui3.0.0' # base timezone used for client diff -r 6c2ef083d89f -r fda73ac53450 src/cm/templates/site/layout/req_yui.html --- a/src/cm/templates/site/layout/req_yui.html Mon Mar 10 13:04:40 2014 +0100 +++ b/src/cm/templates/site/layout/req_yui.html Mon Mar 10 13:24:19 2014 +0100 @@ -1,4 +1,4 @@ - - - + + +