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

    • Cannon: I used probability to shoot you in that bush Candy. Candy: What is that "Bush Probability Focus?" Ucar: "Bush probability Focus?" Thats what I call sex. Everyone laughs.  
    • Welcome to the 1st Marine Raider Battalion! Now that you have been accepted don't forget to: 1. Check in at the Recruit Depot 2. Read the Marine Raider Handbook (you are expected to know everything in it) 3. Change your steam friends Avatar 4. Download, install and log into Discord NOTE: Please be aware that you will not have access to the above links until an officer has given you full access to the forum. Access to the forum should be given to you within the next day.
    • MARINE CORPS ENLISTMENT OFFICE Camp Pendleton, CA   RECRUITMENT LETTER     Hello F. Flobbs   Thank you for taking interest in joining the 1st Marine Raider Battalion. There are a few things you should know before I give you a date for Basic Combat Training (BCT). Firstly, you are restricted to the weapon class of Rifleman for the duration of your time as a Recruit. Secondly, any questions you have about our unit, alternate times for your BCT, or just rules in general, you should contact your drill instructors GySgt. R. Fielding, 1stSgt. J. Candy, CWO. A. Pitteway, and 2ndLt. R. Martinez.    BCT will be Held on a day communicated to you by a member of the Drill Instructor team.   Do not hesitate to reach out to our Drill Instructors for additional information. They can be reached through the Forum Private Messaging System most reliably (click the envelope next to their name above).   Upon stating that you understand all the information here, an admin will change your forum name and login to be:   Flobbs 1st MRB   Take the time now to change your Steam and in-game name to:   Rec. F. Flobbs [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 and restrictions set. 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 BCT unless otherwise posted.  
    • 1. Name you wish to use and Age:, (Our unit uses realistic names, this does not have to be your real name) Flobbs 2. Platform Type, Steam 3. Steam ID (Use 17 Digit SteamID 64 / PC Game Pass Account Username):, 76561198031905030 4. Do you have a microphone?, Yes 5. Which game title are you applying for?, Day of Defeat: Source 6. 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 7. Why do you wish to join the 1st Marine Raiders?, Fielding is making me. no, known everyone for a while 8. Did any of our current members play a part in you enlisting? If so, who? If none, how did you learn about us:, lots, but I suppose Fielding 9. 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?, several. Ran a large 300 person DOD group back in my days. Ran a few for other games, Ran one for HLL. Developed software, plugins, websites, .... just ask 10. Do you have any Leadership experience that you think will be helpful?, yes 11. Have you ever been in a realism unit before, and if so, which unit was it?, no 12. 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 Submission stats UserId: 112220260907614208 Username: flobbs User: @Flobbs™ Duration: 363s Joined guild 3 years ago
×
×
  • Create New...