<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>転送 on qwerty.work</title>
        <link>https://qwerty.work/tags/%E8%BB%A2%E9%80%81/</link>
        <description>Recent content in 転送 on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Thu, 09 Feb 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://qwerty.work/tags/%E8%BB%A2%E9%80%81/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【Kintone】詳細画面を常に編集モードで開くJavascript</title>
            <link>https://qwerty.work/post/2023/02/kintone%E8%A9%B3%E7%B4%B0%E7%94%BB%E9%9D%A2%E3%82%92%E5%B8%B8%E3%81%AB%E7%B7%A8%E9%9B%86%E3%83%A2%E3%83%BC%E3%83%89%E3%81%A7%E9%96%8B%E3%81%8Fjavascript/</link>
            <pubDate>Thu, 09 Feb 2023 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2023/02/kintone%E8%A9%B3%E7%B4%B0%E7%94%BB%E9%9D%A2%E3%82%92%E5%B8%B8%E3%81%AB%E7%B7%A8%E9%9B%86%E3%83%A2%E3%83%BC%E3%83%89%E3%81%A7%E9%96%8B%E3%81%8Fjavascript/</guid>
            <description>&lt;p&gt;キントーンでレコード一覧から詳細画面を開く際、編集が目的のことが多いのですが、ワンクッション挟んで編集ボタンをクリックしなければなりません。そこで、詳細画面を開いたらいきなり編集モードにする方法をメモ。&lt;/p&gt;&#xA;&lt;h2 id=&#34;考え方&#34;&gt;考え方&#xA;&lt;/h2&gt;&lt;p&gt;通常、詳細画面を開いたとき、URLには&lt;code&gt;mode=show&lt;/code&gt;となっています。詳細画面が開かれたとき、Javascriptで&lt;code&gt;mode=edit&lt;/code&gt;のページに転送します。&lt;/p&gt;&#xA;&lt;h3 id=&#34;ソース例&#34;&gt;ソース例&#xA;&lt;/h3&gt;&lt;h4 id=&#34;pc版の場合&#34;&gt;PC版の場合&#xA;&lt;/h4&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(function() {&#xA;  &amp;#39;use strict&amp;#39;;&#xA;  kintone.events.on(&amp;#39;app.record.detail.show&amp;#39;, function(event) {&#xA;    if ( location.href.match(/&amp;amp;mode=show/)) {&#xA;      //strにmode=showを含む場合の処理&#xA;      //何もしない&#xA;    } else {&#xA;      location.href += &amp;#39;&amp;amp;mode=edit&amp;#39;;&#xA;    }&#xA;  });&#xA;})();&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;モバイル版の場合&#34;&gt;モバイル版の場合&#xA;&lt;/h4&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(function() {&#xA;  &amp;#39;use strict&amp;#39;;&#xA;  kintone.events.on(&amp;#39;mobile.app.record.detail.show&amp;#39;, function(event) {&#xA;    if ( location.href.match(/#mode=show/)) {&#xA;      //strにmode=showを含む場合の処理&#xA;      //何もしない&#xA;    } else {&#xA;      location.href += &amp;#39;#mode=edit&amp;#39;;&#xA;    }&#xA;  });&#xA;})();&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
        </item><item>
            <title>.htaccessでスマートホン用のサイトに転送</title>
            <link>https://qwerty.work/post/2012/09/htaccess/</link>
            <pubDate>Wed, 26 Sep 2012 22:02:59 +0900</pubDate>
            <guid>https://qwerty.work/post/2012/09/htaccess/</guid>
            <description>&lt;p&gt;Apatchのmod_rewriteを使ってスマートホン用のサイトにリダイレクトさせる方法をメモ。&lt;/p&gt;&#xA;&lt;p&gt;MovableTypeのプラグインを組み込んでスマホ用のブログページを作りました。&lt;/p&gt;&#xA;&lt;p&gt;PC用のブログはルートディレクトリの「blog」で、スマートホン用のブログを「blog」の中の「i」にしたとします。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;ディレクトリ&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;496px&#34; data-flex-grow=&#34;206&#34; height=&#34;150&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2012/09/htaccess/images/WS000000.jpg&#34; width=&#34;310&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;スマートホンからアクセスを転送するため、「blog」ディレクトリに以下の内容で.htaccessを作成します。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#スマホサイトにリダイレクト&#xA;RewriteEngine On&#xA;RewriteBase /blog&#xA;RewriteCond %{REQUEST_URI} !^/blog/i/.*$&#xA;RewriteCond %{REQUEST_URI} !^(.JPG|.jpg|.GIF|.gif|.PNG|.png) [NC]&#xA;RewriteCond %{HTTP_USER_AGENT} ^(iPhone|iPod|Android|BlackBerry|Windows.Phone) [NC]&#xA;RewriteCond %{HTTP_USER_AGENT} !iPad [NC]&#xA;RewriteRule ^(.*)$ /blog/i/$1 [R=301,L]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;もし、画像やiPadを除き「blog」にスマートホンからアクセスがあった場合は「i」にリダイレクトするという内容。&lt;/p&gt;&#xA;&lt;p&gt;「i」ディレクトリには画像がないため、ブログ内の画像のソースやリンクまでリダイレクトされると画像が表示されず困るので、画像はリダイレクトしないように5行目を加えています。&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
