├── .gitignore ├── .editorconfig ├── phpunit.xml.dist ├── Gruntfile.js ├── .svnignore ├── tests └── bootstrap.php ├── package.json ├── phpcs.xml ├── composer.json ├── readme.txt ├── readme.md ├── .travis.yml ├── bin └── install-wp-tests.sh ├── js └── press-this.js ├── LICENSE.md ├── indieweb-press-this.php └── composer.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | package-lock.json 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | charset = utf-8 10 | 11 | [*.php] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [*.{js,json}] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | ./tests/ 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | // Project configuration. 3 | grunt.initConfig({ 4 | wp_readme_to_markdown: { 5 | target: { 6 | files: { 7 | 'readme.md': 'readme.txt' 8 | }, 9 | }, 10 | } 11 | }); 12 | 13 | grunt.loadNpmTasks('grunt-wp-readme-to-markdown'); 14 | 15 | // Default task(s). 16 | grunt.registerTask('default', ['wp_readme_to_markdown']); 17 | }; 18 | -------------------------------------------------------------------------------- /.svnignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .editorconfig 3 | .git 4 | .gitignore 5 | .travis.yml 6 | .codeclimate.yml 7 | .data 8 | Gruntfile.js 9 | LINGUAS 10 | Makefile 11 | README.md 12 | readme.md 13 | CODE_OF_CONDUCT.md 14 | LICENSE.md 15 | _site 16 | bin 17 | composer.json 18 | composer.lock 19 | docker-compose.yml 20 | gulpfile.js 21 | package.json 22 | node_modules 23 | npm-debug.log 24 | phpcs.xml 25 | package.json 26 | phpunit.xml 27 | phpunit.xml.dist 28 | tests 29 | node_modules 30 | vendor 31 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Indieweb Press This Standards 4 | 5 | ./indieweb-press-this.php 6 | */includes/*\.(inc|css|js|svg) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pfefferle/wordpress-indieweb-press-this", 3 | "description": "This plugin adds IndieWeb microformats2 markup to WordPress' press this. After activating, go to the Tools tab to install the bookmarklets.", 4 | "type": "wordpress-plugin", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Matthias Pfefferle", 9 | "homepage": "http://notiz.blog/" 10 | }, 11 | { 12 | "name": "Ryan Barrett", 13 | "homepage": "https://snarfed.org" 14 | } 15 | ], 16 | "extra": { 17 | "installer-name": "indieweb-press-this" 18 | }, 19 | "require": { 20 | "php": ">=5.2.0", 21 | "composer/installers": "~1.0", 22 | "wimg/php-compatibility": "^8.0", 23 | "wp-coding-standards/wpcs": "^0.14.0", 24 | "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", 25 | "phpunit/phpunit": "^6.5" 26 | }, 27 | "require-dev": { 28 | }, 29 | "scripts": { 30 | "install-codestandards": [ 31 | "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run" 32 | ], 33 | "test": [ 34 | "composer install", 35 | "bin/install-wp-tests.sh wordpress wordpress wordpress", 36 | "vendor/bin/phpunit" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === IndieWeb Press This === 2 | Contributors: pfefferle, snarfed, indieweb, dshanske 3 | Donate link: https://indieweb.org/how-to-sponsor 4 | Tags: indieweb, webmention, POSSE 5 | Requires at least: 4.7 6 | Tested up to: 6.1.1 7 | Stable tag: 1.2 8 | License: CC0-1.0 9 | License URI: https://creativecommons.org/publicdomain/zero/1.0/ 10 | 11 | IndieWebified Press This bookmarklets. 12 | 13 | == Description == 14 | 15 | This plugin is based on the idea and code of [@snarfed](https://snarfed.org/indieweb-press-this-bookmarklets-for-wordpress): 16 | 17 | It requires the Press This plugin for WordPress with Bookmarklet support as of WordPress 4.9, when Press This was removed from WordPress. 18 | 19 | One big [IndieWeb](https://indieweb.org/) _raison d’être_ is using your own web site to [reply](https://indieweb.org/reply), 20 | [like](https://indieweb.org/like), [repost](https://indieweb.org/repost), [follow](https://indieweb.org/follow), 21 | and [RSVP](https://indieweb.org/rsvp) to posts and events. You do this by annotating links on your site with simple [microformats2](http://microformats.org/wiki/microformats2) HTML. 22 | 23 | Having said that, most people don’t want to write HTML to like or reply to something. WordPress’s [Press This bookmarklets](http://codex.wordpress.org/Press_This) can already start a new post with a link to the page you’re currently viewing. This code adds IndieWeb microformats2 markup to that link. Combined the [wordpress-webmention](https://github.com/pfefferle/wordpress-webmention) plugin, you can use this to respond to the current page with just two clicks. 24 | 25 | What’s more, if you’re currently on a Facebook post or Twitter tweet, this adds the [Bridgy Publish](https://www.brid.gy/about#publish) link that will reply, like, favorite, retweet, or even RSVP _inside_ those social networks. 26 | 27 | == Changelog == 28 | 29 | = 1.2 = 30 | 31 | * Update bookmarklets to work in mobile browsers by using the current browser window instead of opening a new one. Background in [WordPress/press-this#50](https://github.com/WordPress/press-this/issues/50). 32 | 33 | = 1.1 = 34 | 35 | * Add [follow](https://indieweb.org/follow) support. 36 | 37 | = 1.0.4 = 38 | 39 | * Documentation added to explain that WordPress 4.9 now requires the Press This plugin 40 | * Minor refactoring 41 | * Press This Plugin restored bookmarklet functionality in Version 1.1.1, and it will prompt to install if plugin not installed so no conditional coding required 42 | 43 | = 1.0.3 = 44 | 45 | * WP.org version 46 | 47 | = 1.0.2 = 48 | 49 | * fixed list of contributors 50 | 51 | = 1.0.1 = 52 | 53 | * WordPress.org version 54 | 55 | = 1.0.0 = 56 | 57 | * initial 58 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # IndieWeb Press This # 2 | **Contributors:** [pfefferle](https://profiles.wordpress.org/pfefferle), [snarfed](https://profiles.wordpress.org/snarfed), [indieweb](https://profiles.wordpress.org/indieweb), [dshanske](https://profiles.wordpress.org/dshanske) 3 | **Donate link:** https://indieweb.org/how-to-sponsor 4 | **Tags:** indieweb, webmention, POSSE 5 | **Requires at least:** 4.7 6 | **Tested up to:** 6.1.1 7 | **Stable tag:** 1.2 8 | **License:** CC0-1.0 9 | **License URI:** https://creativecommons.org/publicdomain/zero/1.0/ 10 | 11 | IndieWebified Press This bookmarklets. 12 | 13 | ## Description ## 14 | 15 | This plugin is based on the idea and code of [@snarfed](https://snarfed.org/indieweb-press-this-bookmarklets-for-wordpress): 16 | 17 | It requires the Press This plugin for WordPress with Bookmarklet support as of WordPress 4.9, when Press This was removed from WordPress. 18 | 19 | One big [IndieWeb](https://indieweb.org/) _raison d’être_ is using your own web site to [reply](https://indieweb.org/reply), 20 | [like](https://indieweb.org/like), [repost](https://indieweb.org/repost), [follow](https://indieweb.org/follow), 21 | and [RSVP](https://indieweb.org/rsvp) to posts and events. You do this by annotating links on your site with simple [microformats2](http://microformats.org/wiki/microformats2) HTML. 22 | 23 | Having said that, most people don’t want to write HTML to like or reply to something. WordPress’s [Press This bookmarklets](http://codex.wordpress.org/Press_This) can already start a new post with a link to the page you’re currently viewing. This code adds IndieWeb microformats2 markup to that link. Combined the [wordpress-webmention](https://github.com/pfefferle/wordpress-webmention) plugin, you can use this to respond to the current page with just two clicks. 24 | 25 | What’s more, if you’re currently on a Facebook post or Twitter tweet, this adds the [Bridgy Publish](https://www.brid.gy/about#publish) link that will reply, like, favorite, retweet, or even RSVP _inside_ those social networks. 26 | 27 | ## Changelog ## 28 | 29 | ### 1.2 ### 30 | 31 | * Update bookmarklets to work in mobile browsers by using the current browser window instead of opening a new one. Background in [WordPress/press-this#50](https://github.com/WordPress/press-this/issues/50). 32 | 33 | ### 1.1 ### 34 | 35 | * Add [follow](https://indieweb.org/follow) support. 36 | 37 | ### 1.0.4 ### 38 | 39 | * Documentation added to explain that WordPress 4.9 now requires the Press This plugin 40 | * Minor refactoring 41 | * Press This Plugin restored bookmarklet functionality in Version 1.1.1, and it will prompt to install if plugin not installed so no conditional coding required 42 | 43 | ### 1.0.3 ### 44 | 45 | * WP.org version 46 | 47 | ### 1.0.2 ### 48 | 49 | * fixed list of contributors 50 | 51 | ### 1.0.1 ### 52 | 53 | * WordPress.org version 54 | 55 | ### 1.0.0 ### 56 | 57 | * initial 58 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | dist: trusty 3 | language: php 4 | notifications: 5 | email: 6 | on_success: never 7 | on_failure: change 8 | cache: 9 | directories: 10 | - vendor 11 | - $HOME/.composer/cache 12 | after_success: curl -L https://raw.githubusercontent.com/miya0001/travis2wpplugin/master/deploy.sh | bash 13 | env: 14 | matrix: 15 | - WP_VERSION=latest WP_MULTISITE=0 16 | global: 17 | - WP_TRAVISCI=travis:phpunit 18 | - SVN_REPO: https://plugins.svn.wordpress.org/indieweb-press-this/ 19 | - GH_REF: https://github.com/indieweb/wordpress-indieweb-press-this.git 20 | - secure: "WKTz/kN5Cyp48ffY6B/P1Gj5aSkTnJYy7HVxwoYqNsHhmC/Bqmfq6+JN5lRxCtBy7SnoA50v8DG5Cqk7UU9hJakYLU6ya6VRgif0rZyLM3curvB/BmS3Rta0VG6q/yOZCFM4+20MKLLELqUAhZmED4+/UWcdGofv1I0nbr MO6quJB7pV0cUdNMIUTVPwRZrGUElEkHjwk1YFam71taRUQe7C0gOK7NYvFwsAYGG4pWjzAV2FY6Cb7TnQsFTe95kMUQHO4iizbsY3tTsFixb5xeJwoo/b6ODrkxUSi1eKam5Y1gM4jEppnfkVPtUnERCAU+sW5tOYZA9xEpo6xNaUXOMQXyB t+Q1yG2nGHyMnQMRON01AxTB7nWCv/fs98BW63V9drPyrYaGuIX9RA42+kX/2L2er2viubmUfqoXCX5aHJ4/LWFWCJ7k9Bdp47n7TveXF0IrVhthpVYxn0nexMIh9F3+TEDZHPv3Rx6qdirERWAORvgNV7s1qYS1Tgjf3O4k8zNULZa70WkiO Ak6G1PHDK4XUEl8WuZQfmninIp9hBMrysWhiw8CDZieGWMfPJtKexqbrnSyqKRJ9+xDewTO0v/u9DUfW/o9z4h04644QDSO9l2B0bsbakbCOdHJfRHNWRrfSOm5txPpkAiD0sMvdrak6lFVC4f4E60yVEog=" 21 | matrix: 22 | include: 23 | - php: 7.2 24 | - php: 7.1 25 | - php: 7.0 26 | - php: 5.6 27 | - php: 5.6 28 | env: WP_PULUGIN_DEPLOY=1 29 | - php: 5.5 30 | - php: 5.4 31 | - php: 5.3 32 | dist: precise 33 | before_script: 34 | - | 35 | # Remove Xdebug for a huge performance increase: 36 | if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then 37 | phpenv config-rm xdebug.ini 38 | else 39 | echo "xdebug.ini does not exist" 40 | fi 41 | - | 42 | # Export Composer's global bin dir to PATH: 43 | composer config --list --global 44 | export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }` 45 | - | 46 | # Install the specified version of PHPUnit depending on the PHP version: 47 | if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then 48 | case "$TRAVIS_PHP_VERSION" in 49 | 7.2|7.1|7.0|nightly) 50 | echo "Using PHPUnit 6.x" 51 | composer global require "phpunit/phpunit:^6" 52 | ;; 53 | 5.6|5.5|5.4|5.3) 54 | echo "Using PHPUnit 4.x" 55 | composer global require "phpunit/phpunit:^4" 56 | ;; 57 | 5.2) 58 | # Do nothing, use default PHPUnit 3.6.x 59 | echo "Using default PHPUnit, hopefully 3.6" 60 | ;; 61 | *) 62 | echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION" 63 | exit 1 64 | ;; 65 | esac 66 | fi 67 | if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then 68 | composer install 69 | fi 70 | 71 | - mysql --version 72 | - phpenv versions 73 | - php --version 74 | - php -m 75 | - which phpunit 76 | - phpunit --version 77 | - curl --version 78 | - grunt --version 79 | - git --version 80 | - svn --version 81 | - locale -a 82 | before_install: 83 | - export PATH="$HOME/.composer/vendor/bin:$PATH" 84 | - | 85 | if [[ ! -z "$WP_VERSION" ]] ; then 86 | set -e 87 | bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION 88 | set +e 89 | fi 90 | script: 91 | - | 92 | if [[ ! -z "$WP_VERSION" ]] ; then 93 | # Run the build because otherwise there will be a bunch of warnings about 94 | # failed `stat` calls from `filemtime()`. 95 | echo Running with the following versions: 96 | php -v 97 | phpunit --version 98 | # Run PHPUnit tests 99 | phpunit || exit 1 100 | WP_MULTISITE=1 phpunit || exit 1 101 | fi 102 | - | 103 | if [[ "$WP_TRAVISCI" == "travis:phpcs" ]] ; then 104 | ./vendor/bin/phpcs -p -s -v -n --standard=./phpcs.ruleset.xml --extensions=php 105 | fi 106 | -------------------------------------------------------------------------------- /bin/install-wp-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 3 ]; then 4 | echo "usage: $0 [db-host] [wp-version]" 5 | exit 1 6 | fi 7 | 8 | DB_NAME=$1 9 | DB_USER=$2 10 | DB_PASS=$3 11 | DB_HOST=${4-localhost} 12 | WP_VERSION=${5-latest} 13 | 14 | WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} 15 | WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} 16 | 17 | download() { 18 | if [ `which curl` ]; then 19 | curl -s "$1" > "$2"; 20 | elif [ `which wget` ]; then 21 | wget -nv -O "$2" "$1" 22 | fi 23 | } 24 | 25 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then 26 | WP_TESTS_TAG="tags/$WP_VERSION" 27 | elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 28 | WP_TESTS_TAG="trunk" 29 | else 30 | # http serves a single offer, whereas https serves multiple. we only want one 31 | download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json 32 | grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json 33 | LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') 34 | if [[ -z "$LATEST_VERSION" ]]; then 35 | echo "Latest WordPress version could not be found" 36 | exit 1 37 | fi 38 | WP_TESTS_TAG="tags/$LATEST_VERSION" 39 | fi 40 | 41 | set -ex 42 | 43 | install_wp() { 44 | 45 | if [ -d $WP_CORE_DIR ]; then 46 | return; 47 | fi 48 | 49 | mkdir -p $WP_CORE_DIR 50 | 51 | if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 52 | mkdir -p /tmp/wordpress-nightly 53 | download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip 54 | unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/ 55 | mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR 56 | else 57 | if [ $WP_VERSION == 'latest' ]; then 58 | local ARCHIVE_NAME='latest' 59 | else 60 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 61 | fi 62 | download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz 63 | tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR 64 | fi 65 | 66 | download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php 67 | } 68 | 69 | install_test_suite() { 70 | # portable in-place argument for both GNU sed and Mac OSX sed 71 | if [[ $(uname -s) == 'Darwin' ]]; then 72 | local ioption='-i .bak' 73 | else 74 | local ioption='-i' 75 | fi 76 | 77 | # set up testing suite if it doesn't yet exist 78 | if [ ! -d $WP_TESTS_DIR ]; then 79 | # set up testing suite 80 | mkdir -p $WP_TESTS_DIR 81 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 82 | fi 83 | 84 | cd $WP_TESTS_DIR 85 | 86 | if [ ! -f wp-tests-config.php ]; then 87 | download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 88 | sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php 89 | sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 90 | sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php 91 | sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php 92 | sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php 93 | fi 94 | 95 | } 96 | 97 | install_db() { 98 | # parse DB_HOST for port or socket references 99 | local PARTS=(${DB_HOST//\:/ }) 100 | local DB_HOSTNAME=${PARTS[0]}; 101 | local DB_SOCK_OR_PORT=${PARTS[1]}; 102 | local EXTRA="" 103 | 104 | if ! [ -z $DB_HOSTNAME ] ; then 105 | if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then 106 | EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" 107 | elif ! [ -z $DB_SOCK_OR_PORT ] ; then 108 | EXTRA=" --socket=$DB_SOCK_OR_PORT" 109 | elif ! [ -z $DB_HOSTNAME ] ; then 110 | EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" 111 | fi 112 | fi 113 | 114 | # create database 115 | mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA 116 | } 117 | 118 | install_wp 119 | install_test_suite 120 | install_db 121 | -------------------------------------------------------------------------------- /js/press-this.js: -------------------------------------------------------------------------------- 1 | // IndieWeb Press This bookmarklet tweaks. Use indieweb categories, set 2 | // microformats2 classes on link and remove text. 3 | 4 | if (window.parent !== window) { 5 | window.parent.postMessage(JSON.stringify({ 6 | // The config of your reply endpoint 7 | reply: 'https://notizblog.org/wp-admin/press-this.php?u={url}' 8 | }), '*'); 9 | } 10 | 11 | /* map type to mf2 class(es), wordpress category id, and content prefix */ 12 | var classes = { 13 | "follow": "u-follow-of", 14 | "like": "u-like u-like-of", 15 | "reply": "u-in-reply-to", 16 | "repost": "u-repost u-repost-of", 17 | "rsvp": "u-in-reply-to", 18 | "checkin": "" 19 | }; 20 | var content_prefixes = { 21 | "follow": "follows ", 22 | "like": "likes ", 23 | "reply": "", 24 | "repost": "reposted ", 25 | "rsvp": "RSVPs XXX to ", 26 | "checkin": "" 27 | }; 28 | 29 | window.onload = function () { 30 | /* get 'type' query param. default to 'reply'. 31 | * (my kingdom, my kingdom for the URL API and searchParams!) 32 | */ 33 | var type = 'reply', u = ''; 34 | var params = window.location.search.substr(1).split('&'); 35 | for (var i = 0; i < params.length; i++) { 36 | var parts = params[i].split('='); 37 | if (parts[0] == 'type') { 38 | type = parts[1]; 39 | } else if (parts[0] == 'u') { 40 | u = parts[1]; 41 | } 42 | } 43 | 44 | /* Sometimes the u query param has both the title and URL, e.g. when coming 45 | /* from a share intent in Android. If so, separate them and redirect with the 46 | /* new params. */ 47 | u = decodeURIComponent(u.replace(/\+/g, ' ')); 48 | var match = u.match(/['"]?(.*?)['"]?(:|\s+-)\s+(https?:\/\/.+)/); 49 | if (match) { 50 | var url = new URL(window.location); 51 | url.search = '?type=' + type + '&t=' + match[1] + '&u=' + match[3]; 52 | document.location = url; 53 | return; 54 | } 55 | 56 | var titleContainer = document.getElementById("title-container"); 57 | var title = titleContainer.textContent; 58 | if (type == 'checkin') { 59 | titleContainer.textContent = ''; 60 | } 61 | if (title.length > 60) { 62 | title = title.substr(0, 60) + "..."; 63 | } 64 | 65 | // this is a