Jump to content

Question

Posted (edited)

I used to be able to hold click the titles and edit them(rename them), specifically in the Adjutant Office posts. It's not working for me now actually, this issue just started. I've restarted browser and even tried (gasp) Firefox. There is no option anywhere that allows renaming, is there?.

Edited by Brault 1st MRB

13 answers to this question

Recommended Posts

  • 0
Posted (edited)
On 4/4/2016 at 10:52 AM, Woz 1st MRB said:

So when you go to the list of topics on this page you can't long click a title to edit it, but you can do so from this thread?

 

I can edit title names there as well now and on additional sub forums such as the MOS subforum. It would appear the issue to be resolved.

 

And in regards to your question Woz, yes I could edit the thread title from in this page for the entire time but it was selecting the edit button on the OP.

Edited by Woz 1st MRB
Adding context for best answer
  • 0
Posted

I've noticed that it doesn't work all the time now... but that capability is still there, just hit and miss.  I'll have to do some more testing to figure out why it doesn't work all the time, hopefully it wasn't the plugin that split the pinned and unpinned topics.

 

The only other workaround I know of it to edit the first post of the topic you wanted to change the title for, it should give you the editing view as if you were starting a new topic.

  • 0
Posted

Lt. Col.,

If you track down an example of one that cannot be edited, I have a hunch that the <a> element will be missing:

data-role="editableTitle"

 

 

Example of a title that brings up the edit input as expected:

<a href="http://www.1stmarineraiders.com/forums/topic/33781-new-forum-questions/" data-ipshover="" data-ipshover-target="http://www.1stmarineraiders.com/forums/topic/33781-new-forum-questions/?preview=1" data-ipshover-timeout="1.5" itemprop="url" data-role="editableTitle" id="ips_uid_252_5">
  <span itemprop="name">
    New Forum Questions
  </span>
</a>

Example of a title that does not bring up the edit input as expected:

<a href="http://www.1stmarineraiders.com/forums/topic/33781-new-forum-questions/" data-ipshover="" data-ipshover-target="http://www.1stmarineraiders.com/forums/topic/33781-new-forum-questions/?preview=1" data-ipshover-timeout="1.5" itemprop="url" id="ips_uid_252_5">
  <span itemprop="name">
    New Forum Questions
  </span>
</a>

 

 

In the relevant templates, the html should look something similar this:

<a href='{$row->url()}' {{if $row->tableHoverUrl and $row->canView()}}data-ipsHover data-ipsHover-target='{$row->url()->setQueryString('preview', 1)}' data-ipsHover-timeout='1.5'{{endif}} itemprop="url" {{if $row->canEdit()}}data-role="editableTitle"{{endif}}>
  <span itemprop="name">
	{{if $row->mapped('title')}}{wordbreak="$row->mapped('title')"}{{else}}<em class="ipsType_light">{lang="content_deleted"}</em>{{endif}}
  </span>
</a>

In any case, the segment we are focusing on is the if statement surrounding data-role="editableTitle"

If the template is lacking this segment, there is no way for the title to ever be editable from the long click, even if they have the appropriate permissions.

 

If the element has this attribute in HTML and it is still not working, then it is a JS issue. (If this is the case, I can help if given an example)

If the relevant templates have that if statement, but the HTML element is not showing it in the right cases, then it is probably a permissions issue.

  • 0
Posted (edited)

I found a direct reference in the source code to the "editingTitle: False" being set when I dug through. I'm going to be honest and admit though that I am not super familiar with HTML coding.

 

 

ips.controller.register('core.front.core.moderation', {
	_editTimeout : ,
	_editingTitle : false,
	initialize : function () {
		this.on('submit', '[data-role="moderationTools"]', this.moderationSubmit);
		this.on('mousedown', 'a[data-role="editableTitle"]', this.editTitleMousedown);
		this.on('mouseup mouseleave', 'a[data-role="editableTitle"]', this.editTitleMouseup);
		this.on('click', 'a[data-role="editableTitle"]', this.editTitleMouseclick);
	},
	editTitleMousedown : function (e) {
		var self = this;
		this._editTimeout = setTimeout(function () {
				self._editingTitle = true;
				clearTimeout(this._editTimeout);
				var anchor = $(e.currentTarget);
				anchor.hide();
				var inputNode = $('<input/>').attr({
						type : 'text'
					}).attr('data-role', 'editTitleField').val(anchor.text().trim());
				anchor.after(inputNode);
				inputNode.focus();
				inputNode.on('blur', function () {
					inputNode.addClass('ipsField_loading');
					ips.getAjax()(anchor.attr('href'), {
						data : {
							do  : 'ajaxEditTitle', newTitle : inputNode.val()
						}
					}).done(function (response) {
						anchor.text(inputNode.val());
					}).fail(function (response) {
						ips.ui.alert.show({
							type : 'alert',
							icon : 'warn',
							message : response.responseJSON,
						});
					}).always(function () {
						inputNode.remove();
						anchor.show();
						self._editingTitle = false;
					});
				});
				inputNode.on('keypress', function (e) {
					if (e.keyCode == ips.ui.key.ENTER) {
						e.stopPropagation();
						e.preventDefault();
						inputNode.blur();
						return false;
					}
				});
			}, 1000);
	},
	editTitleMouseup : function (e) {
		clearTimeout(this._editTimeout);
	},
	editTitleMouseclick : function (e) {
		if (this._editingTitle) {
			e.preventDefault();
		}
	}
}

 

Edited by Woz 1st MRB
Made the JS more readable and removed unrelated code.
  • 0
Posted
33 minutes ago, Yamagata 1st MRB said:

Is that for an instance that will not allow you to edit the title?

That is the javascript that makes the title edit work. It pretty much confirms my suspicion that data-role="editableTitle" is required on the <a> element in order for it to editable.

 

Just to offer an explanation of what's going on in that JS, when it sees data-role="editableTitle", it registers a few event listeners on that element. Namely these:

  • mousedown: starts a 1 second timer which eventually uses jQuery to add the text input element and hide the <a> element. It then registers another event listener on the input element that will send the update to the server on blur (losing focus) or on a press of the enter key. After the update completes, it removes the input and un-hides the title.
  • mouseup: cancels the 1 second timer or does nothing if the timer has already fired
  • click: It registers an event on this one to make sure that the click event does not go through (preventDefault) after a long click to edit has occured.

 

  • 0
Posted

Well, here's the whole template for topic view...

{{$rowIds = array();}}
{{foreach $rows as $row}}
	{{$idField = $row::$databaseColumnId;}}
	{{$rowIds[] = $row->$idField;}}
{{endforeach}}
{{$iposted = ( method_exists( $table, 'container' ) AND $table->container() !== NULL ) ? $table->container()->contentPostedIn( null, $rowIds ) : array();}}
{{if count( $rows )}}
	{{$rowCount=0;}}
	{{foreach $rows as $row}}
		{{if $rowCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_forum_listing' )}}
			<li class="ipsDataItem">
				{$advertisement|raw}
			</li>
		{{endif}}
		{{$rowCount++;}}
		{{$idField = $row::$databaseColumnId;}}
		{{if $row->mapped('moved_to')}}
			{{if $movedTo = $row->movedTo()}}
				<li class="ipsDataItem">
					<div class='ipsDataItem_icon ipsType_center ipsType_noBreak'>
						<i class="fa fa-arrow-left ipsType_large"></i>
					</div>
					<div class='ipsDataItem_main'>
						<h4 class='ipsDataItem_title ipsType_break'>
							<em><a href='{$movedTo->url()}' title='{lang="go_to_new_location"}'>{wordbreak="$row->mapped('title')"}</a></em>
						</h4>
						<div class='ipsDataItem_meta'>
							<p class='ipsType_reset ipsType_light ipsType_blendLinks'>{lang="topic_moved_to" sprintf="$movedTo->container()->url(), $movedTo->container()->_title"}</p>
						</div>
					</div>
					{{if $table->canModerate()}}
						<div class='ipsDataItem_modCheck'>
							<span class='ipsCustomInput'>
								<input type='checkbox' data-role='moderation' name="moderate[{$row->$idField}]" data-actions="{{if $row->mapped('featured')}}unfeature{{endif}} {{if $row->mapped('pinned')}}unpin{{endif}} delete" data-state='{{if $row->mapped('pinned')}}pinned{{endif}} {{if $row->mapped('featured')}}featured{{endif}}'>
								<span></span>
							</span>
						</div>
					{{endif}}
				</li>
			{{endif}}
		{{else}}
			<li class="ipsDataItem ipsDataItem_responsivePhoto {{if $row->unread()}}ipsDataItem_unread{{endif}} {{if method_exists( $row, 'tableClass' ) && $row->tableClass()}}ipsDataItem_{$row->tableClass()}{{endif}} {{if $row->hidden()}}ipsModerated{{endif}}" data-rowID='{$row->$idField}' itemprop="itemListElement" itemscope itemtype="http://schema.org/Article">
				{{if member.member_id}}
					<div class='ipsDataItem_icon ipsPos_top'>
						{{if $row->unread()}}
							<a href='{$row->url( 'getNewComment' )}' title='{lang="first_unread_post"}' data-ipsTooltip>
								<span class='ipsItemStatus'><i class="fa {{if in_array( $row->$idField, $iposted )}}fa-star{{else}}fa-circle{{endif}}"></i></span>
							</a>
						{{else}}
							{{if in_array( $row->$idField, $iposted )}}
								<span class='ipsItemStatus ipsItemStatus_read ipsItemStatus_posted'><i class="fa fa-star"></i></span>
							{{else}}
								&nbsp;
							{{endif}}
						{{endif}}
					</div>
				{{endif}}
				<div class='ipsDataItem_main'>
					<h4 class='ipsDataItem_title ipsType_break'>
						{{if $row->locked()}}
							<i class='ipsType_medium fa fa-lock' data-ipsTooltip title='{lang="topic_locked"}'></i>
							
							{{if $row->topic_open_time && $row->topic_open_time > time()}}
								<strong class='ipsType_small' data-ipsTooltip title='{lang="topic_unlocks_at" sprintf="\IPS\DateTime::ts( $row->topic_open_time )->relative(), \IPS\DateTime::ts( $row->topic_open_time )->localeTime( FALSE )"}'>{lang="topic_unlocks_at_short" sprintf="\IPS\DateTime::ts($row->topic_open_time)->relative(1)"}</strong>&nbsp;&nbsp;
							{{endif}}
						{{elseif !$row->locked() && $row->topic_close_time && $row->topic_close_time > time()}}
							<strong class='ipsType_small' data-ipsTooltip title='{lang="topic_locks_at" sprintf="\IPS\DateTime::ts( $row->topic_close_time )->relative(), \IPS\DateTime::ts( $row->topic_close_time )->localeTime( FALSE )"}'><i class='fa fa-clock-o'></i> {lang="topic_locks_at_short" sprintf="\IPS\DateTime::ts($row->topic_close_time)->relative(1)"}</strong>&nbsp;&nbsp;
						{{endif}}
						
						{{if $row->mapped('pinned') || $row->mapped('featured') || $row->hidden() === -1 || $row->hidden() === 1}}
							<span>
								{{if $row->hidden() === -1}}
									<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$row->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
								{{elseif $row->hidden() === 1}}
									<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
								{{endif}}							
								{{if $row->mapped('pinned')}}
									<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span>
								{{endif}}
								{{if $row->mapped('featured')}}
									<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
								{{endif}}
							</span>
						{{endif}}
										
						{{if $row->prefix()}}
							{template="prefix" group="global" app="core" params="$row->prefix( TRUE ), $row->prefix()"}
						{{endif}}
						
						<a href='{$row->url()}' itemprop="url"{{if $row->tableHoverUrl and $row->canView()}} data-ipsHover data-ipsHover-target='{$row->url()->setQueryString('preview', 1)}' data-ipsHover-timeout='1.5'{{endif}}{{if $row->canEdit()}} data-role="editableTitle"{{endif}}>
							<span itemprop="name headline">
								{{if $row->mapped('title')}}{wordbreak="$row->mapped('title')"}{{else}}<em class="ipsType_light">{lang="content_deleted"}</em>{{endif}}
							</span>
						</a>
						<meta itemprop="position" content="{$row->tid}">
					</h4>
					{{if $row->commentPageCount() > 1}}
						{$row->commentPagination( array(), 'miniPagination' )|raw}
					{{endif}}
					<div class='ipsDataItem_meta ipsType_reset ipsType_light ipsType_blendLinks'>
						<span itemprop="author" itemscope itemtype="http://schema.org/Person">
							{lang="byline_itemprop" htmlsprintf="$row->author()->link()"}
						</span>{datetime="$row->mapped('date')" lowercase="true"}
						<meta itemprop="dateCreated datePublished" content="{expression="\IPS\DateTime::create( $row->__get( $row::$databaseColumnMap['date'] ) )->rfc3339()"}">
						{{if !in_array( \IPS\Dispatcher::i()->controller, array( 'forums', 'index' ) )}}
							{lang="in"} <a href="{$row->container()->url()}">{$row->container()->_title}</a>
						{{endif}}
						{{if count( $row->tags() )}}
							&nbsp;&nbsp;
							{template="tags" group="global" app="core" params="$row->tags(), true, true"}
						{{endif}}
					</div>
				</div>
				<ul class='ipsDataItem_stats'>
					{{foreach $row->stats(FALSE) as $k => $v}}
						<li {{if $k == 'num_views'}}class='ipsType_light'{{elseif in_array( $k, $row->hotStats )}}class="ipsDataItem_stats_hot" data-text='{lang="hot_item"}' data-ipsTooltip title='{lang="hot_item_desc"}'{{endif}}>
							<span class='ipsDataItem_stats_number' {{if $k == 'forums_comments' OR $k == 'answers_no_number'}}itemprop='commentCount'{{endif}}>{number="$v"}</span>
							<span class='ipsDataItem_stats_type'>{lang="{$k}" pluralize="$v"}</span>
							{{if ( $k == 'forums_comments' OR $k == 'answers_no_number' ) && \IPS\forums\Topic::modPermission( 'unhide', NULL, $row->container() ) AND $unapprovedComments = $row->mapped('unapproved_comments')}}
								&nbsp;<a href='{$row->url()->setQueryString( 'queued_posts', 1 )}' class='ipsType_warning ipsType_small ipsPos_right ipsResponsive_noFloat' data-ipsTooltip title='{lang="queued_posts_badge" pluralize="$row->topic_queuedposts"}'><i class='fa fa-warning'></i> <strong>{$unapprovedComments}</strong></a>
							{{endif}}
						</li>
					{{endforeach}}
				</ul>
				<ul class='ipsDataItem_lastPoster ipsDataItem_withPhoto ipsType_blendLinks'>
					<li>
						{{if $row->mapped('num_comments')}}
							{template="userPhoto" app="core" group="global" params="$row->lastCommenter(), 'tiny'"}
						{{else}}
							{template="userPhoto" app="core" group="global" params="$row->author(), 'tiny'"}
						{{endif}}
					</li>
					<li>
						{{if $row->mapped('num_comments')}}
							{$row->lastCommenter()->link()|raw}
						{{else}}
							{$row->author()->link()|raw}
						{{endif}}
					</li>
					<li class="ipsType_light">
						<a href='{$row->url( 'getLastComment' )}' title='{lang="get_last_post"}' class='ipsType_blendLinks'>
							{{if $row->mapped('last_comment')}}{datetime="$row->mapped('last_comment')"}{{else}}{datetime="$row->mapped('date')"}{{endif}}
						</a>
					</li>
				</ul>
				{{if $table->canModerate()}}
					<div class='ipsDataItem_modCheck'>
						<span class='ipsCustomInput'>
							<input type='checkbox' data-role='moderation' name="moderate[{$row->$idField}]" data-actions="{expression="implode( ' ', $table->multimodActions( $row ) )"}" data-state='{{if $row->tableStates()}}{$row->tableStates()}{{endif}}'>
							<span></span>
						</span>
					</div>
				{{endif}}
			</li>
		{{endif}}
	{{endforeach}}
{{endif}}

 

  • 0
Posted

Also in regards to your question sir; that snippet of Java Script was from this Thread which I do have the ability to edit the title but only from within edit of the original posting and not as we had done in the past by clicking the title.

  • 0
Posted
On 4/1/2016 at 1:04 PM, Marsden 1st MRB said:

Also in regards to your question sir; that snippet of Java Script was from this Thread which I do have the ability to edit the title but only from within edit of the original posting and not as we had done in the past by clicking the title.

So when you go to the list of topics on this page you can't long click a title to edit it, but you can do so from this thread?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Recent Posts

    • 2nd Platoon Weekly Attendance   Week of 19JAN2025   P = Present | E = Excused | A = Absent   Platoon Staff WO. A. Pitteway - Present MSgt. J. Candy - Present TSgt. A Yoder - Present   1st Squad Squad leader:  SSgt. R. Fielding- Present Cpl. B. Grande - Present Cpl. M. Noel - Excused Pfc. R. Smith - Absent Pfc. C. Keebler - Present Pvt. D. Moffat - Excused Pvt. R. Zera - Absent Pvt. N. Clement - Absent II       2nd Squad Squad leader:  Sgt. S. Holquist - Present Pfc. A. Cannon - Present Pfc. T. Scary - Present Pfc. C. Marsh - Absent Pfc. M. Oake - Excused Pfc. W. Swift - - Present Pvt. L. Whistle - Absent II     Helpers: TSgt. Y. Muthas, Ret. M. Gearhart, Ret. G. Werner
    • I hop into discord with several others and we chat about upcoming events.   R. Smith: "I am retiring or resigning after the realism next month." Me: "You aren't retiring, but we will miss you if you do." Farmer: "Yeah we will miss you ." R. Smith: "Like a deep-dish pizza?" Farmer: "FUCK YOU!"   We burst in laughter.
    • MARINE CORPS ENLISTMENT OFFICE Camp Pendleton, CA   RECRUITMENT LETTER     Hello Mike Nolan, Thank you for taking interest in joining the 1st Marine Raider Battalion.   During your trial period the following will occur: Once accepted as a Recruit, you will remain as a Recruit for 2 weeks from the day of your acceptance until the next BCT Class is offered. During your time as a recruit, it is highly encouraged to play within the Public Server and join Discord with our other members. Upon acceptance, you will be contacted by one of our DIs when the next available BCT is scheduled via the appropriate Discord channel.   We have a BCT class every two weeks. Please keep an eye out for when the next one is made available once you've completed your time requirements!   Upon stating that you understand all the information here, an admin will change your forum name and login to be :   Nolan 1st MRB   Take the time now to change your Steam and in-game name to:   Rec. M. Nolan [1st MRB]   Please make sure to verify your forum account by checking your email. Also, please respond below with a reply showing that you have read and understand these rules. You cannot be fully accepted until you do so. We have a limit on the time to reply, if you do not do so within 48 hours, your application will be denied. Once you reply, you will be approved for your trial period unless otherwise posted.  
    • justnolzey2's application for Enlistment Form Questions Name you wish to use and Age: (Our unit uses realistic names, this does not have to be your real name) Nolzey and I’m 16 Platform Type Steam Steam ID (Use 17 Digit SteamID 64 / PC Game Pass Account Username): JustNolzeybutonPC Do you have a microphone? Yes Which game title are you applying for? Hell Let Loose If you've selected Hell Let Loose, do you understand that this game is currently not cross platform capable and only PC players currently may apply? ( Steam or PC Game Pass) Yes Why do you wish to join the 1st Marine Raiders? I wish to join cause I’ve always wanted to have a more communication in my games and also for the fun of it Did any of our current members play a part in you enlisting? If so, who? If none, how did you learn about us: I checked out discord.org and found you man that way This unit offers more than just a place to play games with each other, do you have any online skills you think would be useful? Yeah I’m a match staff in a dbd oce league and I also just general can talk to people Do you have any Leadership experience that you think will be helpful? For the team I’m in for the dbd tourney and I and the IGL Have you ever been in a realism unit before, and if so, which unit was it? Nah realism virgin if you will By posting this Enlistment form, I acknowledge the instructions completely, declare that I am 16 years old or older, and agree that I have and will follow server and unit rules maturely and respectfully or face immediate rejection. Yes Application stats UserId: 1040804160242733126 Username: justnolzey2 User: @Rec. M. Nolan Duration: 397 seconds Joined guild at: 3 days ago
    • MARINE CORPS ENLISTMENT OFFICE Camp Pendleton, CA   RECRUITMENT LETTER     Hello Julius Martin, Thank you for taking interest in joining the 1st Marine Raider Battalion.   During your trial period the following will occur: Once accepted as a Recruit, you will remain as a Recruit for 2 weeks from the day of your acceptance until the next BCT Class is offered. During your time as a recruit, it is highly encouraged to play within the Public Server and join Discord with our other members. Upon acceptance, you will be contacted by one of our DIs when the next available BCT is scheduled via the appropriate Discord channel.   We have a BCT class every two weeks. Please keep an eye out for when the next one is made available once you've completed your time requirements!   Upon stating that you understand all the information here, an admin will change your forum name and login to be :   Martin 1st MRB   Take the time now to change your Steam and in-game name to:   Rec. J. Martin [1st MRB]   Please make sure to verify your forum account by checking your email. Also, please respond below with a reply showing that you have read and understand these rules. You cannot be fully accepted until you do so. We have a limit on the time to reply, if you do not do so within 48 hours, your application will be denied. Once you reply, you will be approved for your trial period unless otherwise posted.  
×
×
  • Create New...