Refactorized sharing links

This commit is contained in:
benweet 2014-09-26 00:25:01 +01:00
parent b2d368d4b9
commit d2cb92e828
10 changed files with 109 additions and 168 deletions

View File

@ -41,7 +41,7 @@ Support StackEdit:
### Documentation:
- [Welcome document][2]
- [Hello! document][2]
- [Developer guide][3]
- [Theming guide][4]

View File

@ -2,7 +2,7 @@ define([
"jquery",
"underscore",
"classes/Extension",
"text!html/dialogManageSharingLocation.html",
"text!html/dialogManageSharingLocation.html"
], function($, _, Extension, dialogManageSharingLocationHTML) {
var dialogManageSharing = new Extension("dialogManageSharing", 'Button "Share"', false, true);
@ -32,8 +32,6 @@ define([
}, '');
shareListElt.innerHTML = linkListHtml;
eventMgr.onTweet();
$msgShareListElt.toggleClass('hide', linkListHtml.length === 0);
$msgNoShareElt.toggleClass('hide', linkListHtml.length !== 0);
};

View File

@ -93,7 +93,7 @@ define([
title: 'Comments/discussions',
content: [
'<p>New in StackEdit 4: the <i class="icon-comment-alt"></i> <b>comments</b> button lets you create inline discussions!</p>',
'<b>Tip:</b> Reopen the Welcome Document from Settings>Utils to discover other new features.'
'<b>Tip:</b> Reopen the Hello! document from Settings>Utils to discover other new features.'
].join(""),
placement: 'right',
reflex: true

View File

@ -1251,15 +1251,12 @@
</div>
<div class="tab-pane" id="tabpane-settings-extensions">
<div class="panel-group accordion-extensions"></div>
<span class="help-block pull-right"><a target="_blank"
href="https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#developer-guide">Create
your own extension...</a></span>
</div>
<div class="tab-pane" id="tabpane-settings-utils">
<div class="tab-pane-button-container">
<a href="#" class="btn btn-block btn-default action-welcome-file"
data-dismiss="modal"><i class="icon-help-circled"></i>
Welcome document</a> <a href="#"
Hello! document</a> <a href="#"
class="btn btn-block btn-default action-welcome-tour"
data-dismiss="modal"><i
class="icon-help-circled"></i> Welcome tour</a>

View File

@ -41,7 +41,7 @@
<dl>
<dt>Sponsorship:</dt>
<dd>
<a href="#" class="sponsorship-button"><img height="32" data-stackedit-src="button.svg" /></a>
<a href="#" class="sponsorship-button"><img height="30" data-stackedit-src="button.svg" /></a>
</dd>
</dl>
<p>

View File

@ -1,6 +1,3 @@
<div class="sharing-tweet">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<%= link %>" data-text="<%- title %>" data-via="stackedit" data-size="large" data-count="none"></a>
</div>
<div class="input-group">
<a href="<%= link %>" class="input-group-addon" title="Sharing location"><i
class="icon-link"></i></a> <input class="form-control" type="text"

View File

@ -1,40 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="1600" height="400" viewBox="0, 0, 1600, 400">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="1680" height="420" viewBox="0, 0, 1680, 420">
<defs>
<linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="800" y1="-0" x2="800" y2="400">
<linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="897.423" y1="-0" x2="897.423" y2="420">
<stop offset="0" stop-color="#5F5F5F"/>
<stop offset="1" stop-color="#343434"/>
</linearGradient>
</defs>
<g id="Layer_3">
<g>
<path d="M80,0 L1520,0 C1564.183,0 1600,35.817 1600,80 L1600,320 C1600,364.183 1564.183,400 1520,400 L80,400 C35.817,400 0,364.183 0,320 L0,80 C0,35.817 35.817,0 80,0 z" fill="url(#Gradient_1)"/>
<path d="M80,0 L1520,0 C1564.183,0 1600,35.817 1600,80 L1600,320 C1600,364.183 1564.183,400 1520,400 L80,400 C35.817,400 0,364.183 0,320 L0,80 C0,35.817 35.817,0 80,0 z" fill-opacity="0" stroke="#3492DB" stroke-width="1" stroke-opacity="0.33"/>
</g>
<path d="M193.104,-0 L1601.742,-0 C1644.963,-0 1680,37.608 1680,84 L1680,336 C1680,382.392 1644.963,420 1601.742,420 L193.104,420 C149.884,420 114.846,382.392 114.846,336 L114.846,84 C114.846,37.608 149.884,-0 193.104,-0 z" fill="url(#Gradient_1)"/>
</g>
<g id="Layer_1" opacity="0.95">
<text transform="matrix(1, 0, 0, 1, 566.047, -181.461)"/>
<path d="M139.64,288.048 L140.034,75.73 L467.206,101.901 L407.327,309.461 L269.714,322.458" fill="#E34F26"/>
<path d="M273.069,304.953 L383.845,294.888 L435.048,117.102 L301.568,106.424" fill="#EF652A"/>
<path d="M255.208,120.058 L282.568,235.467 L342.065,127.006 L409.124,132.37 L388.052,279.161 L369.844,277.705 C362.759,277.138 357.194,275.139 353.148,271.707 C349.283,268.163 348.566,266.516 347.991,261.227 L362.879,157.514 L301.189,272.258 L254.567,268.528 L226.207,146.581 L209.222,264.901 L167.071,261.529 L185.889,130.441 C186.5,126.185 189.254,122.746 194.153,120.125 C199.051,117.503 204.714,116.306 211.141,116.533 z" fill="#FFFFFF" fill-opacity="0.95"/>
<path d="M342.065,127.006 L409.124,132.37 L388.052,279.161 L369.844,277.705 C362.759,277.138 357.194,275.139 353.148,271.707 C349.283,268.163 348.566,266.516 347.991,261.227 L362.879,157.514 L301.189,272.258 L278.028,270.405 L283.212,234.294 z" fill="#FFFFFF"/>
<text transform="matrix(1, 0, 0, 1, 514.064, -238.176)"/>
<path d="M6.993,318.601 L7.46,66.367 L396.141,97.459 L325.004,344.039 L161.52,359.48" fill="#E34F26"/>
<path d="M165.506,338.684 L297.108,326.727 L357.937,115.517 L199.362,102.832" fill="#EF652A"/>
<path d="M144.287,119.029 L176.791,256.135 L247.473,127.283 L327.139,133.655 L302.106,308.044 L280.474,306.313 C272.058,305.64 265.446,303.265 260.64,299.187 C256.048,294.977 255.197,293.021 254.514,286.738 L272.201,163.527 L198.912,299.842 L143.525,295.411 L109.834,150.538 L89.656,291.102 L39.58,287.097 L61.936,131.364 C62.662,126.308 65.934,122.222 71.753,119.108 C77.572,115.993 84.3,114.571 91.935,114.841 z" fill="#FFFFFF" fill-opacity="0.95"/>
<path d="M247.473,127.283 L327.139,133.655 L302.106,308.044 L280.474,306.313 C272.058,305.64 265.446,303.265 260.64,299.187 C256.048,294.977 255.197,293.021 254.514,286.738 L272.2,163.527 L198.912,299.842 L171.397,297.641 L177.556,254.741 z" fill="#FFFFFF"/>
</g>
<g id="Layer_2">
<path d="M440.537,261.869 Q428.624,253.233 423.519,238.598 Q418.414,223.964 418.414,208.13 Q418.414,195.175 422.668,182.22 Q426.923,169.265 435.999,160.628 Q450.747,146.234 474.005,143.595 Q497.262,140.956 515.982,146.714 Q537.537,153.911 547.748,171.664 Q557.391,187.498 557.391,208.61 Q557.391,223.964 553.42,235 Q549.45,246.036 543.21,253.713 Q529.596,269.547 508.607,273.385 Q489.888,277.703 470.885,274.105 Q451.882,270.506 440.537,261.869 z M467.765,177.422 Q455.853,188.458 456.987,210.289 Q458.122,232.121 466.63,240.758 Q470.034,244.596 478.543,247.235 Q487.052,249.874 495.844,247.715 Q504.637,245.556 511.444,236.919 Q518.251,228.282 518.818,209.09 Q518.818,191.816 512.294,183.18 Q505.771,174.543 497.262,172.144 Q488.753,169.745 480.245,171.904 Q471.736,174.063 467.765,177.422 z" fill="#FFFFFF"/>
<path d="M700.075,273.385 L680.221,273.385 Q671.712,273.385 666.323,268.827 Q660.934,264.269 660.934,257.071 L660.934,191.816 Q660.934,180.301 652.709,175.023 Q644.484,169.745 634.273,169.745 Q624.063,169.745 616.121,175.023 Q608.179,180.301 608.179,191.816 L608.179,273.385 L568.472,273.385 L568.472,198.534 Q568.472,165.906 588.609,154.87 Q608.747,143.835 633.139,142.875 Q658.098,142.875 679.086,153.911 Q700.075,164.947 700.075,198.534 z" fill="#FFFFFF"/>
<path d="M819.97,234.04 L848.333,234.04 Q842.093,254.192 824.508,264.748 Q806.923,275.784 780.262,275.784 Q747.928,275.784 729.776,258.031 Q711.624,240.758 711.624,208.61 Q711.624,177.902 729.209,160.628 Q747.361,142.875 779.695,142.875 Q813.73,142.875 832.449,160.148 Q850.602,177.902 850.602,209.57 Q850.602,211.489 850.602,212.928 Q850.602,214.368 850.602,214.847 Q850.602,217.247 850.034,218.206 L751.899,218.206 Q752.466,233.081 760.408,240.278 Q767.782,247.955 782.531,247.955 Q792.174,247.955 798.981,244.596 Q800.683,244.116 802.101,242.917 Q803.519,241.717 805.221,240.278 Q805.788,238.838 809.476,236.439 Q813.163,234.04 819.97,234.04 z M751.899,196.614 L809.759,196.614 Q808.625,183.659 801.818,177.422 Q794.443,170.704 780.829,170.704 Q768.35,170.704 760.408,177.422 Q752.466,184.139 751.899,196.614 z" fill="#FFFFFF"/>
<path d="M926.682,273.385 Q907.963,274.345 886.123,272.905 Q864.284,271.466 864.284,249.394 L864.284,108.328 L884.705,108.328 Q892.079,108.328 897.752,113.126 Q903.424,117.925 903.424,124.642 L903.424,146.234 L926.682,146.234 L926.682,152.951 Q926.682,160.148 921.009,164.707 Q915.337,169.265 907.395,169.265 L903.424,169.265 L903.424,240.278 Q903.424,248.435 914.77,248.435 L926.682,248.435 z" fill="#FFFFFF"/>
<path d="M943.17,145.754 L963.591,145.754 Q971.533,145.754 977.205,150.552 Q982.878,155.35 982.878,162.068 L982.878,273.385 L943.17,273.385 z M943.17,108.328 L963.591,108.328 Q971.533,108.328 977.205,113.126 Q982.878,117.925 982.878,124.642 L982.878,134.718 L943.17,134.718 z" fill="#FFFFFF"/>
<path d="M997.165,273.385 L997.165,247.955 L1078.283,172.144 L1020.99,172.144 Q1013.048,172.144 1007.376,167.586 Q1001.703,163.027 1001.703,156.31 L1001.703,145.754 L1125.365,145.754 L1125.365,173.103 L1045.382,245.556 L1128.201,245.556 L1128.201,273.385 z" fill="#FFFFFF"/>
<path d="M1245.192,234.04 L1273.555,234.04 Q1267.315,254.192 1249.73,264.748 Q1232.145,275.784 1205.484,275.784 Q1173.151,275.784 1154.998,258.031 Q1136.846,240.758 1136.846,208.61 Q1136.846,177.902 1154.431,160.628 Q1172.583,142.875 1204.917,142.875 Q1238.952,142.875 1257.672,160.148 Q1275.824,177.902 1275.824,209.569 Q1275.824,211.489 1275.824,212.928 Q1275.824,214.368 1275.824,214.847 Q1275.824,217.247 1275.256,218.206 L1177.121,218.206 Q1177.689,233.08 1185.63,240.278 Q1193.005,247.955 1207.753,247.955 Q1217.396,247.955 1224.203,244.596 Q1225.905,244.116 1227.323,242.917 Q1228.742,241.717 1230.443,240.278 Q1231.011,238.838 1234.698,236.439 Q1238.385,234.04 1245.192,234.04 z M1177.121,196.614 L1234.981,196.614 Q1233.847,183.659 1227.04,177.422 Q1219.665,170.704 1206.051,170.704 Q1193.572,170.704 1185.63,177.422 Q1177.689,184.139 1177.121,196.614 z" fill="#FFFFFF"/>
<path d="M369.458,287.501 Q355.306,277.241 349.241,259.855 Q343.176,242.469 343.176,223.659 Q343.176,208.268 348.23,192.877 Q353.284,177.487 364.066,167.226 Q381.588,150.126 409.218,146.991 Q436.848,143.855 459.086,150.696 Q484.694,159.246 496.825,180.337 Q508.281,199.148 508.281,224.229 Q508.281,242.469 503.564,255.58 Q498.846,268.69 491.433,277.811 Q475.26,296.621 450.325,301.181 Q428.087,306.312 405.511,302.037 Q382.936,297.761 369.458,287.501 z M401.805,187.177 Q387.653,200.288 389.001,226.224 Q390.348,252.16 400.457,262.42 Q404.5,266.98 414.609,270.115 Q424.717,273.25 435.163,270.685 Q445.608,268.12 453.695,257.86 Q461.782,247.599 462.456,224.799 Q462.456,204.278 454.706,194.017 Q446.956,183.757 436.848,180.907 Q426.739,178.057 416.631,180.622 Q406.522,183.187 401.805,187.177 z" fill="#FFFFFF"/>
<path d="M677.789,301.181 L654.202,301.181 Q644.094,301.181 637.692,295.766 Q631.29,290.351 631.29,281.801 L631.29,204.278 Q631.29,190.597 621.518,184.327 Q611.747,178.057 599.617,178.057 Q587.486,178.057 578.052,184.327 Q568.617,190.597 568.617,204.278 L568.617,301.181 L521.444,301.181 L521.444,212.258 Q521.444,173.497 545.368,160.386 Q569.291,147.276 598.269,146.136 Q627.92,146.136 652.855,159.246 Q677.789,172.357 677.789,212.258 z" fill="#FFFFFF"/>
<path d="M820.224,254.44 L853.919,254.44 Q846.506,278.381 825.615,290.921 Q804.725,304.032 773.051,304.032 Q734.639,304.032 713.074,282.941 Q691.509,262.42 691.509,224.229 Q691.509,187.747 712.4,167.226 Q733.965,146.136 772.377,146.136 Q812.811,146.136 835.05,166.656 Q856.615,187.747 856.615,225.369 Q856.615,227.649 856.615,229.359 Q856.615,231.069 856.615,231.639 Q856.615,234.489 855.941,235.629 L739.356,235.629 Q740.03,253.3 749.465,261.85 Q758.225,270.97 775.747,270.97 Q787.203,270.97 795.29,266.98 Q797.312,266.41 798.996,264.985 Q800.681,263.56 802.703,261.85 Q803.377,260.14 807.757,257.29 Q812.137,254.44 820.224,254.44 z M739.356,209.978 L808.094,209.978 Q806.746,194.587 798.659,187.177 Q789.899,179.197 773.725,179.197 Q758.899,179.197 749.465,187.177 Q740.03,195.157 739.356,209.978 z" fill="#FFFFFF"/>
<path d="M946.998,301.181 Q924.759,302.322 898.814,300.611 Q872.869,298.901 872.869,272.68 L872.869,105.094 L897.13,105.094 Q905.89,105.094 912.629,110.794 Q919.368,116.494 919.368,124.475 L919.368,150.126 L946.998,150.126 L946.998,158.106 Q946.998,166.656 940.259,172.072 Q933.52,177.487 924.086,177.487 L919.368,177.487 L919.368,261.85 Q919.368,271.54 932.846,271.54 L946.998,271.54 z" fill="#FFFFFF"/>
<path d="M966.586,149.556 L990.846,149.556 Q1000.281,149.556 1007.02,155.256 Q1013.759,160.956 1013.759,168.936 L1013.759,301.181 L966.586,301.181 z M966.586,105.094 L990.846,105.094 Q1000.281,105.094 1007.02,110.794 Q1013.759,116.494 1013.759,124.475 L1013.759,136.445 L966.586,136.445 z" fill="#FFFFFF"/>
<path d="M1030.732,301.181 L1030.732,270.97 L1127.1,180.907 L1059.036,180.907 Q1049.601,180.907 1042.862,175.492 Q1036.123,170.076 1036.123,162.096 L1036.123,149.556 L1183.033,149.556 L1183.033,182.047 L1088.014,268.12 L1186.403,268.12 L1186.403,301.181 z" fill="#FFFFFF"/>
<path d="M1325.388,254.44 L1359.083,254.44 Q1351.67,278.381 1330.779,290.921 Q1309.888,304.032 1278.215,304.032 Q1239.803,304.032 1218.238,282.941 Q1196.673,262.42 1196.673,224.229 Q1196.673,187.747 1217.564,167.226 Q1239.129,146.135 1277.541,146.135 Q1317.975,146.135 1340.214,166.656 Q1361.779,187.747 1361.779,225.369 Q1361.779,227.649 1361.779,229.359 Q1361.779,231.069 1361.779,231.639 Q1361.779,234.489 1361.105,235.629 L1244.52,235.629 Q1245.194,253.3 1254.629,261.85 Q1263.389,270.97 1280.911,270.97 Q1292.367,270.97 1300.454,266.98 Q1302.475,266.41 1304.16,264.985 Q1305.845,263.56 1307.867,261.85 Q1308.541,260.14 1312.921,257.29 Q1317.301,254.44 1325.388,254.44 z M1244.52,209.978 L1313.258,209.978 Q1311.91,194.587 1303.823,187.177 Q1295.063,179.197 1278.889,179.197 Q1264.063,179.197 1254.629,187.177 Q1245.194,195.157 1244.52,209.978 z" fill="#FFFFFF"/>
<g>
<path d="M1364.929,271.719 L1389.389,271.719 Q1390.787,280.054 1397.426,283.388 Q1404.415,287.278 1416.645,287.278 Q1427.478,287.278 1433.068,284.222 Q1438.659,281.166 1438.659,275.331 Q1438.659,266.439 1407.21,260.882 L1406.511,260.604 Q1406.511,260.604 1403.716,260.049 Q1385.895,256.992 1379.954,253.658 Q1372.966,250.602 1370.17,244.767 Q1366.676,239.765 1366.676,231.985 Q1366.676,218.371 1378.557,210.591 Q1390.438,203.089 1413.151,203.089 Q1434.466,203.089 1445.998,210.868 Q1457.878,219.482 1458.577,233.375 L1444.6,233.375 Q1436.563,233.375 1433.068,227.54 Q1431.321,224.761 1428.176,222.816 Q1421.887,219.204 1411.054,219.204 Q1400.571,219.204 1396.028,222.261 Q1390.787,225.317 1390.787,230.874 Q1390.787,238.376 1411.054,241.988 Q1416.995,243.377 1419.79,243.655 Q1426.08,245.322 1430.797,246.295 Q1435.515,247.267 1438.31,247.823 Q1443.202,249.49 1448.094,251.157 Q1455.083,254.492 1458.927,259.771 Q1462.771,265.606 1462.771,272.552 Q1462.771,287.556 1450.191,295.892 Q1437.611,303.672 1414.548,303.672 Q1390.787,303.672 1378.906,295.614 Q1365.977,287.556 1364.929,271.719 z" fill="#FFFFFF"/>
<path d="M1364.929,271.719 L1389.389,271.719 Q1390.787,280.054 1397.426,283.388 Q1404.415,287.278 1416.645,287.278 Q1427.478,287.278 1433.068,284.222 Q1438.659,281.166 1438.659,275.331 Q1438.659,266.439 1407.21,260.882 L1406.511,260.604 Q1406.511,260.604 1403.716,260.049 Q1385.895,256.992 1379.954,253.658 Q1372.966,250.602 1370.17,244.767 Q1366.676,239.765 1366.676,231.985 Q1366.676,218.371 1378.557,210.591 Q1390.438,203.089 1413.151,203.089 Q1434.466,203.089 1445.998,210.868 Q1457.878,219.482 1458.577,233.375 L1444.6,233.375 Q1436.563,233.375 1433.068,227.54 Q1431.321,224.761 1428.176,222.816 Q1421.887,219.204 1411.054,219.204 Q1400.571,219.204 1396.028,222.261 Q1390.787,225.317 1390.787,230.874 Q1390.787,238.376 1411.054,241.988 Q1416.995,243.377 1419.79,243.655 Q1426.08,245.322 1430.797,246.295 Q1435.515,247.267 1438.31,247.823 Q1443.202,249.49 1448.094,251.157 Q1455.083,254.492 1458.927,259.771 Q1462.771,265.606 1462.771,272.552 Q1462.771,287.556 1450.191,295.892 Q1437.611,303.672 1414.548,303.672 Q1390.787,303.672 1378.906,295.614 Q1365.977,287.556 1364.929,271.719 z" fill-opacity="0" stroke="#FFFFFF" stroke-width="5"/>
<path d="M1467.635,299.202 L1496.694,299.202 Q1498.355,309.104 1506.242,313.065 Q1514.545,317.687 1529.074,317.687 Q1541.943,317.687 1548.585,314.056 Q1555.228,310.425 1555.228,303.493 Q1555.228,292.93 1517.866,286.328 L1517.036,285.998 Q1517.036,285.998 1513.715,285.338 Q1492.543,281.707 1485.486,277.746 Q1477.183,274.115 1473.862,267.183 Q1469.711,261.241 1469.711,251.999 Q1469.711,235.824 1483.825,226.582 Q1497.94,217.669 1524.923,217.669 Q1550.246,217.669 1563.945,226.912 Q1578.06,237.145 1578.89,253.649 L1562.285,253.649 Q1552.737,253.649 1548.585,246.717 Q1546.51,243.416 1542.774,241.106 Q1535.301,236.815 1522.432,236.815 Q1509.979,236.815 1504.582,240.446 Q1498.355,244.077 1498.355,250.678 Q1498.355,259.591 1522.432,263.882 Q1529.49,265.532 1532.811,265.863 Q1540.283,267.843 1545.887,268.998 Q1551.491,270.154 1554.812,270.814 Q1560.624,272.794 1566.436,274.775 Q1574.739,278.736 1579.305,285.008 Q1583.871,291.94 1583.871,300.192 Q1583.871,318.017 1568.927,327.92 Q1553.982,337.162 1526.584,337.162 Q1498.355,337.162 1484.241,327.589 Q1468.881,318.017 1467.635,299.202 z" fill="#FFFFFF"/>
<path d="M1467.635,299.202 L1496.694,299.202 Q1498.355,309.104 1506.242,313.065 Q1514.545,317.687 1529.074,317.687 Q1541.943,317.687 1548.585,314.056 Q1555.228,310.425 1555.228,303.493 Q1555.228,292.93 1517.866,286.328 L1517.036,285.998 Q1517.036,285.998 1513.715,285.338 Q1492.543,281.707 1485.486,277.746 Q1477.183,274.115 1473.862,267.183 Q1469.711,261.241 1469.711,251.999 Q1469.711,235.824 1483.825,226.582 Q1497.94,217.669 1524.923,217.669 Q1550.246,217.669 1563.945,226.912 Q1578.06,237.145 1578.89,253.649 L1562.285,253.649 Q1552.737,253.649 1548.585,246.717 Q1546.51,243.416 1542.774,241.106 Q1535.301,236.815 1522.432,236.815 Q1509.979,236.815 1504.582,240.446 Q1498.355,244.077 1498.355,250.678 Q1498.355,259.591 1522.432,263.882 Q1529.49,265.532 1532.811,265.863 Q1540.283,267.843 1545.887,268.998 Q1551.491,270.154 1554.812,270.814 Q1560.624,272.794 1566.436,274.775 Q1574.739,278.736 1579.305,285.008 Q1583.871,291.94 1583.871,300.192 Q1583.871,318.017 1568.927,327.92 Q1553.982,337.162 1526.584,337.162 Q1498.355,337.162 1484.241,327.589 Q1468.881,318.017 1467.635,299.202 z" fill-opacity="0" stroke="#FFFFFF" stroke-width="5.94"/>
</g>
<g>
<path d="M1352.699,205.867 L1352.699,273.386 C1352.699,279.499 1352.35,283.944 1351.651,286.723 C1350.486,289.872 1348.972,292.372 1347.108,294.225 C1343.847,297.374 1339.537,299.782 1334.179,301.449 C1328.122,302.931 1321.6,303.672 1314.611,303.672 C1307.156,303.672 1301.099,302.931 1296.44,301.449 C1291.548,300.523 1287.239,298.485 1283.511,295.336 C1280.483,292.743 1278.503,290.15 1277.571,287.556 C1276.406,284.222 1275.824,279.406 1275.824,273.108 L1275.824,271.913 L1299.935,271.913 L1299.935,277.276 C1299.935,280.61 1301.099,283.203 1303.429,285.056 C1305.759,286.723 1309.369,287.556 1314.261,287.556 C1319.154,287.556 1322.764,286.537 1325.094,284.5 C1326.958,282.648 1327.889,278.665 1327.889,272.552 L1327.889,215.87 C1327.889,213.091 1329.171,210.73 1331.733,208.785 C1334.296,206.84 1337.324,205.867 1340.819,205.867 z" fill="#FFFFFF"/>
<path d="M1352.699,205.867 L1352.699,273.386 C1352.699,279.499 1352.35,283.944 1351.651,286.723 C1350.486,289.872 1348.972,292.372 1347.108,294.225 C1343.847,297.374 1339.537,299.782 1334.179,301.449 C1328.122,302.931 1321.6,303.672 1314.611,303.672 C1307.156,303.672 1301.099,302.931 1296.44,301.449 C1291.548,300.523 1287.239,298.485 1283.511,295.336 C1280.483,292.743 1278.503,290.15 1277.571,287.556 C1276.406,284.222 1275.824,279.406 1275.824,273.108 L1275.824,271.913 L1299.935,271.913 L1299.935,277.276 C1299.935,280.61 1301.099,283.203 1303.429,285.056 C1305.759,286.723 1309.369,287.556 1314.261,287.556 C1319.154,287.556 1322.764,286.537 1325.094,284.5 C1326.958,282.648 1327.889,278.665 1327.889,272.552 L1327.889,215.87 C1327.889,213.091 1329.171,210.73 1331.733,208.785 C1334.296,206.84 1337.324,205.867 1340.819,205.867 z" fill-opacity="0" stroke="#FFFFFF" stroke-width="5"/>
<path d="M1453.107,220.97 L1453.107,301.182 C1453.107,308.444 1452.692,313.726 1451.861,317.027 C1450.478,320.768 1448.679,323.738 1446.465,325.939 C1442.59,329.68 1437.47,332.541 1431.105,334.521 C1423.91,336.282 1416.16,337.162 1407.858,337.162 C1399.002,337.162 1391.806,336.282 1386.271,334.521 C1380.459,333.421 1375.339,331 1370.911,327.259 C1367.314,324.179 1364.961,321.098 1363.854,318.017 C1362.47,314.056 1361.779,308.334 1361.779,300.852 L1361.779,299.432 L1390.422,299.432 L1390.422,305.803 C1390.422,309.765 1391.806,312.845 1394.574,315.046 C1397.341,317.027 1401.631,318.017 1407.443,318.017 C1413.255,318.017 1417.544,316.807 1420.312,314.386 C1422.526,312.185 1423.633,307.454 1423.633,300.192 L1423.633,232.853 C1423.633,229.553 1425.155,226.747 1428.199,224.436 C1431.243,222.126 1434.841,220.97 1438.993,220.97 z" fill="#FFFFFF"/>
<path d="M1453.107,220.97 L1453.107,301.182 C1453.107,308.444 1452.692,313.726 1451.861,317.027 C1450.478,320.768 1448.679,323.738 1446.465,325.939 C1442.59,329.68 1437.47,332.541 1431.105,334.521 C1423.91,336.282 1416.16,337.162 1407.858,337.162 C1399.002,337.162 1391.806,336.282 1386.271,334.521 C1380.459,333.421 1375.339,331 1370.911,327.259 C1367.314,324.179 1364.961,321.098 1363.854,318.017 C1362.47,314.056 1361.779,308.334 1361.779,300.852 L1361.779,299.432 L1390.422,299.432 L1390.422,305.803 C1390.422,309.765 1391.806,312.845 1394.574,315.046 C1397.341,317.027 1401.631,318.017 1407.443,318.017 C1413.255,318.017 1417.544,316.807 1420.312,314.386 C1422.526,312.185 1423.633,307.454 1423.633,300.192 L1423.633,232.853 C1423.633,229.553 1425.155,226.747 1428.199,224.436 C1431.243,222.126 1434.841,220.97 1438.993,220.97 z" fill-opacity="0" stroke="#FFFFFF" stroke-width="5.94"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -8,7 +8,6 @@ define([
"eventMgr",
"fileSystem",
"fileMgr",
"sharing",
"monetizejs",
"classes/Provider",
"classes/AsyncTask",
@ -23,7 +22,7 @@ define([
"providers/sshProvider",
"providers/tumblrProvider",
"providers/wordpressProvider"
], function($, _, constants, utils, storage, settings, eventMgr, fileSystem, fileMgr, sharing, MonetizeJS, Provider, AsyncTask) {
], function($, _, constants, utils, storage, settings, eventMgr, fileSystem, fileMgr, MonetizeJS, Provider, AsyncTask) {
var publisher = {};
@ -248,9 +247,7 @@ define([
provider.publish(publishAttributes, fileDesc.frontMatter, title, content, function(error) {
if(error === undefined) {
publishAttributes.provider = provider;
sharing.createLink(publishAttributes, function() {
createPublishIndex(fileDesc, publishAttributes);
});
createPublishIndex(fileDesc, publishAttributes);
}
});

View File

@ -1,135 +1,90 @@
define([
"jquery",
"underscore",
"constants",
"utils",
"eventMgr",
"fileMgr",
"classes/AsyncTask",
"classes/Provider",
"providers/downloadProvider",
"providers/gistProvider"
"jquery",
"underscore",
"constants",
"utils",
"eventMgr",
"fileMgr",
"classes/AsyncTask",
"classes/Provider",
"providers/downloadProvider",
"providers/gistProvider"
], function($, _, constants, utils, eventMgr, fileMgr, AsyncTask, Provider) {
var sharing = {};
var sharing = {};
// Create a map with providerId: providerModule
var providerMap = _.chain(arguments).map(function(argument) {
return argument instanceof Provider && [
argument.providerId,
argument
];
}).compact().object().value();
// Create a map with providerId: providerModule
var providerMap = _.chain(arguments).map(function(argument) {
return argument instanceof Provider && [
argument.providerId,
argument
];
}).compact().object().value();
// Listen to offline status changes
var isOffline = false;
eventMgr.addListener("onOfflineChanged", function(isOfflineParam) {
isOffline = isOfflineParam;
});
// Listen to offline status changes
var isOffline = false;
eventMgr.addListener("onOfflineChanged", function(isOfflineParam) {
isOffline = isOfflineParam;
});
sharing.createLink = function(attributes, callback) {
var provider = providerMap[attributes.provider.providerId];
// Don't create link if link already exists or provider is not
// compatible for sharing
if(attributes.sharingLink !== undefined || provider === undefined ||
// Or document is not published in markdown format
attributes.format != "markdown") {
callback();
return;
}
// Twitter does that for us
/*
var task = new AsyncTask();
var shortUrl;
task.onRun(function() {
if(isOffline === true) {
task.chain();
return;
}
var url = [
constants.MAIN_URL,
'viewer#!provider=',
provider.providerId
];
_.each(provider.sharingAttributes, function(attributeName) {
url.push('&');
url.push(attributeName);
url.push('=');
url.push(encodeURIComponent(attributes[attributeName]));
});
url = url.join("");
$.getJSON("https://api-ssl.bitly.com/v3/shorten", {
"access_token": constants.BITLY_ACCESS_TOKEN,
"longUrl": url
}, function(response) {
if(response.data) {
shortUrl = response.data.url;
attributes.sharingLink = shortUrl;
}
else {
eventMgr.onError("An error occured while creating sharing link.");
attributes.sharingLink = url;
}
task.chain();
});
});
function onFinish() {
callback();
}
task.onSuccess(onFinish);
task.onError(onFinish);
task.enqueue();
*/
var url = [
constants.MAIN_URL,
'viewer#!provider=',
provider.providerId
];
_.each(provider.sharingAttributes, function(attributeName) {
url.push('&');
url.push(attributeName);
url.push('=');
url.push(encodeURIComponent(attributes[attributeName]));
});
attributes.sharingLink = url.join('');
callback();
};
sharing.getViewerLink = function(attributes) {
var provider = providerMap[attributes.provider.providerId];
// Don't create link if provider is not compatible for sharing
if(provider === undefined ||
// Or document is not published in markdown format
attributes.format != "markdown") {
return;
}
var url = [
constants.MAIN_URL,
'viewer#!provider=',
provider.providerId
];
_.each(provider.sharingAttributes, function(attributeName) {
url.push('&');
url.push(attributeName);
url.push('=');
url.push(encodeURIComponent(attributes[attributeName]));
});
attributes.sharingLink = url.join('');
callback();
};
eventMgr.addListener("onReady", function() {
if(window.viewerMode === false) {
return;
}
// Check parameters to see if we have to download a shared document
var providerId = utils.getURLParameter("provider");
if(providerId === undefined) {
providerId = "download";
}
var provider = providerMap[providerId];
if(provider === undefined) {
return;
}
var importParameters = {};
_.each(provider.sharingAttributes, function(attributeName) {
var parameter = utils.getURLParameter(attributeName);
if(!parameter) {
importParameters = undefined;
return;
}
importParameters[attributeName] = parameter;
});
if(importParameters === undefined) {
return;
}
$("#preview-contents, .navbar .file-title-navbar").hide();
provider.importPublic(importParameters, function(error, title, content) {
$("#preview-contents, .navbar .file-title-navbar").show();
if(error) {
return;
}
var fileDesc = fileMgr.createFile(title, content, undefined, undefined, true);
fileMgr.selectFile(fileDesc);
});
});
eventMgr.addListener("onReady", function() {
if(window.viewerMode === false) {
return;
}
// Check parameters to see if we have to download a shared document
var providerId = utils.getURLParameter("provider");
if(providerId === undefined) {
providerId = "download";
}
var provider = providerMap[providerId];
if(provider === undefined) {
return;
}
var importParameters = {};
_.each(provider.sharingAttributes, function(attributeName) {
var parameter = utils.getURLParameter(attributeName);
if(!parameter) {
importParameters = undefined;
return;
}
importParameters[attributeName] = parameter;
});
if(importParameters === undefined) {
return;
}
$("#preview-contents, .navbar .file-title-navbar").hide();
provider.importPublic(importParameters, function(error, title, content) {
$("#preview-contents, .navbar .file-title-navbar").show();
if(error) {
return;
}
var fileDesc = fileMgr.createFile(title, content, undefined, undefined, true);
fileMgr.selectFile(fileDesc);
});
});
return sharing;
return sharing;
});

View File

@ -142,8 +142,8 @@
}
.social i::before {
margin-right: 10px;
margin-left: -5px;
margin-right: 8px;
margin-left: -3px;
}
.social a {