(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 && arr.length) { what = a[--L]; while ((ax= arr.indexOf(what)) !== -1) { arr.splice(ax, 1); } } return arr; }; module.exports = Utils; },{}],5:[function(require,module,exports){ if (!Array.prototype.every) { Array.prototype.every = function(callbackfn, thisArg) { 'use strict'; var T, k; if (this == null) { throw new TypeError('this is null or not defined'); } // 1. Let O be the result of calling ToObject passing the this // value as the argument. var O = Object(this); // 2. Let lenValue be the result of calling the Get internal method // of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // 4. If IsCallable(callbackfn) is false, throw a TypeError exception. if (typeof callbackfn !== 'function') { throw new TypeError(); } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. if (arguments.length > 1) { T = thisArg; } // 6. Let k be 0. k = 0; // 7. Repeat, while k < len while (k < len) { var kValue; // a. Let Pk be ToString(k). // This is implicit for LHS operands of the in operator // b. Let kPresent be the result of calling the HasProperty internal // method of O with argument Pk. // This step can be combined with c // c. If kPresent is true, then if (k in O) { // i. Let kValue be the result of calling the Get internal method // of O with argument Pk. kValue = O[k]; // ii. Let testResult be the result of calling the Call internal method // of callbackfn with T as the this value and argument list // containing kValue, k, and O. var testResult = callbackfn.call(T, kValue, k, O); // iii. If ToBoolean(testResult) is false, return false. if (!testResult) { return false; } } k++; } return true; }; } if(!Array.prototype.indexOf) { Array.prototype.indexOf = function(what, i) { i = i || 0; var L = this.length; while (i < L) { if(this[i] === what) return i; ++i; } return -1; }; } },{}],6:[function(require,module,exports){ var u = require('../utils/Utils'); var Breakpoints = function() { this.initialize.apply(this, arguments); }; u.extend(Breakpoints.prototype, { $wrapper: null, lastBreakpoint: 0, allClassNames: '', currClassName: '', initialize: function (options) { this.$wrapper = $(options.wrapper); this.breakpoints = options.breakpoints; this.setupBreakpoints(); this.setWrapperClassName($(window).outerWidth()); this.addListeners(); }, setupBreakpoints: function () { var breakpoints = this.breakpoints; var maxBreakpoint = 0; var allClassNames = ''; var bpoint, prop; for (prop in breakpoints) { bpoint = breakpoints[prop]; if (bpoint.width > maxBreakpoint) { maxBreakpoint = bpoint.width; this.lastBreakpoint = bpoint; } allClassNames += ' '+bpoint.name; } this.allClassNames = allClassNames; }, setWrapperClassName: function (width) { var breakpoints = this.breakpoints; var lastBreakpointWidth = this.lastBreakpoint.width; var bpoint, prop, className = ''; if (width >= lastBreakpointWidth) { className = this.lastBreakpoint.name; } else { // get closest breakpoint for (prop in breakpoints) { bpoint = breakpoints[prop]; if (width <= bpoint.width && bpoint.width < lastBreakpointWidth) { className = bpoint.name; lastBreakpointWidth = bpoint.width; } } } if (className === this.currClassName) return; this.$wrapper.removeClass(this.allClassNames).addClass(className); this.currClassName = className; }, addListeners: function () { // $(window).on('resize', $.proxy(this, 'onResize')); }, onResize: function (event) { var self = this; if (this.timeout) clearTimeout(this.timeout); this.timeout = setTimeout(function () { self.setWrapperClassName($(window).outerWidth()); }, 200); } }); module.exports = Breakpoints; },{"../utils/Utils":4}],7:[function(require,module,exports){ // /////////////////////// // MSFT SKU CHOOSER // Author: Jose.Marchena // /////////////////////// // utils var u = require('../utils/Utils'); var config = require('../config/AppConfig').sku; // tabs contructor var SKUChooser = function () { this.initialize.apply(this, arguments); }; // extend prototype u.extend(SKUChooser.prototype, { // Internal references // /////////////////////////////// // product feature map mapFeatures: {}, // filtered pruduct list filtered: [], // selected features selectedFeatures: [], // selected groups selectedGroups: [], // all interfaz references refs: { mainWrapper: 'breakpoint-wrapper', product: 'sku-product', wrapper: 'sku-wrapper', question: 'sku-step-question', feature: 'sku-feature', skuSelections: 'sku-selections', results: 'sku-results', resultsCta: 'sku-cta-results', clearCta: 'sku-cta-clear', disable: 'wwrcm-disable', active: 'wwrcm-active', highlight: 'wwrcm-highlighted' }, // identifier of autoselect column autoSlectColum: 'task', //smartColumnAttr:'[data-ponder=auto]', // list of groups than need to be selected to show autofeature selection requireGroups: ['users', 'os'], // indicate if a feaure will be autoselected autoSelectFeature: '[data-auto-select]', // maximun length of prioritize products productPriorityLevel: 3, // user device size userDeviceSize: null, // targered viewport targetDevices: { mobile: 'small ', tablet: 'small', desktop: 'large' }, // if result is ready to be shown isResultReady: false, // if result view is active isResultActive: false, // Setup the app // //////////////////////////// // initializer initialize: function (options) { this.$wrapper = options.wrapper; this.userDeviceSize = this.returnDeviceSize(); // click steps this.step = { os: false, task: false }; // index patterns this.patterns = { // 教育機関 'win0_0': [ '1', '1,2', '1,3', '1,4', '1,2,3', '1,2,4', '1,3,4', '1,2,3,4', '2', '2,3', '2,4', '2,3,4', '3', '3,4', '4' ], // 教育機関 : WinのみOfficeProfessionalAcademic2013 'mac0_0': [ '1', '1,2', '1,3', '1,2,3', '2', '2,3', '3' ], // 教育機関 : MacのみOfficeforMacAcademic2011 // 教育機関以外 'win1_0': [ '1', '1,2', '1,3', '1,4', '1,2,3', '1,2,4', '1,3,4', '1,2,3,4', '2', '2,3', '2,4', '2,3,4', '3', '3,4', '4' ], // それ以外 : WinのみOfficeProfessional2013 'win1_1': [ '1', '1,2', '1,3', '1,2,3', '2', '2,3', '3' ], // それ以外 : WinのみOfficeHome&Business2013 'win1_2': [ '1', '1,2', '2' ], // それ以外 : WinのみOfficePersonal2013 'mac1_0': [ '1', '1,2', '1,3', '1,2,3', '2', '2,3', '3' ], // それ以外 : MacのみOfficeforMacHome&Business2011 'mac1_1': [ '1', '1,3', '3' ] // それ以外 : MacのみOfficeforMacHome&Student2011 }; this.os = { dom: $('.wwrcm-col-4.first').find('li'), selected: [], txts: [ 'PC または Mac と
タブレット (iPad、Android) や iPhone', 'Windows のみ', 'Mac のみ' ] }; this.task = { dom: $('.wwrcm-col-4.second').find('li'), selected: [], txts: [ 'Office アプリケーションを
常に最新バージョンで使いたい', 'Word、Excel', 'Outlook (メール / タスク / カレンダー)', 'PowerPoint、OneNote', 'Publisher、Access', 'Office 365 サービス
[マルチデバイス / OneDrive / Skype]' ] }; this.pkg = $('.wwrcm-col-wide-6.top').find('li'); this.task.dom.css({ opacity: 0.25 }).find('a').addClass('disable').css({ cursor: 'default' }); $('.more').find('p').show(); $('.move-wrap').css({ height: $('.wwrcm-sku-inner.init').height()+'px' }); $('.more').find('p').removeAttr('style'); window.onload = function() { $('.more').find('p').show(); $('.move-wrap').css({ height: $('.wwrcm-sku-inner.init').height()+'px' }); $('.more').find('p').removeAttr('style'); }; this.setupEls(); this.setupMap(); this.addListeners(); this.disableFeatures(); }, // setup mapping setupMap: function () { var mapFeatures = {}, product; for (product in config) { mapFeatures[product] = config[product].replace(/\s/g, "").split(','); } this.mapFeatures = mapFeatures; }, // setup widget: dom elements, references setupEls: function () { this.$products = this.$wrapper.find('[data-ref^='+this.refs.product+']'); this.$features = $('.large .wwrcm-office-content .wwrcm-col-wide-6.third .wwrcm-col-4 li a'); this.$skuwrapper = this.$wrapper.find('[data-ref='+this.refs.wrapper+']'); this.$skuQuestion = this.$wrapper.find('[data-ref='+this.refs.question+']'); //this.$skuQuestions = this.$wrapper.find('[data-ref='+this.refs.question+'] li a'); this.$skuSelections = this.$wrapper.find('[data-ref='+this.refs.skuSelections+'] ul'); this.$results = this.$wrapper.find('[data-ref~='+this.refs.results+']'); this.$resultsCta = this.$wrapper.find('[data-ref='+this.refs.resultsCta+']'); this.$clearCta = this.$wrapper.find('[data-ref='+this.refs.clearCta+']'); this.$window = $(window); }, // Miscellaneous // //////////////////////////// // return feature label returnLabel: function(el, label) { // If label is no defined return productLabel var localLabel = label ? this.refs.product : this.refs.feature; return $(el).attr('data-ref').replace(localLabel + "-", ''); }, // return group label returnGroupLabel: function (el) { return el.data().group; }, // return selected features on a group returnSelectFeaturesOnGroup: function (group) { return group.filter(function (i, el) { if($(el).data().selected) return el; }); }, // return list of features of a group returnFeaturesGroup: function (label) { //var groupType = this.returnGroupLabel(el); var $groupItems = this.$wrapper.find('[data-group=' + label + ']'); return $groupItems; }, // return list of disable elements returnDisables: function (label) { var $disableElems = this.$wrapper.find('[data-disable~=' + label + ']'); return $disableElems; }, // return a list of filtered products returnFilteredProducts: function () { var filtered = this.filtered; var $products = $(); for (var i = filtered.length - 1; i >= 0; i--) { $products = $products.add( this.$wrapper.find('[data-ref='+this.refs.product+'-'+filtered[i]+']') ); } return $products; }, // return the filtered product with the highest priority returnPriorityProduct: function () { var $productToShow = $(); var $productList = this.returnFilteredProducts(); $productList.each(function (i, el) { var $elem = $(el); var priority = $elem.data('priority'); if($productToShow.length === 0) { $productToShow = $elem; } else { var prevPriority = $productToShow.data('priority'); if(priority === prevPriority) { $productToShow.push(el); } if(priority < prevPriority) { $productToShow = $elem; } } }); return $productToShow; }, // return a boolean if there is any feature active on group isFeatureGroupActive: function (group) { var activeGroup = this.returnSelectFeaturesOnGroup(group); return (activeGroup.length > 0); }, // return if the required feature groups are fullfiled isAutoFeaturesReadyToShow: function () { var selectedGroups = this.selectedGroups; return this.requireGroups.every(function (value) { return $.inArray(value, selectedGroups) > -1; }); }, // Functionality // //////////////////////////// // filter product filterProduct: function () { var map = this.mapFeatures, selectedFeatures = this.selectedFeatures, product; this.filtered = []; for (product in map) { var filter = selectedFeatures.every(function (value) { return $.inArray(value, map[product]) < 0; }); if (filter) { this.filtered.push(product); } } }, // add feature to selectFeatures array addFeature: function (feature) { var selectedFeatures = this.selectedFeatures; if ($.inArray(feature, selectedFeatures) === -1) { this.selectedFeatures.push(feature); } this.filterProduct(); }, // unfilter feature from selectFeatures array removeFeature: function (feature) { u.removeFromArray(this.selectedFeatures, feature); this.filterProduct(); }, // clean all active features cleanFeatures: function () { var features = this.$features; var featuresClass = this.refs.active + ' ' + this.refs.disable; for (var i = features.length - 1; i >= 0; i--) { $(features[i]).removeClass(featuresClass).removeData('selected disable'); } }, // Update disable features updateDisableFeatures: function (feature) { var featureLabel = this.returnLabel(feature); var groupLabel = this.returnGroupLabel(feature); var $feature = $(feature); var $disableElems = this.returnDisables(featureLabel); var $featuresGroup = this.returnFeaturesGroup(groupLabel); var $selectedFeaturesOnGroup = this.returnSelectFeaturesOnGroup($featuresGroup); if ( this.isFeatureGroupActive($featuresGroup) || $feature.data().selected) { for (var i = $selectedFeaturesOnGroup.length - 1; i >= 0; i--) { var prevFeatureLabel = this.returnLabel($selectedFeaturesOnGroup[i]); var $prevDisableFeatures = this.returnDisables(prevFeatureLabel); $prevDisableFeatures.removeClass(this.refs.disable); } } if(!$feature.data().selected && $disableElems.length > 0) { var self = this; $disableElems.each(function (i, el) { var $currEl = $(el); var currLabel = self.returnLabel(el); if($currEl.data().selected) { self.updateSelectedGroup($currEl); self.cleanAutoFeatures(self.autoSlectColum); $currEl.removeClass(self.refs.active).data('selected', false); } $currEl.addClass(self.refs.disable); self.removeFeature(currLabel); }); } }, // update the list of selected groups updateSelectedGroup: function (feature) { var featureLabel = this.returnLabel(feature); var groupLabel = this.returnGroupLabel(feature); var isGroupActive = $.inArray(groupLabel, this.selectedGroups) >= 0; if(isGroupActive) { var $groupItems = this.returnFeaturesGroup(groupLabel); var $activeFeatures = this.returnSelectFeaturesOnGroup($groupItems); var isSameFeature = this.returnLabel($activeFeatures[0]) === featureLabel; if(isSameFeature) { u.removeFromArray(this.selectedGroups, groupLabel); } } else { this.selectedGroups.push(groupLabel); } }, // clean preview features selected cleanFeatureGroup: function (groupLabel) { var $featuresGroup = this.returnFeaturesGroup(groupLabel); var $selectedFeaturesOnGroup = this.returnSelectFeaturesOnGroup($featuresGroup); if (this.isFeatureGroupActive($featuresGroup)) { for (var i = $selectedFeaturesOnGroup.length - 1; i >= 0; i--) { var currActiveFeature = $selectedFeaturesOnGroup[i]; var currActiveFeatureLabel = this.returnLabel(currActiveFeature); this.removeFeature(currActiveFeatureLabel); this.removeFeatureReference(currActiveFeatureLabel); $(currActiveFeature).removeClass(this.refs.active).data('selected', false); } } }, // Check if ready to show results checkProductStatus: function () { var filterCount = (this.filtered.length === 1) ? true : false; var productCount = (this.filtered.length <= this.productPriorityLevel) ? true : false; var isPriorityDifferent = this.returnPriorityProduct().length === 1; this.isResultReady = (filterCount || (productCount && isPriorityDifferent)) ? true : false; }, // select features automatically selectAutoFeatures: function (groupLabel) { var $groupFeatures = this.returnFeaturesGroup(groupLabel); var $filteredProduct = this.returnPriorityProduct(); var productLabel = this.returnLabel($filteredProduct, true); var productFeatures = this.mapFeatures[productLabel]; for (var i = $groupFeatures.length - 1; i >= 0; i--) { var currFeature = $groupFeatures[i]; var currFeatureLabel = this.returnLabel(currFeature); var isAlwaysActive = $(currFeature).is('[data-active=always]'); var isFeatureOnProductFeatures = isAlwaysActive || $.inArray(currFeatureLabel, productFeatures) === -1; var classFn = isFeatureOnProductFeatures ? 'addClass' : 'removeClass'; var filterFn = isFeatureOnProductFeatures ? 'addFeature' : 'removeFeature'; var $featureToSelect = $('[data-ref='+this.refs.feature+'-'+currFeatureLabel+ ']'); $featureToSelect[ classFn ](this.refs.active); this[ filterFn ](currFeatureLabel); $featureToSelect.data('selected', isFeatureOnProductFeatures); } this.selectedGroups.push(groupLabel); }, // clean autoselect features cleanAutoFeatures: function (groupLabel) { this.cleanFeatureGroup(groupLabel); u.removeFromArray(this.selectedGroups, groupLabel); }, autoFeatureToggle: function (feature) { var isAutoGroupActive = $.inArray(this.autoSlectColum, this.selectedGroups) !== -1; var isFeatureOnAutoGroup = this.returnGroupLabel(feature) === this.autoSlectColum; if(isFeatureOnAutoGroup) return; if(isAutoGroupActive) { this.cleanAutoFeatures(this.autoSlectColum); this.autoFeatureToggle(feature); } else { if (this.isAutoFeaturesReadyToShow()){ this.selectAutoFeatures(this.autoSlectColum); } } }, // Responsive Interface // //////////////////////////// // return user's device returnDevice: function (device) { var reClass = new RegExp(device); return reClass.test(this.userDeviceSize); }, // check device size returnDeviceSize: function () { var mainContainer = $('[data-ref=' + this.refs.mainWrapper + ']'); var screenSize = mainContainer.attr('class'); return screenSize; }, // adjust the sku if the screen is resized doneResizing: function () { var currSize = this.returnDeviceSize(); if(this.userDeviceSize !== currSize) { this.$skuwrapper.data('selected', true); this.userDeviceSize = currSize; if(this.isResultReady) { this.showResults(); } } }, // slide results if the screen is smaller than the chooser updateTabletView: function () { var screenSizeTablet = this.returnDevice(this.targetDevices.tablet); var isActive = this.$skuwrapper.data().selected; if (screenSizeTablet) { if (!isActive) { this.$skuwrapper.animate({left: '-100%'}).data('selected', true); } else { this.$skuwrapper.animate({left: '0%'}).data('selected', false); } } }, // execute mobile only functionality updatePhoneView: function () { var isDeviceMobile = this.returnDevice(this.targetDevices.mobile); var distance = 0; var selected = false; if(!isDeviceMobile) return; if(this.isAutoFeaturesReadyToShow()) { distance = '-53%'; selected = true; } this.$skuQuestion.delay(0) .animate({left: distance}) .data('selected', selected); }, // clean mobile selections cleanPhoneView: function () { // intented to be used for more stuffs this.updatePhoneView(); }, // Interface // //////////////////////////// // Add data to disable elements disableFeatures: function () { this.$features.filter('.'+this.refs.disable).data('selected', false); }, // update chooser product id updateProductReference: function () { var filterList = this.returnPriorityProduct(); var prefix = this.refs.product + '-'; var regEx = new RegExp('\\b'+prefix+'\\S+', 'g'); this.$wrapper.removeClass(function (index, css) { return (css.match (regEx) || []).join(' '); }); if(this.isResultReady) { this.$wrapper.addClass(prefix + this.returnLabel(filterList, true)); } }, removeFeatureReference: function (label) { this.$wrapper.removeClass(this.refs.feature + '-' + label); }, addFeatureReference: function (label) { this.$wrapper.addClass(this.refs.feature + '-' + label); }, addRecommendResults: function () { var featureList = ''; this.$features.filter('.'+this.refs.active).each(function () { // console.log($(this).text()); featureList += '
  • ' + $(this).text() + '
  • '; }); this.$skuSelections.html(featureList); }, // show filtered products showFilteredProducts: function () { var $productsList = this.returnFilteredProducts(); var $product = this.returnPriorityProduct(); this.$products.addClass(this.refs.disable).removeClass(this.refs.highlight); $productsList.removeClass(this.refs.disable); if($product.length === 1) { $product.addClass(this.refs.highlight); } this.showResultCta(); }, // show result button showResultCta: function (stauts) { this.checkProductStatus(); this.$resultsCta[ this.isResultReady ? 'addClass' : 'removeClass' ](this.refs.active); this.updateProductReference(); }, // show the result view showResults: function () { var $filteredProduct = this.returnPriorityProduct(); var filteredProductLabel = this.returnLabel($filteredProduct, true); var $productList = this.$results.find('[data-ref^=sku-result]'); var $product = this.$results.find('[data-ref=sku-result-' + filteredProductLabel + ']'); //var selectionList = ''; this.isResultActive = true; $productList.removeClass(this.refs.active); $product.addClass(this.refs.active); this.$results.addClass(this.refs.active); //this.$skuSelections.html(''); // this.$skuQuestions.each(function() { // if($(this).parent().hasClass('wwrcm-active')) { // selectionList = selectionList + '
  • ' + $(this).text() + '
  • '; // } // }); //this.$skuSelections.html(selectionList); this.addRecommendResults(); this.updateTabletView(); }, // clean the result view cleanResults: function () { var $productList = this.$results.find('[data-ref^=sku-result]'); $productList.removeClass(this.refs.active); this.$results.removeClass(this.refs.active); this.updateTabletView(); }, // clean all views & selections resetChooser: function () { this.filtered = []; this.selectedFeatures = []; this.selectedGroups = []; this.cleanPhoneView(); this.cleanResults(); this.cleanFeatures(); this.filterProduct(); this.showFilteredProducts(); this.isResultActive = false; }, // Event Listeners // //////////////////////////// // add events addListeners: function () { this.$features.on({ 'click': $.proxy(this.onFeatureSelect, this), 'mouseenter mouseleave': $.proxy(this.onListHover, this) }); $('.more').on({ 'mouseenter mouseleave': $.proxy(this.onTextHover, this), 'click': $.proxy(this.onMore, this) }); $('.back').on({ 'mouseenter mouseleave': $.proxy(this.onTextHover, this), 'click': $.proxy(this.onBack, this) }); }, // 条件 ホバーアクション onListHover: function(e) { var _this = $(e.currentTarget); if(_this.hasClass('selected')) return false; if(_this.hasClass('disable')) return false; if(e.type === 'mouseenter') { _this.parent().stop(true, true).animate({ backgroundColor: '#555' }, 300); } else { _this.parent().stop(true, true).animate({ backgroundColor: '#666' }, 300); } }, onTextHover: function(e) { var _this = $(e.currentTarget); }, // 条件 クリック onFeatureSelect: function(e) { var _this = $(e.currentTarget), index = -1, i = 0, l = 0, group = _this.data().group, rec = $('.wwrcm-col-wide-6.top').find('li').eq(0), mac_only = [ this.pkg.eq(4)[0], this.pkg.eq(5)[0] ], win_only = [ this.pkg.eq(1)[0], this.pkg.eq(2)[0], this.pkg.eq(3)[0] ]; // 無効化されてるボタン無視 if(_this.hasClass('disable')) return false; // 利用デバイス if(group === 'os') { var not = []; index = this.os.dom.index(_this.parent()); this.os.dom.each(function(i, val) { if(index !== i) not.push(val); }); $(not).find('a').removeClass('selected') .parent().stop(true, true).animate({ backgroundColor: '#666' }, 300); this.os.selected = []; this.os.selected.push( index ); this.step.os = true; rec.find('.rec_bg').stop(true, true).animate({ opacity: 0 }, 300); this.task.dom .find('a').removeClass('selected disable').css({ cursor: '' }) .parent().stop(true, true).animate({ backgroundColor: '#666', opacity: 1 }, 300); this.task.selected = []; if(_this.hasClass('selected')) { this.task.dom .find('a').addClass('disable').css({ cursor: 'default' }) .parent().stop(true, true).animate({ backgroundColor: '#666', opacity: 0.25 }, 300); } this.pkg.find('.inr').stop().animate({ opacity: 1 }, 300); // win&mac if(index === 0) { $(mac_only).find('.inr').stop().animate({ opacity: 0.25 }, 300); $(win_only).find('.inr').stop().animate({ opacity: 0.25 }, 300); // windowsのみ } else if(index === 1) { $(mac_only).find('.inr').stop().animate({ opacity: 0.25 }, 300); $(win_only).find('.inr').stop().animate({ opacity: 1 }, 300); // macのみ } else if(index === 2) { $(mac_only).find('.inr').stop().animate({ opacity: 1 }, 300); $(win_only).find('.inr').stop().animate({ opacity: 0.25 }, 300); this.task.dom.eq(4) .find('a').addClass('disable').css({ cursor: 'default' }) .parent().stop().css({ backgroundColor: '#666', opacity: 0.25 }); } if(_this.hasClass('selected')) { this.pkg.find('.inr').stop().animate({ opacity: 1 }, 300); } $('.more').find('p').animate({ opacity: 0 }, 300, function() { $(this).hide(); }); } // 必要なアプリケーション if(group === 'task') { if(!this.step.os) return false; index = this.task.dom.index(_this.parent()); if(_this.hasClass('selected')) { for(i = 0, l = this.task.selected.length; i < l; i++) { if(this.task.selected[i] === index) { this.task.selected.splice(i, 1); } } } else { this.task.selected.push( index ); } // 昇順に並び替え this.task.selected.sort( function(a,b){ if( a < b ) return -1; if( a > b ) return 1; return 0; } ); if(parseInt( rec.find('.rec_bg').css('opacity') ) !== 1) { rec.find('.rec_bg').stop(true, true).css({ display: 'block', opacity: 0 }).animate({ opacity: 1 }, 300); } this.pkg.each(function(i, val) { if(i !== 0) $(val).find('.inr').stop().animate({ opacity: 0.25 }, 300); }); var f = this.task.selected.toString(); if(this.os.selected[0] === 1) { // Office Professional 2013 アクティブ化 if(this.patternSearch(f, this.patterns.win1_0)) this.pkg.eq(1).find('.inr').stop().animate({ opacity: 1 }, 300); // Office Home & Business 2013 アクティブ化 if(this.patternSearch(f, this.patterns.win1_1)) this.pkg.eq(2).find('.inr').stop().animate({ opacity: 1 }, 300); // Office Personal 2013 アクティブ化 if(this.patternSearch(f, this.patterns.win1_2)) this.pkg.eq(3).find('.inr').stop().animate({ opacity: 1 }, 300); } else if(this.os.selected[0] === 2) { // Office for Mac Home & Business 2011 アクティブ化 if(this.patternSearch(f, this.patterns.mac1_0)) this.pkg.eq(4).find('.inr').stop().animate({ opacity: 1 }, 300); // Office for Mac Home & Student 2011 アクティブ化 if(this.patternSearch(f, this.patterns.mac1_1)) this.pkg.eq(5).find('.inr').stop().animate({ opacity: 1 }, 300); } if(!_this.hasClass('selected')) { if(parseInt( $('.more').find('p').css('opacity') ) !== 1) { $('.more').find('p').stop(true, true).css({ opacity: 0, display: 'block' }).animate({ opacity: 1 }, 300); } } if(this.task.selected.length === 0) { $('.wwrcm-col-wide-6.top').find('li').eq(0).find('.rec_bg').stop(true, true).animate({ opacity: 0 }, 300); this.pkg.find('.inr').stop().animate({ opacity: 1 }, 300); // winのみ if(this.os.selected[0] === 1) { $(mac_only).find('.inr').stop().css({ opacity: 0.25 }); // macのみ } else if(this.os.selected[0] === 2) { $(win_only).find('.inr').stop().css({ opacity: 0.25 }); } $('.more').find('p').animate({ opacity: 0 }, 300, function() { $(this).hide(); }); } this.step.task = true; } _this.toggleClass('selected'); _this.parent().stop(true, true) .animate({ backgroundColor: _this.hasClass('selected') ? '#dc3c00' : '#666' }, 300); return false; }, patternSearch: function(filter, pattern) { var i = 0, l = 0; for(i = 0, l = pattern.length; i < l; i++) { if(filter === pattern[i]) return true; } return false; }, onMore: function() { var sel = this.addUserSelected(); $('.result').find('.right-inr').find('ul').html( sel ); $('.move-wrap').stop(true, true).animate({ left: '-940px', height: $('.result').height()+'px' }, 500); // $('html, body').stop(true, true).animate({ scrollTop: $('.wwrcm-office-content').offset().top }, 500); }, addUserSelected: function() { var result = [], os = '', task = '', i = 0, l = 0; os = '
  • ' + this.os.txts[ this.os.selected[0] ] + '
  • '; for(i = 0, l = this.task.selected.length; i < l; i++) { task += '
  • ' + this.task.txts[ this.task.selected[i] ] + '
  • '; } result += os + task; return result; }, onBack: function() { $('.move-wrap').stop(true, true).animate({ left: 0, height: $('.wwrcm-sku-inner.init').height()+'px' }, 500); this.os.selected = []; this.task.selected = []; this.step = { os: false, task: false }; $('.wwrcm-col-wide-6.top').find('li').eq(0).find('.rec_bg').stop(true, true).animate({ opacity: 0 }, 300); this.pkg.find('.inr').stop().animate({ opacity: 1 }, 300); $('.more').find('p').animate({ opacity: 0 }, 300, function() { $(this).hide(); }); this.$features.removeClass('selected').parent().stop(true, true).animate({ backgroundColor: '#666' }, 300); this.task.dom.animate({ opacity: 0.25 }, 300).find('a').addClass('disable').css({ cursor: 'default' }); } }); module.exports = SKUChooser; },{"../config/AppConfig":2,"../utils/Utils":4}]},{},[3]);