Пропустить теорию и перейти прямо к задачам
Ссылка на учебник: http://learn.javascript.ru
Сразу расскажу про несколько особенностей яваскрипта, о которых может быть не написано (или мало написано) в учебниках, но которые стоит понимать:
<?php | |
/* define package */ | |
define('PKG_NAME','LexiconMini'); | |
define('PKG_NAME_LOWER',strtolower(PKG_NAME)); | |
define('PKG_VERSION','0.0.1'); | |
define('PKG_RELEASE','beta1'); | |
/* define paths */ |
.col-ms-1, | |
.col-ms-2, | |
.col-ms-3, | |
.col-ms-4, | |
.col-ms-5, | |
.col-ms-6, | |
.col-ms-7, | |
.col-ms-8, | |
.col-ms-9, | |
.col-ms-10, |
<?php | |
$pdo = $modx->getService('pdoTools'); | |
$fieldName = $modx->getOption('fieldName', $scriptProperties, 'vendor'); | |
$fieldClass = $modx->getOption('fieldClass', $scriptProperties, ''); | |
$firstOption = $modx->getOption('firstOption', $scriptProperties, ''); | |
$parent = $modx->getOption('parent', $scriptProperties, 0); | |
$depth = $modx->getOption('depth', $scriptProperties, 10); | |
$limit = $modx->getOption('limit', $scriptProperties, 100); | |
$tplOuter = $modx->getOption('tplOuter', $scriptProperties, '@INLINE <select name="[[+name]]" class="[[+class]]">[[+rows]]</select>'); |
.col-ms-1, | |
.col-ms-2, | |
.col-ms-3, | |
.col-ms-4, | |
.col-ms-5, | |
.col-ms-6, | |
.col-ms-7, | |
.col-ms-8, | |
.col-ms-9, | |
.col-ms-10, |
Пропустить теорию и перейти прямо к задачам
Ссылка на учебник: http://learn.javascript.ru
Сразу расскажу про несколько особенностей яваскрипта, о которых может быть не написано (или мало написано) в учебниках, но которые стоит понимать:
<?php | |
class msOrder extends xPDOSimpleObject | |
{ | |
public function updateProducts() | |
{ | |
$originalContext = $this->xpdo->context->get('key'); | |
$this->xpdo->switchContext($this->get('context')); | |
$originalMiniShop = isset($this->xpdo->services['minishop2']) ? $this->xpdo->services['minishop2'] : null; | |
$cart = array(); | |
foreach ($this->getMany('Products') as $product) { |
/** | |
* Custom Bootstrap 3 grid for 480-767px layout | |
* Author: Iftakhar Hasan | |
* | |
* A new set of column classes (with class prefix .col-ms- ) for Bootstrap 3 | |
* to make Medium Small grids for supporting 480-767px | |
* | |
* This will push the default Bootstrap 3 Extra Small column (class prefix .col-xs- ) | |
* to support 1-479px instead of 1-767px | |
*/ |
/* | |
* Replace all SVG images with inline SVG | |
*/ | |
jQuery('img.svg').each(function(){ | |
var $img = jQuery(this); | |
var imgID = $img.attr('id'); | |
var imgClass = $img.attr('class'); | |
var imgURL = $img.attr('src'); | |
jQuery.get(imgURL, function(data) { |
&where=`{ "template:IN" : [ 1,2,3 ] } | |
&where=`{ "template:NOT IN" : [ 1,2,3 ] } | |
&where=`[{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}]` |
<script> | |
miniShop2.Order.deliveryCost = '#ms2_delivery_cost'; | |
miniShop2.Callbacks.Order.getcost.response.success = function(response) { | |
var rdc = response.data['delivery_cost']; | |
if(rdc) $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text(miniShop2.Utils.formatPrice(rdc)); | |
else $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text('0'); | |
} |