Jump to content
  • 0

Cannot Rename Topic Titles


Brault 1st MRB

Question

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
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0
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
Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

The weirdest thing is that it's hit and miss...  I've got root admin, so everything and anything is editable and viewable for me, but I still run into the issue every once in a while.  

 

Of course, now that I'm trying to troubleshoot it, I haven't had any problems.

Just-press-next-theres-nothing-to-see-he

Link to comment
Share on other sites

  • 0

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.
Link to comment
Share on other sites

  • 0
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.

 

Link to comment
Share on other sites

  • 0

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}}

 

Link to comment
Share on other sites

  • 0
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?

Link to comment
Share on other sites

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

    • Vacbanned.com is currently down, once its back up we will process your application! Sorry for the inconvenience, feel free to come chill with us in discord and get to know the unit, and we can answer any questions you may have in the meantime and thank you for your interest in the 1st Marine Raiders! 
    • Application View Application Status Spike Garrison Submitted 04/29/2024 03:42 PM Name Spike Garrison Timezone America/New_York Country United States Additional Application Fields Please indicate platform type, Steam or PC Game pass PC Steam ID (Use the 17-digit steamID64) / PC Game Pass account username 76561199172592985 Age 17 Location United States Do you have a microphone? Yes Discord is a requirement, do you currently have discord installed? Yes What is your current discord name being used in the MRB Discord at the time of application? Vallorz Which game are you applying for? (Day of Defeat: Source/Hell Let Loose) 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? Been playing HLL for awhile, but never was in a clan or dedicated server, the way I played was just server hopping on random servers. I took interest in the 1MRB since it relates to the Marines, a branch I'm planning to join in the future. (Not as a Raider) And it so happens to relate to 2 games I love, one being HLL and DoD:S though I stopped playing source games. Did any of our current members play a part in you enlisting? If so, who? Unfortunately none. 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? I'm more of a team guy, take roles when needed, I'm mostly a jack of all trades master of none guy, for tech stuff I'm certified in Word, Excel, and PowerPoint, all both 2019 and 365 Office/Microsoft Specialist Badges. Do you have any Leadership experience that you think will be helpful? I have a very small amount of experience leadership, I think of myself as a person who'll take leadership via process of elimination. (the last guy to be a leader) Have you ever been in a realism unit before, and if so, which unit was it? Different Game Platform from HLL (Squad/ArmA/Etc), 1st Marine Force Reconnaissance (Squadmate), 3rd Marine Air Wing (Door Gunner), 1st Cavalry Division (Crew Chief). How did you hear about us? Heard about it on a reddit forum about HLL Clans. 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
    • 2nd Platoon Weekly Attendance   Week of 28APR2024   P = Present | E = Excused | A = Absent   Platoon Staff WO. A. Pitteway - Present MSgt. J. Candy - Present TSgt. A. Yoder - Present   1st Squad Squad leader:  Cpl. R. Fielding - Excused Cpl. B. Grande - Present Pfc. R. Smith - Excused Pfc. X. Hocker - Present Pvt. B. Niles - Excused* Resigned Pvt. M. Noel - Present   2nd Squad Squad leader:  Cpl. C. Dilley - Excused Cpl. H. Nielsen - Present Cpl. S. Holquist - Excused Pfc. R. Mcspadden - Absent IIII Pfc. T. Scary - Present Pfc. C. Marsh - Present Pvt. K. Bradley - Absent III   Reserves: Pvt. T. Mongillo - Excused   Helpers: CWO. R. Martinez, TSgt. Y. Muthas, Cpl. D. Galbraith   Attendance Policy    1. Each Week you must submit a TDR through Perscomm on the website before practice starts     2. If you do not submit a TDR you will get an Unexcused absence    3. Three (3) Unexcused absences in a row you receive an Infraction Report with a possible demerit with Command Staff approval.    4. Five (5) Unexcused absences in a row will result in being moved from Active duty to Reserves   If you need any assistance learning how to fill out a TDR contact your Squad Leader or your Platoon Sergeant.
    • The player in question has been unbanned, please inform them of our rules and that should another instance occur then the ban will be immediately reinstated.
    • Name:  Maj. DonnieBaker103 Steam I.D:  STEAM_0:0:10692377 Date & Time of ban: 08/18/2012 Admin who banned you: Jankovski Reason we should Unban: From what I can find, player was banned once in 2012 for excessive teamkilling, it looking at gameME/sourcebans. Member received permanent on 1st ban. I have played with Donnie over last few years and while at the 6th. I think the ban should be lifted.
×
×
  • Create New...