Skip to content

Commit

Permalink
Updating docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
al6x committed Nov 16, 2015
1 parent e312901 commit eed4878
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 16 deletions.
13 changes: 9 additions & 4 deletions documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
<div class="navigation">
<div class="navigation-inner">
<div class="navigation-left">
<a href="ru.html">RU</a>
<p class="selected">EN</p>
&nbsp;
&nbsp;
<a href="#docs">Documentation</a>
<a href="https://github.com/alexeypetrushin/salejs" target="_blank">Source</a>
<a href="mailto:alexey.petrushin@gmail.com" target="_blank">Contact me</a>
</div>
<div class="navigation-right">
<a href="#" class="navigation-button cart-button" style="display: none;">
Expand Down Expand Up @@ -44,7 +49,7 @@
<!-- Documentation. -->
<div class="section">
<div class="section-inner">
<div class="alert">
<!-- <div class="alert">
<table width="100%">
<tr>
<td width="45%" valign="top">
Expand All @@ -61,9 +66,9 @@
</td>
</tr>
</table>
</div>
</div> -->

<p id="docs">1. Include sale.js in HTML page and configure it.</p>
<p id="docs">1. Include sale.js in HTML page and configure it</p>
<pre><code class="prettyprint">
&lt;script src="http://salejs.com/v1/cart.js"&gt;&lt;/script&gt;
&lt;script&gt;
Expand Down Expand Up @@ -116,7 +121,7 @@
&lt;/style&gt;
</code></pre>

<p>Also, use this page as example<p>
<p>Also, use this page as example - click "Buy"<p>

</div>
</div>
Expand Down
169 changes: 169 additions & 0 deletions documentation/ru.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>salejs</title>
<link rel="stylesheet" type="text/css" media="all" href="/styles/style.css">
</head>
<body>
<div class="navigation">
<div class="navigation-inner">
<div class="navigation-left">
<p class="selected">RU</p>
<a href="/">EN</a>
&nbsp;
&nbsp;
<a href="#docs">Документация</a>
<a href="https://github.com/alexeypetrushin/salejs" target="_blank">Исходники</a>
<a href="mailto:alexey.petrushin@gmail.com" target="_blank">Обратная связь</a>
</div>
<div class="navigation-right">
<a href="#" class="navigation-button cart-button" style="display: none;">
<span class="cart-button-quantity">0</span>
<span class="cart-button-label">товаров</span>
</a>
</div>
</div>
</div>

<!-- Header with demo. -->
<div class="section darken">
<div class="section-inner">
<div class="products">
<div class="product">
<div class="product-image">
<img src="/images/iphone.png">
</div>
<a href="#" class="button cart-buy-button" data-name="iPhone" data-price="999" data-quantity="1">Купить 34 000 руб.</a>
</div>
<div class="product">
<img src="/images/nexus.png">
<a href="#" class="button cart-buy-button" data-name="Nexus" data-price="450" data-quantity="1">Купить 18 000 руб.</a>
</div>
</div>
<div class="products-description">
Виджет Корзины<br/>
превращает любой<br/>
Сайт в Магазин
</div>
</div>
</div>

<!-- Documentation. -->
<div class="section">
<div class="section-inner">
<!-- <div class="alert">
<table width="100%">
<tr>
<td width="45%" valign="top">
<b>Внимание:</b> у меня через месяц будет пару свободных дней, напишите ваши пожелания -
какой функционал вам нужен, я его постараюсь добавить. По возможности
проиллюстрируйте примерами чтобы было понятно что требуется сделать.
Почта для связи alexey.petrushin at gmail.com
</td>
<td width="10%">&nbsp;</td>
<td valign="top">
<b>Attention:</b> I'll have couple of a free days soon, if you'd like some
feature to be added please let me know about it, what do you need? My contacts
alexey.petrushin at gmail.com
</td>
</tr>
</table>
</div> -->

<p id="docs">1. Добавьте sale.js в HTML страницы и проставьте нужные опции</p>
<pre><code class="prettyprint">
&lt;script src="http://salejs.com/v1/cart.js"&gt;&lt;/script&gt;
&lt;script&gt;
cartjs.initialize({
emailOrdersTo : 'your-shop@mail.com',
language : 'russian', // Также доступны 'english' и 'ukrainian'.
currency : 'руб.',

// Дополнительные опции, можно их не указывать.
requireName : true, // Спрашивать имя покупателя.
requirePhone : true, // Спрашивать телефон покупателя.
requireEmail : false, // Спрашивать почту покупателя.
requireAddress : false, // Спрашивать адрес покупателя.
})
&lt;/script&gt;
</code></pre>

<p>2. Добавьте кнопку Корзины на ваш сайт</p>
<pre><code class="prettyprint">
&lt;a href="#" class="cart-button" style="display: none;"&gt;
&lt;span class="cart-button-quantity"&gt;&lt;/span&gt;
&lt;span class="cart-button-label"&gt;&lt;/span&gt;
&lt;!-- Опционально, вместо span элементов можно поместить сюда картинку для кнопки. --&gt;
&lt;/a&gt;
</code></pre>

<p>3. Добавьте кнопку "Купить" для продуктов</p>
<pre><code class="prettyprint">
&lt;a href="#" class="cart-buy-button"
data-name="Nexus"
data-price="450"
data-quantity="1"
&gt;Buy $450&lt;/a&gt;
</code></pre>

<p>или, опционально это можно сделать JavaScript'ом:</p>
<pre><code class="prettyprint">
cartjs.add({
name : "Nexus",
price : 450,
quantity : 1
})
</code></pre>

<p>4. Можно поменять положение всплывающего окна корзины</p>
<pre><code class="prettyprint">
&lt;style&gt;
.bootstrap-widget .popover {margin-left: -10px !important;}
.bootstrap-widget .popover .arrow {margin-left: 10px !important;}
&lt;/style&gt;
</code></pre>

<p>И, используйте эту страницу как пример - нажмите "купить"<p>

</div>
</div>

<div class="footer">
<div class="footer-inner">
<div class="footer-left">
<a href="http://jslang.info/projects/salejs">Как это работает</a>
</div>
<div class="footer-right">
Сделано <a href="http://alex-craft.com">Alex Craft</a>
</div>
</div>
</div>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-54125691-5', 'auto');
ga('send', 'pageview');
</script>

<script src="http://salejs.com/v1/cart.js"></script>
<style>
.bootstrap-widget .popover {margin-left: -88px !important;}
.bootstrap-widget .popover .arrow {margin-left: 77px !important;}
</style>
<script>
cartjs.initialize({
emailOrdersTo : 'dummy@mail.com',
language : 'russian',
currency : 'руб.'
})
</script>

<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
</body>
</html>
29 changes: 18 additions & 11 deletions documentation/styles/style.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import url('http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400italic,400,600italic,600,700italic,700,800italic,800&subset=latin,cyrillic,cyrillic-ext');
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@import url('http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400italic,400,600italic,600,700italic,700,800italic,800&subset=latin,cyrillic,cyrillic-ext');
article,
aside,
details,
Expand Down Expand Up @@ -394,6 +394,14 @@ body {
margin-top: 0;
margin-bottom: 0;
}
.navigation .selected {
background: #545454;
padding-left: 12px;
padding-right: 12px;
margin-left: 5px;
margin-right: 5px;
color: white;
}
.navigation .navigation-button {
color: #fff;
background-color: #545454;
Expand Down Expand Up @@ -539,6 +547,15 @@ body {
.section .section-image-text-small a {
color: gray;
}
.alert {
font-size: 16px;
color: #8a6d3b;
background-color: #fcf8e3;
border: 2px solid #8a6d3b;
padding: 15px;
margin-bottom: 20px;
border-radius: 8px;
}
.button {
text-decoration: none;
color: inherit;
Expand Down Expand Up @@ -591,13 +608,3 @@ pre * {
font-size: 16px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace !important;
}

.alert {
font-size: 16px;
color: #8a6d3b;
background-color: #fcf8e3;
border: 2px solid #8a6d3b;
padding: 15px;
margin-bottom: 20px;
border-radius: 8px;
}
15 changes: 14 additions & 1 deletion documentation/styles/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ body{font-family: "Open Sans",Helvetica,Arial,sans-serif; font-size: 16px;}
.navigation{background-color: #fff; border-bottom: 1px solid @light-gray;
a{.no-link();}
p{display: inline-block; margin-top: 0; margin-bottom: 0;}
.selected {background: @dark-gray; padding-left: 12px; padding-right: 12px;
margin-left: 5px; margin-right: 5px; color: white; }
font-size: 14px;
line-height: 40px;
.navigation-button{color: #fff; background-color: @dark-gray;
Expand Down Expand Up @@ -72,6 +74,17 @@ body{font-family: "Open Sans",Helvetica,Arial,sans-serif; font-size: 16px;}
font-size: 16px;
a{color: gray;}}}

// Alert.
.alert {
font-size: 16px;
color: #8a6d3b;
background-color: #fcf8e3;
border: 2px solid #8a6d3b;
padding: 15px;
margin-bottom: 20px;
border-radius: 8px;
}

// Button.
.button{.no-link(); color: #fff; background-color: @dark-gray;
border-radius: 3px; padding: 2px 12px; white-space: nowrap;}
Expand All @@ -89,4 +102,4 @@ body{font-family: "Open Sans",Helvetica,Arial,sans-serif; font-size: 16px;}
pre{font-size: 16px; margin-top: -24px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace !important;
*{font-size: 16px;
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace !important;}}
font-family: Monaco, Menlo, Consolas, 'Courier New', monospace !important;}}

0 comments on commit eed4878

Please sign in to comment.