Jump to content

Forum Upgrade Bugs


shought

Recommended Posts

1 hour ago, shought said:

I will look into restoring the post preview functionality, I understand it can be helpful and it doesn't use much if any server resources.

Sweet!

Link to comment
Share on other sites


  • Replies 895
  • Views 89.2k
  • Created
  • Last Reply

Preview Post Button 1.0.2 hook for IPS Community Suite.

Preview Post.zip

 

This hook was downloaded by myself from the IPS Marketplace using my own licensed IPS account.

 

See my post above this one for info link for the hook.

 

Link to comment
Share on other sites


Thanks sinders, I knew about the hook, just hadn't gotten around to installing it yet (I have quite a few tasks to attend to over here at the moment).

 

We've got an active IPB license ourselves, in order to get support etc.

Link to comment
Share on other sites


3 hours ago, hihello said:

What is the new rule regarding member title?

 

I believe members are required to be ViP now before they can change their member title. I could change this to Advanced Member though, as a matter of fact I think I'll do so right away.

 

Edit: members now need 250 posts in order to change their member title.

Link to comment
Share on other sites


Two words about the Post Preview Button, it does not have any importance at all, because already you can see exactly what you are posting. (WYSIWYG) 
This is a preview, but in a different format, and deceptive. Almost full width of the page pop-up window will open.
Here, the proposed version is not 1.0.2, but 1.0.1

PS! If it does not allowed to post here, please delete.

 

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<plugin name="Preview Post" version_long="10001" version_human="1.0.1" author="Shir Raanan" website="" update_check=""><hooks><hook type="C" class="\IPS\forums\modules\front\forums\index" filename="indexCodeHook"><![CDATA[//<?php

class hook42 extends _HOOK_CLASS_
{
	public function previewPost()
	{
		try
		{
			\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'plugins', 'core', 'global' )->postPreview() );
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}
}]]></hook><hook type="S" class="\IPS\Theme\class_core_front_forms" filename="formsThemeHook"><![CDATA[//<?php

class hook43 extends _HOOK_CLASS_
{

/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
 return array_merge_recursive( array (
  'commentTemplate' => 
  array (
    0 => 
    array (
      'selector' => 'form > div.ipsComposeArea > div.ipsComposeArea_editor > ul.ipsToolList > li:last-child',
      'type' => 'add_inside_end',
      'content' => '<li><a href=\'\' data-controller="plugins.previewPost" data-ipsdialog data-ipsdialog-title="{lang="preview_post"}" data-ipsdialog-content="{template=\'postPreview\' app=\'core\' location=\'global\' group=\'plugins\'}" class="ipsButton ipsButton_link">{lang="preview_post"}</a></li>',
    ),
  ),
  'popupTemplate' => 
  array (
    0 => 
    array (
      'selector' => 'form > ul.ipsPad.ipsToolList',
      'type' => 'add_inside_end',
      'content' => '<li><a href=\'\' data-controller="plugins.previewPost" data-ipsdialog data-ipsdialog-title="{lang="preview_post"}" data-ipsdialog-content="{template=\'postPreview\' app=\'core\' location=\'global\' group=\'plugins\'}" class="ipsButton ipsButton_link">{lang="preview_post"}</a></li>',
    ),
  ),
), parent::hookData() );
}
/* End Hook Data */






































}]]></hook><hook type="S" class="\IPS\Theme\class_forums_front_submit" filename="topicThemeHook"><![CDATA[//<?php

class hook44 extends _HOOK_CLASS_
{

/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
 return array_merge_recursive( array (
  'createTopicForm' => 
  array (
    0 => 
    array (
      'selector' => 'form > div.ipsBox > div.ipsAreaBackground.ipsPad.ipsType_center',
      'type' => 'add_inside_start',
      'content' => '<a href=\'\' data-controller="plugins.previewPost" data-ipsdialog data-ipsdialog-title="{lang="preview_post"}" data-ipsdialog-content="{template=\'postPreview\' app=\'core\' location=\'global\' group=\'plugins\'}" class="ipsButton ipsButton_link">{lang="preview_post"}</a>',
    ),
  ),
), parent::hookData() );
}
/* End Hook Data */
























































}]]></hook></hooks><settings><setting><key>preview_parse_bbcode</key><default/></setting></settings><htmlFiles><html filename="postPreview.phtml">PGlwczp0ZW1wbGF0ZSBwYXJhbWV0ZXJzPSIiIC8+CjxkaXYgY2xhc3M9J2NQb3N0X2NvbnRlbnRXcmFwIGlwc1BhZCc+CQoJPGRpd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AgKgogICAgICogICBkaXNwbGF5Q29udGVudCAtIERlZmF1bHRzIHRvIHRydWUuIElmIGZhbHNlLCB0aGUgY29udGVudCBmb3IgdGhlIHRhZyB3aWxsCiAgICAgKiAgICAgICAgICAgICAgICAgICAgbm90IGJlIGRpc3BsYXllZC4gVGhpcyBpcyB1c2VmdWwgZm9yIHRhZ3MgbGlrZSBJTUcgd2hlcmUKICAgICAqICAgICAgICAgICAgICAgICAgICBpdHMgY29udGVudHMgYXJlIGFjdHVhbGx5IGEgcGFyYW1ldGVyIGlucHV0LgogICAgICoKICAgICAqICAgcmVzdHJpY3RDaGlsZHJlblRvIC0gQSBsaXN0IG9mIEJCQ29kZSB0YWdzIHdoaWNoIGFyZSBhbGxvd2VkIHRvIGJlIG5lc3RlZAogICAgICogICAgICAgICAgICAgICAgICAgICAgICB3aXRoaW4gdGhpcyBCQkNvZGUgdGFnLiBJZiB0aGlzIHByb3BlcnR5IGlzIG9taXR0ZWQsCiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIGFueSBCQkNvZGUgdGFnIG1heSBiZSBuZXN0ZWQgd2l0aGluIHRoZSB0YWcuCiAgICAgKgogICAgICogICByZXN0cmljdFBhcmVudHNUbyAtIEEgbGlzdCBvZiBCQkNvZGUgdGFncyB3aGljaCBhcmUgYWxsb3dlZCB0byBiZSBwYXJlbnRzIG9mCiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBCQkNvZGUgdGFnLiBJZiB0aGlzIHByb3BlcnR5IGlzIG9taXR0ZWQsIGFueSBCQkNvZGUKICAgICAqICAgICAgICAgICAgICAgICAgICAgICB0YWcgbWF5IGJlIGEgcGFyZW50IG9mIHRoZSB0YWcuCiAgICAgKgogICAgICogICBub1BhcnNlIC0gdHJ1ZSBvciBmYWxzZS4gSWYgdHJ1ZSwgbm9uZSBvZiB0aGUgY29udGVudCBXSVRISU4gdGhpcyB0YWcgd2lsbCBiZQogICAgICogICAgICAgICAgICAgcGFyc2VkIGJ5IH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gICAgICAgICAgICAgICByZXR1cm4gJzwvc3Bhbj4nOwogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAvKgogICAgICAgICAgICBUaGlzIHRhZyBkb2VzIG5vdGhpbmcgYW5kIGlzIGhlcmUgbW9zdGx5IHRvIGJlIHVzZWQgYXMgYSBjbGFzc2lmaWNhdGlvbiBmb3IKICAgICAgICAgICAgdGhlIGJiY29kZSBpbnB1dCB3aGVuIGV2YWx1YXRpbmcgcGFyZW50LWNoaWxkIHRhZyByZWxhdGlvbnNoaXBzCiAgICAgICAgKi8KICAgICAgICAiYmJjb2RlIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImNlbnRlciI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9InhiYmNvZGUtY2VudGVyIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9zcGFuPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICAiY29kZSI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9InhiYmNvZGUtY29kZSI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvc3Bhbj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBub1BhcnNlOiB0cnVlCiAgICAgICAgfSwKICAgICAgICAiY29sb3IiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgogICAgICAgICAgICAgICAgdmFyIGNvbG9yQ29kZSA9IChwYXJhbXMuc3Vic3RyKDEpKS50b0xvd2VyQ2FzZSgpIHx8ICJibGFjayI7CiAgICAgICAgICAgICAgICBjb2xvck5hbWVQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBjb2xvckNvZGVQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBpZiAoICFjb2xvck5hbWVQYXR0ZXJuLnRlc3QoIGNvbG9yQ29kZSApICkgewogICAgICAgICAgICAgICAgICAgIGlmICggIWNvbG9yQ29kZVBhdHRlcm4udGVzdCggY29sb3JDb2RlICkgKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yQ29kZSA9ICJibGFjayI7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbG9yQ29kZS5zdWJzdHIoMCwxKSAhPT0gIiMiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvckNvZGUgPSAiIyIgKyBjb2xvckNvZGU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBzdHlsZT0iY29sb3I6JyArIGNvbG9yQ29kZSArICciPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImVtYWlsIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewoKICAgICAgICAgICAgICAgIHZhciBteUVtYWlsOwoKICAgICAgICAgICAgICAgIGlmICghcGFyYW1zKSB7CiAgICAgICAgICAgICAgICAgICAgbXlFbWFpbCA9IGNvbnRlbnQucmVwbGFjZSgvPC4qPz4vZywiIik7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIG15RW1haWwgPSBwYXJhbXMuc3Vic3RyKDEpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGVtYWlsUGF0dGVybi5sYXN0SW5kZXggPSAwOwogICAgICAgICAgICAgICAgaWYgKCAhZW1haWxQYXR0ZXJuLnRlc3QoIG15RW1haWwgKSApIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJzxhPic7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcmV0dXJuICc8YSBocmVmPSJtYWlsdG86JyArIG15RW1haWwgKyAnIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9hPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJmYWNlIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewoKICAgICAgICAgICAgICAgIHZhciBmYWNlQ29kZSA9IHBhcmFtcy5zdWJzdHIoMSkgfHwgImluaGVyaXQiOwogICAgICAgICAgICAgICAgZm9udEZhY2VQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBpZiAoICFmb250RmFjZVBhdHRlcm4udGVzdCggZmFjZUNvZGUgKSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgZmFjZUNvZGUgPSAiaW5oZXJpdCI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzcGFuIHN0eWxlPSJmb250LWZhbWlseTonICsgZmFjZUNvZGUgKyAnIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9zcGFuPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKCiAgICAgICAgImZvbnQiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgogICAgICAgICAgICAgICAgdmFyIGZhY2VDb2RlID0gcGFyYW1zLnN1YnN0cigxKSB8fCAiaW5oZXJpdCI7CiAgICAgICAgICAgICAgICBmb250RmFjZVBhdHRlcm4ubGFzdEluZGV4ID0gMDsKICAgICAgICAgICAgICAgIGlmICggIWZvbnRGYWNlUGF0dGVybi50ZXN0KCBmYWNlQ29kZSApICkgewogICAgICAgICAgICAgICAgICAgICAgICBmYWNlQ29kZSA9ICJpbmhlcml0IjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OicgKyBmYWNlQ29kZSArICciPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgICJpIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBjbGFzcz0ieGJiY29kZS1pIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9zcGFuPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJpbWciOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgogICAgICAgICAgICAgICAgdmFyIG15VXJsID0gY29udGVudDsKCiAgICAgICAgICAgICAgICB1cmxQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBpZiAoICF1cmxQYXR0ZXJuLnRlc3QoIG15VXJsICkgKSB7CiAgICAgICAgICAgICAgICAgICAgbXlVcmwgPSAiIjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICByZXR1cm4gJzxpbWcgc3JjPSInICsgbXlVcmwgKyAnIiAvPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgICAgICB9LAogICAgICAgICAgICBkaXNwbGF5Q29udGVudDogZmFsc2UKICAgICAgICB9LAogICAgICAgICJqdXN0aWZ5IjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBjbGFzcz0ieGJiY29kZS1qdXN0aWZ5Ij4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9zcGFuPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJsYXJnZSI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKCQkJCXZhciBwYXJhbXMgPSBwYXJhbXMgfHwgJyc7CgkJCQl2YXIgY29sb3JDb2RlID0gcGFyYW1zLnN1YnN0cigxKSB8fCAiaW5oZXJpdCI7CiAgICAgICAgICAgICAgICBjb2xvck5hbWVQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBjb2xvckNvZGVQYXR0ZXJuLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgICAgICBpZiAoICFjb2xvck5hbWVQYXR0ZXJuLnRlc3QoIGNvbG9yQ29kZSApICkgewogICAgICAgICAgICAgICAgICAgIGlmICggIWNvbG9yQ29kZVBhdHRlcm4udGVzdCggY29sb3JDb2RlICkgKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yQ29kZSA9ICJpbmhlcml0IjsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29sb3JDb2RlLnN1YnN0cigwLDEpICE9PSAiIyIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yQ29kZSA9ICIjIiArIGNvbG9yQ29kZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KCgogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBjbGFzcz0ieGJiY29kZS1zaXplLTM2IiBzdHlsZT0iY29sb3I6JyArIGNvbG9yQ29kZSArICciPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImxlZnQiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzcGFuIGNsYXNzPSJ4YmJjb2RlLWxlZnQiPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImxpIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICI8bGk+IjsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gIjwvbGk+IjsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVzdHJpY3RQYXJlbnRzVG86IFsibGlzdCIsInVsIiwib2wiXQogICAgICAgIH0sCiAgICAgICAgImxpc3QiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzx1bD4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC91bD4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICByZXN0cmljdENoaWxkcmVuVG86IFsiKiIsICJsaSJdCiAgICAgICAgfSwKICAgICAgICAibm9wYXJzZSI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIG5vUGFyc2U6IHRydWUKICAgICAgICB9LAogICAgICAgICJvbCI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPG9sPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L29sPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlc3RyaWN0Q2hpbGRyZW5UbzogWyIqIiwgImxpIl0KICAgICAgICB9LAogICAgICAgICJwaHAiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzcGFuIGNsYXNzPSJ4YmJjb2RlLWNvZGUiPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgbm9QYXJzZTogdHJ1ZQogICAgICAgIH0sCiAgICAgICAgInF1b3RlIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8YmxvY2txdW90ZSBjbGFzcz0ieGJiY29kZS1ibG9ja3F1b3RlIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9ibG9ja3F1b3RlPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJyaWdodCI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9InhiYmNvZGUtcmlnaHQiPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgInMiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzcGFuIGNsYXNzPSJ4YmJjb2RlLXMiPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgInNpemUiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgogICAgICAgICAgICAgICAgdmFyIG15U2l6ZSA9IHBhcnNlSW50KHBhcmFtcy5zdWJzdHIoMSksMTApIHx8IDA7CiAgICAgICAgICAgICAgICBpZiAobXlTaXplIDwgNCB8fCBteVNpemUgPiA0MCkgewogICAgICAgICAgICAgICAgICAgIG15U2l6ZSA9IDE0OwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHJldHVybiAnPHNwYW4gY2xhc3M9InhiYmNvZGUtc2l6ZS0nICsgbXlTaXplICsgJyI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvc3Bhbj4nOwogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAic21hbGwiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgkJCQl2YXIgcGFyYW1zID0gcGFyYW1zIHx8ICcnOwoJCQkJdmFyIGNvbG9yQ29kZSA9IHBhcmFtcy5zdWJzdHIoMSkgfHwgImluaGVyaXQiOwogICAgICAgICAgICAgICAgY29sb3JOYW1lUGF0dGVybi5sYXN0SW5kZXggPSAwOwogICAgICAgICAgICAgICAgY29sb3JDb2RlUGF0dGVybi5sYXN0SW5kZXggPSAwOwogICAgICAgICAgICAgICAgaWYgKCAhY29sb3JOYW1lUGF0dGVybi50ZXN0KCBjb2xvckNvZGUgKSApIHsKICAgICAgICAgICAgICAgICAgICBpZiAoICFjb2xvckNvZGVQYXR0ZXJuLnRlc3QoIGNvbG9yQ29kZSApICkgewogICAgICAgICAgICAgICAgICAgICAgICBjb2xvckNvZGUgPSAiaW5oZXJpdCI7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbG9yQ29kZS5zdWJzdHIoMCwxKSAhPT0gIiMiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvckNvZGUgPSAiIyIgKyBjb2xvckNvZGU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBjbGFzcz0ieGJiY29kZS1zaXplLTEwIiBzdHlsZT0iY29sb3I6JyArIGNvbG9yQ29kZSArICciPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3NwYW4+JzsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgICJzdWIiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzdWI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvc3ViPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJzdXAiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzxzdXA+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvc3VwPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICAidGFibGUiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzx0YWJsZSBjbGFzcz0ieGJiY29kZS10YWJsZSI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvdGFibGU+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVzdHJpY3RDaGlsZHJlblRvOiBbInRib2R5IiwidGhlYWQiLCAidGZvb3QiLCAidHIiXQogICAgICAgIH0sCiAgICAgICAgInRib2R5IjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8dGJvZHk+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvdGJvZHk+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVzdHJpY3RDaGlsZHJlblRvOiBbInRyIl0sCiAgICAgICAgICAgIHJlc3RyaWN0UGFyZW50c1RvOiBbInRhYmxlIl0KICAgICAgICB9LAogICAgICAgICJ0Zm9vdCI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHRmb290Pic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3Rmb290Pic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlc3RyaWN0Q2hpbGRyZW5UbzogWyJ0ciJdLAogICAgICAgICAgICByZXN0cmljdFBhcmVudHNUbzogWyJ0YWJsZSJdCiAgICAgICAgfSwKICAgICAgICAidGhlYWQiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzx0aGVhZCBjbGFzcz0ieGJiY29kZS10aGVhZCI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvdGhlYWQ+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVzdHJpY3RDaGlsZHJlblRvOiBbInRyIl0sCiAgICAgICAgICAgIHJlc3RyaWN0UGFyZW50c1RvOiBbInRhYmxlIl0KICAgICAgICB9LAogICAgICAgICJ0ZCI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHRkIGNsYXNzPSJ4YmJjb2RlLXRkIj4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC90ZD4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICByZXN0cmljdFBhcmVudHNUbzogWyJ0ciJdCiAgICAgICAgfSwKICAgICAgICAidGgiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzx0aCBjbGFzcz0ieGJiY29kZS10aCI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvdGg+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmVzdHJpY3RQYXJlbnRzVG86IFsidHIiXQogICAgICAgIH0sCiAgICAgICAgInRyIjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8dHIgY2xhc3M9InhiYmNvZGUtdHIiPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3RyPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlc3RyaWN0Q2hpbGRyZW5UbzogWyJ0ZCIsInRoIl0sCiAgICAgICAgICAgIHJlc3RyaWN0UGFyZW50c1RvOiBbInRhYmxlIiwidGJvZHkiLCJ0Zm9vdCIsInRoZWFkIl0KICAgICAgICB9LAogICAgICAgICJ1IjogewogICAgICAgICAgICBvcGVuVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8c3BhbiBjbGFzcz0ieGJiY29kZS11Ij4nOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPC9zcGFuPic7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJ1bCI6IHsKICAgICAgICAgICAgb3BlblRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAnPHVsPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGNsb3NlVGFnOiBmdW5jdGlvbihwYXJhbXMsY29udGVudCkgewogICAgICAgICAgICAgICAgcmV0dXJuICc8L3VsPic7CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHJlc3RyaWN0Q2hpbGRyZW5UbzogWyIqIiwgImxpIl0KICAgICAgICB9LAogICAgICAgICJ1cmwiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CgogICAgICAgICAgICAgICAgdmFyIG15VXJsOwoKICAgICAgICAgICAgICAgIGlmICghcGFyYW1zKSB7CiAgICAgICAgICAgICAgICAgICAgbXlVcmwgPSBjb250ZW50LnJlcGxhY2UoLzwuKj8+L2csIiIpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBteVVybCA9IHBhcmFtcy5zdWJzdHIoMSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgdXJsUGF0dGVybi5sYXN0SW5kZXggPSAwOwogICAgICAgICAgICAgICAgaWYgKCAhdXJsUGF0dGVybi50ZXN0KCBteVVybCApICkgewogICAgICAgICAgICAgICAgICAgIG15VXJsID0gIiMiOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHJldHVybiAnPGEgaHJlZj0iJyArIG15VXJsICsgJyI+JzsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY2xvc2VUYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJzwvYT4nOwogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAvKgogICAgICAgICAgICBUaGUgWypdIHRhZyBpcyBzcGVjaWFsIHNpbmNlIHRoZSB1c2VyIGRvZXMgbm90IGRlZmluZSBhIGNsb3NpbmcgWy8qXSB0YWcgd2hlbiB3cml0aW5nIHRoZWlyIGJiY29kZS4KICAgICAgICAgICAgSW5zdGVhZCB0aGlzIG1vZHVsZSBwYXJzZXMgdGhlIGNvZGUgYW5kIGFkZHMgdGhlIGNsb3NpbmcgWy8qXSB0YWcgaW4gZm9yIHRoZW0uIE5vbmUgb2YgdGhlIHRhZ3MgeW91CiAgICAgICAgICAgIGFkZCB3aWxsIGFjdCBsaWtlIHRoaXMgYW5kIHRoaXMgdGFnIGlzIGFuIGV4Y2VwdGlvbiB0byB0aGUgb3RoZXJzLgogICAgICAgICovCiAgICAgICAgIioiOiB7CiAgICAgICAgICAgIG9wZW5UYWc6IGZ1bmN0aW9uKHBhcmFtcyxjb250ZW50KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gIjxsaT4iOwogICAgICAgICAgICB9LAogICAgICAgICAgICBjbG9zZVRhZzogZnVuY3Rpb24ocGFyYW1zLGNvbnRlbnQpIHsKICAgICAgICAgICAgICAgIHJldHVybiAiPC9saT4iOwogICAgICAgICAgICB9LAogICAgICAgICAgICByZXN0cmljdFBhcmVudHNUbzogWyJsaXN0IiwidWwiLCJvbCJdCiAgICAgICAgfQogICAgfTsKCiAgICAvLyBjcmVhdGUgdGFnIGxpc3QgYW5kIGxvb2t1cCBmaWVsZHMKICAgIGZ1bmN0aW9uIGluaXRUYWdzKCkgewogICAgICAgIHRhZ0xpc3QgPSBbXTsKICAgICAgICB2YXIgcHJvcCwKICAgICAgICAgICAgaWksCiAgICAgICAgICAgIGxlbjsKICAgICAgICBmb3IgKHByb3AgaW4gdGFncykgewogICAgICAgICAgICBpZiAodGFncy5oYXNPd25Qcm9wZXJ0eShwcm9wKSkgewogICAgICAgICAgICAgICAgaWYgKHByb3AgPT09ICIqIikgewogICAgICAgICAgICAgICAgICAgIHRhZ0xpc3QucHVzaCgiXFwiICsgcHJvcCk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHRhZ0xpc3QucHVzaChwcm9wKTsKICAgICAgICAgICAgICAgICAgICBpZiAoIHRhZ3NbcHJvcF0ubm9QYXJzZSApIHsKICAgICAgICAgICAgICAgICAgICAgICAgdGFnc05vUGFyc2VMaXN0LnB1c2gocHJvcCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHRhZ3NbcHJvcF0udmFsaWRDaGlsZExvb2t1cCA9IHt9OwogICAgICAgICAgICAgICAgdGFnc1twcm9wXS52YWxpZFBhcmVudExvb2t1cCA9IHt9OwogICAgICAgICAgICAgICAgdGFnc1twcm9wXS5yZXN0cmljdFBhcmVudHNUbyA9IHRhZ3NbcHJvcF0ucmVzdHJpY3RQYXJlbnRzVG8gfHwgW107CiAgICAgICAgICAgICAgICB0YWdzW3Byb3BdLnJlc3RyaWN0Q2hpbGRyZW5UbyA9IHRhZ3NbcHJvcF0ucmVzdHJpY3RDaGlsZHJlblRvIHx8IFtdOwoKICAgICAgICAgICAgICAgIGxlbiA9IHRhZ3NbcHJvcF0ucmVzdHJpY3RDaGlsZHJlblRvLmxlbmd0aDsKICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IGxlbjsgaWkrKykgewogICAgICAgICAgICAgICAgICAgIHRhZ3NbcHJvcF0udmFsaWRDaGlsZExvb2t1cFsgdGFnc1twcm9wXS5yZXN0cmljdENoaWxkcmVuVG9baWldIF0gPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGVuID0gdGFnc1twcm9wXS5yZXN0cmljdFBhcmVudHNUby5sZW5ndGg7CiAgICAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBsZW47IGlpKyspIHsKICAgICAgICAgICAgICAgICAgICB0YWdzW3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oPGJiY2w9IiArIGJiY29kZUxldmVsICsgIiApKCIgKyB0YWdMaXN0LmpvaW4oInwiKSArICIpKFsgPT5dKSIsImkiKSwKICAgICAgICAgICAgbWF0Y2hpbmdUYWdzID0gdGFnQ29udGVudHMubWF0Y2gocmVUYWdOYW1lcykgfHwgW10sCiAgICAgICAgICAgIGNJbmZvLAogICAgICAgICAgICBlcnJTdHIsCiAgICAgICAgICAgIGlpLAogICAgICAgICAgICBjaGlsZFRhZywKICAgICAgICAgICAgcEluZm8gPSB0YWdzW3BhcmVudFRhZ10gfHwge307CgogICAgICAgIHJlVGFnTmFtZXMubGFzdEluZGV4ID0gMDsKCiAgICAgICAgaWYgKCFtYXRjaGluZ1RhZ3MpIHsKICAgICAgICAgICAgdGFnQ29udGVudHMgPSAiIjsKICAgICAgICB9CgogICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IG1hdGNoaW5nVGFncy5sZW5ndGg7IGlpKyspIHsKICAgICAgICAgICAgcmVUYWdOYW1lc1BhcnRzLmxhc3RJbmRleCA9IDA7CiAgICAgICAgICAgIGNoaWxkVGFnID0gKG1hdGNoaW5nVGFnc1tpaV0ubWF0Y2gocmVUYWdOYW1lc1BhcnRzKSlbMl0udG9Mb3dlckNhc2UoKTsKCiAgICAgICAgICAgIGlmICggcEluZm8gJiYgcEluZm8ucmVzdHJpY3RDaGlsZHJlblRvICYmIHBJbmZvLnJlc3RyaWN0Q2hpbGRyZW5Uby5sZW5ndGggPiAwICkgewogICAgICAgICAgICAgICAgaWYgKCAhcEluZm8udmFsaWRDaGlsZExvb2t1cFtjaGlsZFRhZ10gKSB7CiAgICAgICAgICAgICAgICAgICAgZXJyU3RyID0gIlRoZSB0YWcgXCIiICsgY2hpbGRUYWcgKyAiXCIgaXMgbm90IGFsbG93ZWQgYXMgYSBjaGlsZCBvZiB0aGUgdGFnIFwiIiArIHBhcmVudFRhZyArICJcIi4iOwogICAgICAgICAgICAgICAgICAgIGVyclF1ZXVlLnB1c2goZXJyU3RyKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBjSW5mbyA9IHRhZ3NbY2hpbGRUYWddIHx8IHt9OwogICAgICAgICAgICBpZiAoIGNJbmZvLnJlc3RyaWN0UGFyZW50c1RvLmxlbmd0aCA+IDAgKSB7CiAgICAgICAgICAgICAgICBpZiAoICFjSW5mby52YWxpZFBhcmVudExvb2t1cFtwYXJlbnRUYWddICkgewogICAgICAgICAgICAgICAgICAgIGVyclN0ciA9ICJUaGUgdGFnIFwiIiArIHBhcmVudFRhZyArICJcIiBpcyBub3QgYWxsb3dlZCBhcyBhIHBhcmVudCBvZiB0aGUgdGFnIFwiIiArIGNoaWxkVGFnICsgIlwiLiI7CiAgICAgICAgICAgICAgICAgICAgZXJyUXVldWUucHVzaChlcnJTdHIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgIH0KCiAgICAgICAgdGFnQ29udGVudHMgPSB0YWdDb250ZW50cy5yZXBsYWNlKGJiUmVnRXhwLCBmdW5jdGlvbihtYXRjaFN0ciwgYmJjb2RlTGV2ZWwsIHRhZ05hbWUsIHRhZ1BhcmFtcywgdGFnQ29udGVudHMgKSB7CiAgICAgICAgICAgIGVyclF1ZXVlID0gY2hlY2tQYXJlbnRDaGlsZFJlc3RyaWN0aW9ucyh0YWdOYW1lLnRvTG93ZXJDYXNlKCksIG1hdGNoU3RyLCBiYmNvZGVMZXZlbCwgdGFnTmFtZSwgdGFnUGFyYW1zLCB0YWdDb250ZW50cywgZXJyUXVldWUpOwogICAgICAgICAgICByZXR1cm4gbWF0Y2hTdHI7CiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIGVyclF1ZXVlOwogICAgfQoKICAgIC8qCiAgICAgICAgVGhpcyBmdW5jdGlvbiB1cGRhdGVzIG9yIGFkZHMgYSBwaWVjZSBvZiBtZXRhZGF0YSB0byBlYWNoIHRhZyBjYWxsZWQgImJiY2wiIHdoaWNoCiAgICAgICAgaW5kaW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4dCA9IHRleHQucmVwbGFjZSgvPmxpc3QoWyA9XVteXF1dKik/XF0oW14+XSo/KSg+XC9saXN0XSkvZ2ksIGZ1bmN0aW9uKG1hdGNoU3RyLGNvbnRlbnRzLGVuZFRhZykgewoKICAgICAgICAgICAgdmFyIGlubmVyTGlzdFR4dCA9IG1hdGNoU3RyOwogICAgICAgICAgICB3aGlsZSAoaW5uZXJMaXN0VHh0ICE9PSAoaW5uZXJMaXN0VHh0ID0gaW5uZXJMaXN0VHh0LnJlcGxhY2UoL1xbXCpcXShbXlxbXSo/KShcW1wqXF18PlwvbGlzdF0pL2ksIGZ1bmN0aW9uKG1hdGNoU3RyLGNvbnRlbnRzLGVuZFRhZykgewogICAgICAgICAgICAgICAgaWYgKGVuZFRhZy50b0xvd2VyQ2FzZSgpID09PSAiPi9saXN0XSIpIHsKICAgICAgICAgICAgICAgICAgICBlbmRUYWcgPSAiPC8qXTwvbGlzdF0iOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBlbmRUYWcgPSAiPC8qXVsqXSI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gIjwqXSIgKyBjb250ZW50cyArIGVuZFRhZzsKICAgICAgICAgICAgfSkpKTsKCiAgICAgICAgICAgIGlubmVyTGlzdFR4dCA9IGlubmVyTGlzdFR4dC5yZXBsYWNlKC8+L2csICI8Iik7CiAgICAgICAgICAgIHJldHVybiBpbm5lckxpc3RUeHQ7CiAgICAgICAgfSkpKTsKCiAgICAgICAgLy8gYWRkIFsncyBmb3Igb3VyIHRhZ3MgYmFjayBpbgogICAgICAgIHRleHQgPSB0ZXh0LnJlcGxhY2UoLzwvZywgIlsiKTsKICAgICAgICByZXR1cm4gdGV4dDsKICAgIH0KCiAgICBmdW5jdGlvbiBhZGRCYmNvZGVMZXZlbHModGV4dCkgewogICAgICAgIHdoaWxlICggdGV4dCAhPT0gKHRleHQgPSB0ZXh0LnJlcGxhY2UocGJiUm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BwYXJzZShjb25maWcpOzsKCiAgICAgICAgaWYgKCByZXQuaHRtbC5pbmRleE9mKCJbIikgIT09IC0xIHx8IHJldC5odG1sLmluZGV4T2YoIl0iKSAhPT0gLTEpIHsKICAgICAgICAgICAgZXJyUXVldWUucHVzaCgiU29tZSB0YWdzIGFwcGVhciB0byBiZSBtaXNhbGlnbmVkLiIpOwogICAgICAgIH0KCiAgICAgICAgaWYgKGNvbmZpZy5yZW1vdmVNaXNhbGlnbmVkVGFncykgewogICAgICAgICAgICByZXQuaHRtbCA9IHJldC5odG1sLnJlcGxhY2UoL1xbLio/XF0vZywiIik7CiAgICAgICAgfQogICAgICAgIGlmIChjb25maWcuYWRkSW5MaW5lQnJlYWtzKSB7CiAgICAgICAgICAgIHJldC5odG1sID0gJzxkaXYgc3R5bGU9IndoaXRlLXNwYWNlOnByZTsiPicgKyByZXQuaHRtbCArICc8L2Rpdj4nOwogICAgICAgIH0KCiAgICAgICAgcmV0Lmh0bWwgPSByZXQuaHRtbC5yZXBsYWNlKC9cWy9nLCAiPCIpOyAvLyBwdXQgPCdzIGJhY2sgaW4KICAgICAgICByZXQuaHRtbCA9IHJldC5odG1sLnJlcGxhY2UoL1xdL2csICI+Iik7IC8vIHB1dCA+J3MgYmFjayBpbgoKICAgICAgICByZXQuaHRtbCA9IHJldC5odG1sLnJlcGxhY2UoIiYjOTE7IiwgIlsiKTsgLy8gcHV0IFsncyBiYWNrIGluCiAgICAgICAgcmV0Lmh0bWwgPSByZXQuaHRtbC5yZXBsYWNlKCImIzkzOyIsICJdIik7IC8vIHB1dCBbJ3MgYmFjayBpbgoKICAgICAgICByZXQuZXJyb3IgPSBlcnJRdWV1ZS5sZW5ndGggIT09IDA7CiAgICAgICAgcmV0LmVycm9yUXVldWUgPSBlcnJRdWV1ZTsKCiAgICAgICAgcmV0dXJuIHJldDsKICAgIH07CgogICAgcmV0dXJuIG1lOwp9KSgpOwo=</js><js filename="plugins.previewPost.js">OyggZnVuY3Rpb24oJCwgXyw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1hdGhKYXguSHViLlR5cGVzZXQoIHNlbGYuZGlhbG9nSWQgKyAiX2RpYWxvZyIgKTsKCQkJCQkJfQoJCQkJCQkkKCBkb2N1bWVudCApLnRyaWdnZXIoICdjb250ZW50Q2hhbmdlJywgWyAkKCAiIyIgKyBzZWxmLmRpYWxvZ0lkICsgIl9kaWFsb2ciICkgXSApOwoJCQkJCQljbGVhckludGVydmFsKCBpbnRlcnZhbCApOwoJCQkJCX0KCQkJCX0KCQkJCWVsc2UKCQkJCXsKCQkJCQlzZWxmLmRpYWxvZ0lkID0gJCggc2VsZiApLmF0dHIoICdpZCcgKTsKCQkJCX0KCQkJfSwgMTUwICk7CgkJfQoJfSk7Cn0oalF1ZXJ5LCBfKSk7CgogICAgICAgIGZ1bmN0aW9uIGRlY29kZUVudGl0aWVzKGVuY29kZWRTdHJpbmcpCiAgICAgICAgewogICAgICAgICAgICB2YXIgdGV4dEFyZWEgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCd0ZXh0YXJlYScpOwogICAgICAgICAgICB0ZXh0QXJlYS5pbm5lckhUTUwgPSBlbmNvZGVkU3RyaW5nOwogICAgICAgICAgICByZXR1cm4gdGV4dEFyZWEudmFsdWU7CiAgICAgICAgfQ==</js></jsFiles><resourcesFiles/><lang><word key="preview_post" js="0">Preview Post</word><word key="preview_parse_bbcode" js="0">Parse BBCode?</word></lang><versions><version long="10000" human="1.0.0"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Install Code
 */
class ips_plugins_setup_install
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		

		return TRUE;
	}
	
	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version><version long="10001" human="1.0.1"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * 1.0.1 Upgrade Code
 */
class ips_plugins_setup_upg_10001
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		

		return TRUE;
	}
	
	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version></versions></plugin>

 

 

Link to comment
Share on other sites


3 minutes ago, Kalju said:

Two words about the Post Preview Button, it does not have any importance at all, because already you can see exactly what you are posting. (WYSIWYG)

Not truealmost every post that I make, is having to be re-posted due to mistakes (the WYSIWYG on the V4 is relatively better than the one on the V3 — it's far from perfect, though.)

 

Taking into consideration the massive nSane User base — the Board resources would take a bad hit if most folks had to re-post (remember we are not resorting to copy-paste from the Google Translate.)

Link to comment
Share on other sites


41 minutes ago, Kalju said:

Two words about the Post Preview Button, it does not have any importance at all, because already you can see exactly what you are posting. (WYSIWYG)

 

Not true! one of the things for example is the spoiler, that i cant see how it will look in the end

Link to comment
Share on other sites


Here are all my changes what I've tested:

Spoiler

 

/**
   * This file is for your custom CSS.
   * This file is not modified or overwritten during upgrades
   *//* Chatbox changes */
.ipsTabs {
  padding: 5px 10px 0 10px;
}

#elChatbox {
  height: 40px;
  font-size: 120%;
  font-weight: 500;
  background: #1c2c3b;
}
/* Header Changes */

#ipsLayout_header header {
  background: rgba(22, 32, 41, .1) url(../../background/pattern_012.png);
}

header li > a .fa, #elUserNav_mobile > li > a .fa {
  font-size: 12px !Important;
}
/* Body Changes */

body {
  background-image: url(../../background/pattern_012.png);
/* url(../../background/background/noise_overlay.png) */
}

body#elLogin {
  background: #0D334C url(../../uploads/background/sports-car.jpg) no-repeat -100px -200px;
}

.ipsType_sectionTitle {
  background: #1c2c3b;/* #304d66; default color */
}
/* NavBar Changes */

.ipsNavBar_secondary > li > a {
  color: rgba(50, 50, 50, 1);
}

.ipsButtonBar .ipsButtonRow li > a, .ipsButtonBar .ipsButtonRow li > button, .ipsButtonBar .ipsButtonRow li > span {
  background: rgba(255, 255, 255, 0.1);
  color: #323232;
  font-weight: bold;
}
/* NAV Bar Primary */

.ipsNavBar_primary {
  position: relative;
  padding: 5px 5px 40px;
/* background: #1F3F4F none repeat scroll 0% 0%; */
  border-radius: 2px 2px 0px 0px;
}

.ipsNavBar_primary > ul > li.ipsNavBar_active > a {
  font-weight: 500;
  color: #1c2c3b;
}

.ipsNavBar_primary > ul > li > a {
  font-weight: 500;
}
/*  Hide Error Message form Forum Page */

#elLicenseKey {
  margin: 0;
  border-radius: 0;
  font-size: 14px;
  padding-right: 40px;
  display: none !Important;
}
/* Hide Error Message End */
/* Display if New Version is available */

div#acpNewVersion {
  display: none !Important;
}
/* Hide footer container */

div.ipsLayout_container {
/* display: none !Important;*/
  padding: 1px 10px 10px 10px;
  color: rgba(0, 0, 0, 1);
  width: 97%;
  opacity: 1;
  background: rgba(28, 44, 59, 1) url() no-repeat;
}

#elCopyright_userLine {
  display: none;/* block;*/
  color: rgba(28, 44, 59, 1);
  opacity: 1;
}

#ipsLayout_footer a, #ipsLayout_footer p {
  color: #fff;/*rgba(28, 44, 59, 1);*/
}
/* New posts icon color */

.ipsItemStatus.ipsItemStatus_large {
  background: #1C2C3B;
}
/* Admin Panel Members editor */

.ipsButtonBar .ipsButtonRow li > a, .ipsButtonBar .ipsButtonRow li > button, .ipsButtonBar .ipsButtonRow li > span {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  font-weight: bold;
}

.ipsButtonRow li > a.ipsButtonRow_active, .ipsButtonRow li > button.ipsButtonRow_active {
  background: #323232;
  border-color: #323232;
  color: #04A5CC;
  text-shadow: none;
}

 

 

Here is what it looks like: 

http://i.imgur.com/PVu5TJh.png

 

See it here
Link to comment
Share on other sites


The 3 buttons in forum's top-right corner (android) are not working. Tapping on them gives no response.

 

http://s7.postimg.org/y1wlv4a9n/Screenshot_2015_12_14_09_39_41_1.jpg 

 

Another bug: (android) can't post image using IMG BBcode. If I paste the image link, it gets converted into link directly right in the editor. Example is the image posted above. 

Link to comment
Share on other sites


Have switched back from the Dark Theme to the Light (default) Theme — the Dark Theme was quite easy on the eyes, but came at the cost of readability (especially on tutorials with blue fonts.)

 

Have managed to cut down a reasonable deal of contrast on my Light (default) Theme — now, after ironing out most of the inconsistencies, the Light (default) Theme looks ravishing. ^_^

Link to comment
Share on other sites


the dark theme is looking better by the minute! :) every time i check back, i see  new additions that i can remove from stylish.

still pondering what to do with the activity feed grey background, but maybe the buttons would look more defined with a  border: groove 1px; to give that embossed look. more effective than a box-shadow imho but you can always mix and match.

 

Link to comment
Share on other sites


39 minutes ago, VileTouch said:

the dark theme is looking better by the minute! :) every time i check back, i see  new additions that i can remove from stylish.

still pondering what to do with the activity feed grey background, but maybe the buttons would look more defined with a  border: groove 1px; to give that embossed look. more effective than a box-shadow imho but you can always mix and match.

 

 

I'd be happy to take a look at your suggestions for the activity feed. I didn't know quite what to do with it myself.

 

The post preview button has been available since yesterday afternoon.

 

@dcs18I'd be happy to look at your modifications of the default theme as well.

Link to comment
Share on other sites


1 hour ago, shought said:

The post preview button has been available since yesterday afternoon.

 

Where is it? i don't see it.

Link to comment
Share on other sites


6 minutes ago, vissha said:

 

Please try to create new topic/reply. You'll see the Preview Post button near Submit reply.

 

Oh but there still isn't at all posts, where we also need it.

Link to comment
Share on other sites


2 hours ago, shought said:

@dcs18I'd be happy to look at your modifications of the default theme as well.

Made my previous post as an image so that you could see my CKEditor, too — didn't know that you were interested in having the Default (Light) Theme altered (shall submit some codes later.)

 

Here is a sneak peek into my custom New Content view — for a full screen view, click the following image and then click Full Size (at the bottom-left-hand side corner):—

 

Link to comment
Share on other sites


1 hour ago, vissha said:

Please try to create new topic/reply. You'll see the Preview Post button near Submit reply.

If you are referring to the following — then, I'm afraid only copy-paste Trolls who spam the Board would benefit. RL8WwPy.gif

 

FWIW, why would copy-paste artists have any need for a Preview button?

 

Qu7Le3L.jpg

Link to comment
Share on other sites


6 minutes ago, dcs18 said:

If you are referring to the following — then, I'm afraid only copy-paste Trolls who spam the Board would benefit. F3h9xqz.gif

FWIW, why would copy-paste artists have any need for a Preview button?

 

You are wrong. Don't judge copy-paste artists as spammers. They are here to make every nsaners up-to-date with news, tips n tricks, security and other stuff from all over the world to a single forum making it convenient.

 

Also, they also need it for formatting preview, if they do it either manually or copy-paste.

Link to comment
Share on other sites


1 minute ago, vissha said:

Don't judge copy-paste artists as spammers. They are here to make every nsaners up-to-date with news, tips n tricks, security and other stuff from all over the world to a single forum making it convenient.

Oh yeah, you're right — can't express how much I love your "tips" and "tricks."

Link to comment
Share on other sites


4 hours ago, shought said:

 

I'd be happy to take a look at your suggestions for the activity feed. I didn't know quite what to do with it myself.

 

The post preview button has been available since yesterday afternoon.

 

@dcs18I'd be happy to look at your modifications of the default theme as well.

and I thought all the privacy issues would be the most important things to fix first. I really dont care what theme is employed by the ENTIRE FCUKING WORLD to view ALL OUR ACTIVITIES!!! or is it just me?

1 hour ago, dcs18 said:

Oh yeah, you're right — can't express how much I love your "tips" and "tricks."

@dcs18 lol I believe you just did!

Link to comment
Share on other sites


  • Lite locked this topic
  • shought unlocked this topic

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...