Skip to content
Permalink
Browse files

Replace anchors with no real href with buttons

Closes #3101 & #916
  • Loading branch information...
PaulAdamDavis committed Jul 14, 2014
1 parent 4d61026 commit 6451be695b7c9cb920b4596edc41e9c62f813528
@@ -1,8 +1,8 @@
<header class="floatingheader">
<button class="button-back" href="#">Back</button>
<a {{bind-attr class="featured:featured:unfeatured"}} href="#" title="Feature this post" {{action "toggleFeatured"}}>
<button {{bind-attr class="featured:featured:unfeatured"}} title="Feature this post" {{action "toggleFeatured"}}>
<span class="hidden">Star</span>
</a>
</button>
<small>
<span class="status">{{#if isPublished}}Published{{else}}Written{{/if}}</span>
<span class="normal">by</span>
@@ -12,7 +12,7 @@
{{#link-to "editor.edit" this class="post-edit" title="Edit Post"}}
<span class="hidden">Edit Post</span>
{{/link-to}}
{{#gh-popover-button popoverName="post-settings-menu" tagName="a" classNames="post-settings" title="Post Settings"}}
{{#gh-popover-button popoverName="post-settings-menu" classNames="post-settings" title="Post Settings"}}
<span class="hidden">Post Settings</span>
{{/gh-popover-button}}
{{#gh-popover name="post-settings-menu" classNames="post-settings-menu menu-drop-right"}}
@@ -5,7 +5,7 @@
<div class="right">

<section id="entry-controls" {{bind-attr class="isNew:unsaved"}}>
{{#gh-popover-button popoverName="post-settings-menu" tagName="a" href="#" classNames="post-settings" title="Post Settings"}}
{{#gh-popover-button popoverName="post-settings-menu" classNames="post-settings" title="Post Settings"}}
<span class="hidden">Post Settings</span>
{{/gh-popover-button}}
{{#gh-popover name="post-settings-menu" classNames="post-settings-menu menu-right"}}
@@ -29,4 +29,4 @@
</tbody>
</table>
</form>
<a class="delete" {{action "openModal" "delete-post" this}}>Delete This Post</a>
<button class="delete" {{action "openModal" "delete-post" this}}>Delete This Post</button>
@@ -33,19 +33,19 @@
<div class="form-group">
<label for="blog-logo">Blog Logo</label>
{{#if logo}}
<a class="js-modal-logo" href="#" {{action "openModal" "upload" this "logo"}}><img id="blog-logo" {{bind-attr src=logo}} alt="logo"></a>
<button class="js-modal-logo" {{action "openModal" "upload" this "logo"}}><img id="blog-logo" {{bind-attr src=logo}} alt="logo"></button>
{{else}}
<a class="button-add js-modal-logo" {{action "openModal" "upload" this "logo"}}>Upload Image</a>
<button class="button-add js-modal-logo" {{action "openModal" "upload" this "logo"}}>Upload Image</button>
{{/if}}
<p>Display a sexy logo for your publication</p>
</div>

<div class="form-group">
<label for="blog-cover">Blog Cover</label>
{{#if cover}}
<a class="js-modal-cover" href="#" {{action "openModal" "upload" this "cover"}}><img id="blog-cover" {{bind-attr src=cover}} alt="cover photo"></a>
<button class="js-modal-cover" {{action "openModal" "upload" this "cover"}}><img id="blog-cover" {{bind-attr src=cover}} alt="cover photo"></button>
{{else}}
<a class="button-add js-modal-cover" {{action "openModal" "upload" this "cover"}}>Upload Image</a>
<button class="button-add js-modal-cover" {{action "openModal" "upload" this "cover"}}>Upload Image</button>
{{/if}}
<p>Display a cover image on your site</p>
</div>
@@ -2,7 +2,7 @@
{{#link-to 'settings' class='button-back button'}}Back{{/link-to}}
<h2 class="title">Users</h2>
<section class="page-actions">
<a class="button-add" href="" {{action "openModal" "invite-new-user" this}} >New&nbsp;User</a>
<button class="button-add" {{action "openModal" "invite-new-user" this}} >New&nbsp;User</button>
</section>
</header>

@@ -28,7 +28,7 @@

<header class="user-profile-header">
<img id="user-cover" class="cover-image" {{bind-attr src=cover title=coverTitle}} />
<a class="edit-cover-image js-modal-cover button" {{action "openModal" "upload" user "cover"}}>Change Cover</a>
<button class="edit-cover-image js-modal-cover button" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
</header>

<form class="user-profile" novalidate="novalidate">
@@ -37,7 +37,7 @@

<figure class="user-image">
<div id="user-image" class="img" {{bind-attr style=image}} href="#"><span class="hidden">{{name}}"s Picture</span></div>
<a href="" {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</a>
<button {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
</figure>

<div class="form-group">
@@ -42,8 +42,8 @@ CasperTest.begin('Content screen is correct', 21, function suite(test) {
});

casper.then(function testPostSettingsMenu() {
test.assertExists('.content-preview a.post-settings', 'post settings button exists');
this.click('.content-preview a.post-settings');
test.assertExists('.content-preview button.post-settings', 'post settings button exists');
this.click('.content-preview button.post-settings');
});

casper.waitUntilVisible('.post-settings-menu', function onSuccess() {
@@ -52,7 +52,7 @@ CasperTest.begin('Content screen is correct', 21, function suite(test) {

casper.then(function postSettingsMenuItems() {
test.assertExists('.post-settings-menu .post-setting-static-page', 'post settings static page exists');
test.assertExists('.post-settings-menu a.delete', 'post settings delete this post exists');
test.assertExists('.post-settings-menu button.delete', 'post settings delete this post exists');
});

casper.then(function testActiveItem() {
@@ -95,7 +95,7 @@ CasperTest.begin('Content list shows correct post status', 7, function testStati
});

// Change post to static page
casper.thenClick('a.post-settings');
casper.thenClick('button.post-settings');

casper.waitUntilVisible('.post-settings-menu', function onSuccess() {
test.assert(true, 'post settings menu should be visible after clicking post-settings icon');
@@ -121,9 +121,9 @@ CasperTest.begin('Delete post modal', 7, function testDeleteModal(test) {
});

// Open post settings menu
casper.thenClick('.content-preview a.post-settings');
casper.thenClick('.content-preview button.post-settings');
casper.waitForOpaque('.content-preview .post-settings-menu.open');
casper.thenClick('.post-settings-menu a.delete');
casper.thenClick('.post-settings-menu button.delete');

casper.waitUntilVisible('#modal-container', function onSuccess() {
test.assertSelectorHasText(
@@ -139,8 +139,8 @@ CasperTest.begin('Delete post modal', 7, function testDeleteModal(test) {
});

// Test delete
casper.thenClick('.content-preview a.post-settings');
casper.thenClick('.post-settings-menu a.delete');
casper.thenClick('.content-preview button.post-settings');
casper.thenClick('.post-settings-menu button.delete');

casper.waitForSelector('#modal-container .modal-content', function onSuccess() {
test.assertExists('.modal-content .js-button-accept', 'delete button exists');
@@ -220,7 +220,7 @@ CasperTest.begin('Post url can be changed', 5, function suite(test) {
test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL');
});

casper.thenClick('a.post-settings');
casper.thenClick('button.post-settings');

casper.waitUntilVisible('.post-settings-menu', function onSuccess() {
test.assert(true, 'post settings menu should be visible after clicking post-settings icon');
@@ -232,7 +232,7 @@ CasperTest.begin('Post url can be changed', 5, function suite(test) {
'#url': 'new-url'
}, false);

this.click('a.post-settings');
this.click('button.post-settings');
});

casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function testGoodResponse(resource) {
@@ -258,7 +258,7 @@ CasperTest.begin('Post published date can be changed', 5, function suite(test) {
test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL');
});

casper.thenClick('a.post-settings');
casper.thenClick('button.post-settings');

casper.waitUntilVisible('.post-settings-menu', function onSuccess() {
test.assert(true, 'post settings menu should be visible after clicking post-settings icon');
@@ -270,7 +270,7 @@ CasperTest.begin('Post published date can be changed', 5, function suite(test) {
'.post-setting-date': '22 May 14 @ 23:39'
}, false);

this.click('a.post-settings');
this.click('button.post-settings');
});

casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function testGoodResponse(resource) {
@@ -296,7 +296,7 @@ CasperTest.begin('Post can be changed to static page', 7, function suite(test) {
test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL');
});

casper.thenClick('.content-preview a.post-settings');
casper.thenClick('.content-preview button.post-settings');

casper.waitForOpaque('.content-preview .post-settings-menu.open', function onSuccess() {
test.assert(true, 'post settings should be visible after clicking post-settings icon');
@@ -250,24 +250,24 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {
});

casper.then(function () {
test.assertExists('#publish-bar a.post-settings', 'icon toggle should exist');
test.assertExists('#publish-bar button.post-settings', 'icon toggle should exist');
test.assertNotVisible('#publish-bar .post-settings-menu', 'popup menu should not be visible at startup');
test.assertExists('.post-settings-menu input#url', 'url field exists');
test.assertExists('.post-settings-menu input.post-setting-date', 'publication date field exists');
test.assertExists('.post-settings-menu input.post-setting-static-page', 'static page checkbox field exists');
test.assertExists('.post-settings-menu a.delete', 'delete post button exists');
test.assertExists('.post-settings-menu button.delete', 'delete post button exists');
});

casper.thenClick('#publish-bar a.post-settings');
casper.thenClick('#publish-bar button.post-settings');

casper.waitUntilVisible('#publish-bar .post-settings-menu', function onSuccess() {
test.assert(true, 'popup menu should be visible after clicking post-settings icon');
test.assertNotVisible(
'.post-settings-menu a.delete', 'delete post button shouldn\'t be visible on unsaved drafts'
'.post-settings-menu button.delete', 'delete post button shouldn\'t be visible on unsaved drafts'
);
});

casper.thenClick('#publish-bar a.post-settings');
casper.thenClick('#publish-bar button.post-settings');

casper.waitWhileVisible('#publish-bar .post-settings-menu', function onSuccess() {
test.assert(true, 'popup menu should not be visible after clicking post-settings icon');
@@ -290,13 +290,13 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {

casper.waitWhileSelector('.notification-success');

casper.thenClick('#publish-bar a.post-settings');
casper.thenClick('#publish-bar button.post-settings');

casper.waitUntilVisible('#publish-bar .post-settings-menu', function onSuccess() {
test.assert(true, 'post settings menu should be visible after clicking post-settings icon');
});

casper.waitUntilVisible('.post-settings-menu a.delete', function onSuccess() {
casper.waitUntilVisible('.post-settings-menu button.delete', function onSuccess() {
test.assert(true, 'delete post button should be visible for saved drafts');
});

@@ -306,7 +306,7 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {
'#url': 'new-url-editor'
}, false);

this.click('#publish-bar a.post-settings');
this.click('#publish-bar button.post-settings');
});

casper.waitForSelector('.notification-success', function waitForSuccess() {
@@ -323,7 +323,7 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {
});

// Test change pub date
casper.thenClick('#publish-bar a.post-settings');
casper.thenClick('#publish-bar button.post-settings');

casper.waitUntilVisible('#publish-bar .post-settings-menu .post-setting-date', function onSuccess() {
test.assert(true, 'post settings menu should be visible after clicking post-settings icon');
@@ -334,10 +334,10 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {
'.post-setting-date': '10 May 14 @ 00:17'
}, false);

this.click('#publish-bar a.post-settings');
this.click('#publish-bar button.post-settings');
});

casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function testGoodResponse(resource) {
casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function testGoodResponse(resource) {
test.assert(400 > resource.status);
});

@@ -379,7 +379,7 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {


// Test Delete Post Modal
casper.thenClick('.post-settings-menu a.delete');
casper.thenClick('.post-settings-menu button.delete');

casper.waitUntilVisible('#modal-container', function onSuccess() {
test.assert(true, 'delete post modal is visible after clicking delete');
@@ -395,8 +395,8 @@ CasperTest.begin('Post settings menu', 30, function suite(test) {
test.assert(true, 'clicking cancel should close the delete post modal');
});

casper.thenClick('#publish-bar a.post-settings');
casper.thenClick('.post-settings-menu a.delete');
casper.thenClick('#publish-bar button.post-settings');
casper.thenClick('.post-settings-menu button.delete');
casper.waitUntilVisible('#modal-container', function onSuccess() {
casper.thenClick('#modal-container .js-button-accept');
});

0 comments on commit 6451be6

Please sign in to comment.
You can’t perform that action at this time.