\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n
\n
\n Something weird happened, please try again\n
\n
\n\n \n \n \n "); $('#' + this.config.blockId).append(html); MicroModal.init({ onShow: function onShow(modal) { $('html').css('overflow', 'hidden'); }, onClose: function onClose(modal) { $('html').css('overflow', 'auto'); }, openTrigger: 'data-custom-open', closeTrigger: 'data-custom-close', openClass: 'is-open', disableScroll: true, disableFocus: false, awaitOpenAnimation: false, awaitCloseAnimation: false, debugMode: true }); } }, { key: "__createInputElement", value: function __createInputElement(field) { var fieldValue = field.value; if (field.type === 'percent' && field.value) { fieldValue = Number(Number(("" + field.value).replace(/,/g, '.')) * 100).toFixed(2); } var fieldHtmlType = 'text'; switch (field.type) { case 'email': fieldHtmlType = 'email'; break; case 'number': case 'currency': case 'percent': fieldHtmlType = 'number'; break; } if (fieldHtmlType === 'text') { fieldValue = field.value.replaceAll('\"', '\"'); } return "\n
\n
\n ".concat(field.name, "\n
\n\n
\n
\n "); } }, { key: "__createTextAreaElement", value: function __createTextAreaElement(field) { return "\n
\n
\n ".concat(field.name, "\n
\n\n
").concat(field.value || '', "
\n
\n "); } }, { key: "__createRichTexAreaElement", value: function __createRichTexAreaElement(field) { return "\n
\n
\n ".concat(field.name, "\n
\n
\n
\n "); } }, { key: "__createCheckboxElement", value: function __createCheckboxElement(field) { var checkedStr = ''; if (field.value) { checkedStr = ' checked '; } return "\n
\n
\n
\n
\n
\n
\n ").concat(field.name, "\n
\n
\n
\n "); } }, { key: "__createSingleSelectElement", value: function __createSingleSelectElement(field) { var optionsStr = ''; if (field.options && field.options.choices && field.options.choices.length) { field.options.choices.forEach(function (option) { if (option.name.trim()) { optionsStr += "
").concat(option.name, "
"); } }); } return "\n
\n
\n ".concat(field.name, "\n
\n
\n
\n ").concat(optionsStr, "\n
\n
\n "); } }, { key: "__createMultiSelectElement", value: function __createMultiSelectElement(field) { var optionsStr = ''; if (field.options && field.options.choices && field.options.choices.length) { field.options.choices.forEach(function (option) { if (option.name.trim()) { optionsStr += "
").concat(option.name, "
"); } }); } return "\n
\n
\n ".concat(field.name, "\n
\n
4\">\n ").concat(optionsStr, "\n
\n
\n "); } }, { key: "__createDateElement", value: function __createDateElement(field) { return "\n
\n
\n ".concat(field.name, "\n
\n
\n
\n "); } }, { key: "__createDateTimeElement", value: function __createDateTimeElement(field) { var optionsStr = ''; var times = this.__generateTimeIntervalArray(1); times.forEach(function (option) { optionsStr += "
").concat(option, "
"); }); return "\n
\n
".concat(field.name, "
\n
\n
\n
\n
\n ").concat(optionsStr, "\n
\n
\n
\n "); } }, { key: "__createFileUploadElement", value: function __createFileUploadElement(field) { return "\n
\n
\n ").concat(field.name, "\n
\n
\n
\n
\n UPLOAD FILE\n
\n
\n
\n
\n
\n "); } }, { key: "__createRecordLinkElement", value: function __createRecordLinkElement(field) { return "\n
\n
\n ").concat(field.name, "\n
\n
\n
\n "); } /* Editing Logic */ /* Can edit specific record */ }, { key: "__canEditAirtableRecord", value: function __canEditAirtableRecord(user, blockMetaData, record) { var _this3 = this; if (!record) { return false; } /* Check if records can be edited for given user */ if (!this.__canEditAirtableRecords(user, blockMetaData)) { return false; } /* Check if this specific record can be edited for given user */ var userGroupEditRuleTablePermissions = this.__extractUserGroupEditRuleTablePermissions(user, blockMetaData, record); var tablePermissions = userGroupEditRuleTablePermissions.loggedInUserGroupEditRuleTablePermissions; tablePermissions.push.apply(tablePermissions, _toConsumableArray(userGroupEditRuleTablePermissions.customUserGroupEditRuleTablePermissions)); /* If no permissions for the records table then exit */ if (!tablePermissions || !tablePermissions.length) { return false; } var canEditCurrentRecord = false; tablePermissions.forEach(function (permission) { var logicalOperator = permission.condition.logicalOperator; var expressions = permission.condition.expressions; /* If empty condition then all entries are editable */ if (!canEditCurrentRecord && expressions.length === 0) { canEditCurrentRecord = true; } if (logicalOperator === 'OR') { var result = expressions.some(function (expression) { var expressionValue = expression.value; if (expression.value.length && expression.value[0].includes('USER:::')) { expressionValue = _this3.__extractUserPropertyValue(user, expressionValue[0]); } var subjectValue = record.fields[expression.subject.field]; return _this3.__evaluateExpression(expression.operator, subjectValue, expressionValue); }); if (!canEditCurrentRecord && result) { canEditCurrentRecord = true; } } else if (logicalOperator === 'AND') { var _result = expressions.every(function (expression) { var expressionValue = expression.value; if (expression.value.length && expression.value[0].includes('USER:::')) { expressionValue = _this3.__extractUserPropertyValue(user, expressionValue[0]); } var subjectValue = record.fields[expression.subject.field]; return _this3.__evaluateExpression(expression.operator, subjectValue, expressionValue); }); if (!canEditCurrentRecord && _result) { canEditCurrentRecord = true; } } }); return canEditCurrentRecord; } }, { key: "__extractEditableFields", value: function __extractEditableFields(user, blockMetaData, record) { /* All table permissions that user is associated via their groups */ var userGroupEditRuleTablePermissions = this.__extractUserGroupEditRuleTablePermissions(user, blockMetaData, record); var tablePermissions = userGroupEditRuleTablePermissions.loggedInUserGroupEditRuleTablePermissions; tablePermissions.push.apply(tablePermissions, _toConsumableArray(userGroupEditRuleTablePermissions.customUserGroupEditRuleTablePermissions)); /* If one of the permissions gives access to all fields then all fields are editable */ var canEditAllFields = tablePermissions.some(function (permission) { return permission.accessLevel === 'TABLE'; }); if (canEditAllFields) { return this.__getTableEditableFields(record.table.fields); } var allEditableFieldNames = new Set(); tablePermissions.forEach(function (permission) { permission.fields.forEach(function (field) { return allEditableFieldNames.add(field); }); }); /* Also filters removed fields */ var allEditableFieldNamesArray = Array.from(allEditableFieldNames); return this.__getTableEditableFields(record.table.fields).filter(function (field) { return !!allEditableFieldNamesArray.find(function (name) { return name === field.name; }); }); } }, { key: "__extractUserGroupEditRuleTablePermissions", value: function __extractUserGroupEditRuleTablePermissions(user, blockMetaData, record) { /* Getting LoggedIn and Custom User Groups */ var customUserGroups = this.__findCustomUserGroupsWhichSupportRecordEditing(user, blockMetaData); var loggedInUserGroup = blockMetaData.userGroups.find(function (group) { return group.type === 'PREDEFINED'; }); /* Getting all the rules associated with LoggedIn and Custom User Groups */ var loggedInUserGroupEditRules = blockMetaData.rules.filter(function (rule) { return rule.userGroupId === loggedInUserGroup.id; }); var customInUserGroupEditRules = []; customUserGroups.forEach(function (group) { var rules = blockMetaData.rules.filter(function (rule) { return rule.userGroupId === group.id; }); if (rules && rules.length) { customInUserGroupEditRules.push.apply(customInUserGroupEditRules, _toConsumableArray(rules)); } }); /* Check if user can edit the record based on LoggedIn User Group rule permission */ /* First find matching permissions to the base and table */ /* TODO can loggedInUserGroupEditRule be null ? */ var loggedInUserGroupEditRuleTablePermissions = []; loggedInUserGroupEditRules.forEach(function (rule) { var permissions = rule.permissions.filter(function (permission) { return permission.baseId === blockMetaData.baseId; }); permissions.forEach(function (permission) { var tablePermissions = permission.tables.filter(function (table) { return table.name === blockMetaData.tableName; }); loggedInUserGroupEditRuleTablePermissions.push.apply(loggedInUserGroupEditRuleTablePermissions, _toConsumableArray(tablePermissions)); }); }); /* Check if user can edit the record based on Custom User Group rule permission */ /* First find matching permissions to the base and table */ /* TODO can customInUserGroupEditRules be null ? */ var customUserGroupEditRuleTablePermissions = []; customInUserGroupEditRules.forEach(function (rule) { var permissions = rule.permissions.filter(function (permission) { return permission.baseId === blockMetaData.baseId; }); permissions.forEach(function (permission) { var tablePermissions = permission.tables.filter(function (table) { return table.name === blockMetaData.tableName; }); customUserGroupEditRuleTablePermissions.push.apply(customUserGroupEditRuleTablePermissions, _toConsumableArray(tablePermissions)); }); }); return { loggedInUserGroupEditRuleTablePermissions: loggedInUserGroupEditRuleTablePermissions, customUserGroupEditRuleTablePermissions: customUserGroupEditRuleTablePermissions }; } }, { key: "__findCustomUserGroupsWhichSupportRecordEditing", value: function __findCustomUserGroupsWhichSupportRecordEditing(user, blockMetaData) { var _this4 = this; /* if we are here we do have custom user groups */ var customGroupIds = blockMetaData.permissions.EDIT.customUserGroupIds; var customGroups = blockMetaData['userGroups'] || []; var userGroups = []; customGroupIds.forEach(function (groupId) { var group = customGroups.find(function (group) { return group.id === groupId; }); if (_this4.__isUserInGroup(user, group)) { userGroups.push(group); } }); return userGroups; } /* Can edit table records */ }, { key: "__canEditAirtableRecords", value: function __canEditAirtableRecords(user, blockMetaData) { /* application doesn't have edit records support */ if (window['application_context'] && window['application_context']['policies'] && !window['application_context']['policies'].hasEditAirtableRecordsSupport) { return false; } /* User is not logged in */ if (!user) { return false; } /* No block metadata */ if (!blockMetaData || !blockMetaData.rules || !blockMetaData.permissions) { return false; } /* Edit is only supported for logged in users, if not there is a bug */ if (blockMetaData.permissions.EDIT.predefinedUserGroupType !== 'LOGGED_IN_USERS') { return false; } /* block doesn't have edit configuration */ /* ToDo needs bug fix*/ if (!blockMetaData.rules.length) { return false; } /* User is logged in and block is editable for only logged in users and (no custom groups) */ if (!blockMetaData.permissions.EDIT.customUserGroupIds.length) { return true; } var userGroups = this.__findCustomUserGroupsWhichSupportRecordEditing(user, blockMetaData); return userGroups.length > 0; } /* Determines if user belongs to the user group */ }, { key: "__isUserInGroup", value: function __isUserInGroup(user, group) { var _this5 = this; if (!group || !group.condition) { return false; } var logicalOperator = group.condition.logicalOperator; var expressions = group.condition.expressions; if (logicalOperator === 'OR') { return expressions.some(function (expression) { var subjectValue = _this5.__extractUserPropertyValue(user, expression.subject); return _this5.__evaluateExpression(expression.operator, subjectValue, expression.value); }); } else if (logicalOperator === 'AND') { return expressions.every(function (expression) { var subjectValue = _this5.__extractUserPropertyValue(user, expression.subject); return _this5.__evaluateExpression(expression.operator, subjectValue, expression.value); }); } return false; } /* Evaluates single expression against user */ }, { key: "__evaluateExpression", value: function __evaluateExpression(operator, subjectValue, expressionValue) { /* ToDO implement */ switch (operator) { case 'IS': return this.__areSetsEqual(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); case 'IS_NOT': return !this.__areSetsEqual(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); case 'IS_EMPTY': return this.__isEmpty(subjectValue); case 'IS_NOT_EMPTY': return !this.__isEmpty(subjectValue); case 'IS_ONE_OF': { var b = this.__isOneOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); if (!b) { subjectValue = this.__convertToArray(subjectValue); b = this.__isOneOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); } return b; } case 'HAS_ALL_OF': { var _b = this.__hasAllOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); if (!_b) { subjectValue = this.__convertToArray(subjectValue); _b = this.__hasAllOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); } return _b; } case 'IS_NONE_OF': { var _b2 = !this.__isOneOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); if (_b2) { subjectValue = this.__convertToArray(subjectValue); _b2 = !this.__isOneOf(this.__convertToSet(subjectValue), this.__convertToSet(expressionValue)); } return _b2; } default: break; } return false; } }, { key: "__convertToArray", value: function __convertToArray(value) { if (this.__isArray(value)) { return value; } if (!value) { return []; } var foundSubstrings = value.match(/"(.*?)"/g); if (foundSubstrings) { foundSubstrings.forEach(function (val) { var valWithoutQuotes = val; if (val.startsWith("\"")) { valWithoutQuotes = valWithoutQuotes.substring(1); } if (val.endsWith("\"")) { valWithoutQuotes = valWithoutQuotes.substring(0, valWithoutQuotes.length - 1); } value = value.replace(val, valWithoutQuotes); value = value.replace(valWithoutQuotes, valWithoutQuotes.replace(',', ';')); }); } var splitted = value.split(','); splitted = splitted.map(function (split) { return split.replace(';', ',').trim(); }); return splitted; } }, { key: "__extractUserPropertyValue", value: function __extractUserPropertyValue(user, property) { if (property === 'USER:EMAIL' || property === '{USER:::EMAIL}') { return user['softr_user_email']; } else if (property === 'USER:EMAIL_DOMAIN' || property === '{USER:::EMAIL_DOMAIN}') { return user['softr_user_email'].split('@')[1]; } else if (property.startsWith('USER:::')) { var propertyName = property.split(':::')[1]; return user[propertyName]; } else if (property.startsWith('USER:')) { var _propertyName = property.replace('USER:', ''); return user[_propertyName]; } return null; } }, { key: "__areSetsEqual", value: function __areSetsEqual(s1, s2) { if (s1.size !== s2.size) return false; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = s1[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var a = _step.value; if (!s2.has(a)) return false; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return true; } }, { key: "__convertToSet", value: function __convertToSet(value) { if (this.__isArray(value)) { value = value.map(function (val) { return val && val.toString().toLowerCase(); }); return new Set(value); } return new Set([value && value.toString().toLowerCase()]); } }, { key: "__isArray", value: function __isArray(value) { return value && Array.isArray(value); } }, { key: "__isEmpty", value: function __isEmpty(value) { return value === undefined || value === null || value === false || !value.length; } }, { key: "__isOneOf", value: function __isOneOf(s1, s2) { var ioo = false; s1.forEach(function (s) { if (!ioo && s2.has(s)) { ioo = true; } }); return ioo; } }, { key: "__hasAllOf", value: function __hasAllOf(s1, s2) { var hao = true; s1.forEach(function (s) { if (hao && !s2.has(s)) { hao = false; } }); return hao; } }, { key: "__isEmail", value: function __isEmail(email) { var emailReg = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return email && emailReg.test(email); } /* __isUrlValid(userInput) { const res = userInput.match(/^(www?|http?|https?|ftp|torrent|image|irc):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/i); return res != null; }*/ }, { key: "__isUrlValid", value: function __isUrlValid(userInput) { var res = userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g); return res != null; } /*File upload*/ }, { key: "__initFileUploadArea", value: function __initFileUploadArea(field) { var _this6 = this; var dragArea = $('#modal-content-' + this.config.recordId + ' #' + field.id); field.value = this.__filterTempUploadedFiles(field); this.__filesToUpload[field.name] = {}; $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').empty(); dragArea.on('dragover', function () { return false; }); dragArea.on('dragleave', function () { return false; }); dragArea.on('dragend', function () { return false; }); dragArea.on('drop', function (e) { e.preventDefault(); _this6.__uploadFiles(e.originalEvent.dataTransfer.files, field, function () { _this6.__rerenderFilesList(field); }); }); $('#modal-content-' + this.config.recordId + ' #' + field.id + '-input').on('change', function (e) { e.preventDefault(); _this6.__uploadFiles($('#modal-content-' + _this6.config.recordId + ' #' + field.id + ' .sw-js-file-input').prop('files'), field, function () { _this6.__rerenderFilesList(field); }); }); this.__rerenderFilesList(field); } }, { key: "__initRecordLinkElement", value: function __initRecordLinkElement(field) { var _this7 = this; var initialValues = []; var record; if (this.__isRecordsStringFormatted) { record = this.__getRecordFromWindow(this.config.recordId); } else { record = this.__jsonFormattedRecord; } if (record && record.fields) { /* Getting the name from formatted record */ var formattedFieldValues = record.fields[field.name]; if (formattedFieldValues) { var formattedFieldValuesArray = formattedFieldValues.match(/(".*?"|[^",]+)(?=\s*,|\s*$)/g); initialValues = formattedFieldValuesArray.map(function (item, index) { item = item.trim(); if (item.startsWith('"') && item.endsWith('"')) { item = item.substring(1, item.length - 1); } return { id: field.value[index], name: item }; }); } } var linkedTableName = field.options.linkedTable.name; var linkedTablePrimaryFieldId = field.options.linkedTable.primaryFieldId; var linkedTablePrimaryField = field.options.linkedTable.fields.find(function (field) { return field.id === linkedTablePrimaryFieldId; }); var selectedIds = initialValues.map(function (item) { return item.id; }); this.__linkedFields[field.name] = selectedIds; $('#modal-content-' + this.config.recordId + ' .' + field.id + '-linked-select').selectize({ items: selectedIds, maxItems: field.options.prefersSingleRecordLink === true ? 1 : null, valueField: "id", labelField: "name", searchField: "name", hideSelected: true, plugins: ["remove_button"], sortField: { field: 'name', direction: 'asc' }, options: initialValues, preload: 'focus', create: false, render: { option: function option(item, escape) { return "
\n ".concat(escape(item.name), "\n
\n "); } }, load: function load(query, callback) { var options = { query: query, tableName: linkedTableName, primaryField: linkedTablePrimaryField }; _this7.__loadLinkedFieldValues(options, callback); }, onChange: function onChange(value) { if (!_this7.__linkedFields[field.name]) { _this7.__linkedFields[field.name] = []; } _this7.__linkedFields[field.name] = value; } }); } }, { key: "__loadLinkedFieldValues", value: function __loadLinkedFieldValues(options, callback) { var url = this.__getAirTableApiUrl(options.tableName); var params = { page_size: 99 }; if (options.query.trim()) { params['filter_by_formula'] = 'OR(' + 'SEARCH("' + options.query.trim().toLowerCase() + '", LOWER(ARRAYJOIN({' + options.primaryField.name + '})))' + ')'; } $.ajax({ url: url, type: 'POST', dataType: 'json', contentType: 'application/json; charset=utf-8', data: JSON.stringify(params), success: function success(res) { if (res && res.records && res.records.length) { var mappedResult = res.records.map(function (record) { return { id: record.id, name: record.fields[options.primaryField.name] }; }); callback(mappedResult); return; } console.log('Empty Result'); callback(); }, error: function error(err) { console.log(err); callback(); } }); } }, { key: "__filterTempUploadedFiles", value: function __filterTempUploadedFiles(field) { var _this8 = this; return field.value ? field.value.filter(function (val) { return !_this8.__tempFilesNames.includes(val.name); }) : []; } }, { key: "__rerenderFilesList", value: function __rerenderFilesList(field) { if (this.__filesToUpload[field.name].length === 0) { $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').addClass('d-none'); $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').removeClass('d-flex'); } else { $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').removeClass('d-none'); $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').addClass('d-flex'); } if (this.__filesToUpload[field.name] === undefined || this.__filesToUpload[field.name] === null) { this.__filesToUpload[field.name] = []; } this.__filesToUpload[field.name] = field.value; this.__createUploadedFiles(field); this.__attachDeleteClickHandler(field); } }, { key: "__createUploadedFiles", value: function __createUploadedFiles(field) { var _this9 = this; var ul = document.createElement('ul'); field.value.forEach(function (file) { var li = document.createElement('li'); var a = document.createElement('a'); li.setAttribute('data-name', _this9.__normalizeFileName(file.name)); var imageBox = document.createElement('div'); var deleteFile = document.createElement("span"); var fileName = document.createElement("span"); deleteFile.className = "delete"; deleteFile.setAttribute('file-name', file.filename); deleteFile.innerHTML = "✕"; imageBox.className = "sw-js-image-box"; var urlParse = file.url.split('.'); var imageTypes = ['png', 'svg', 'jpg', 'jpeg', 'gif']; if (imageTypes.includes(urlParse[urlParse.length - 1])) { imageBox.style.backgroundImage = "url(".concat(file.url, ")"); } else { imageBox.style.backgroundImage = "url(https://softr-staging.imgix.net/applications/04555f4b-5d1a-4213-97ab-f8e1099c17b5/assets/9b09b9ec-0008-401e-98d2-43b92f55e3b3.png)"; } fileName.className = 'file-name'; fileName.innerText = file.name ? file.name : file.filename; a.href = file.url; a.setAttribute('data-lity', ''); a.append(imageBox); li.append(deleteFile); li.append(a); li.append(fileName); ul.appendChild(li); }); $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list').html(ul.innerHTML); } }, { key: "__attachDeleteClickHandler", value: function __attachDeleteClickHandler(field) { var _this10 = this; $('#modal-content-' + this.config.recordId + ' #' + field.id + '-file-list.sw-js-file-list li span.delete').click(function (e) { var fileName = $(e.target).attr('file-name'); var index = _this10.__filesToUpload[field.name].findIndex(function (file) { return file.filename === fileName; }); _this10.__filesToUpload[field.name].splice(index, 1); _this10.__rerenderFilesList(field); $('#modal-content-' + _this10.config.recordId + ' #' + field.id + ' .sw-js-file-input').val(''); }); } }, { key: "__uploadFiles", value: function __uploadFiles(files, field, callback) { var _this11 = this; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { var _loop = function _loop() { var file = _step2.value; var formData = new FormData(); formData.append("file", file); $.ajax({ type: "POST", url: _this11.__getFileUploadUrl(_this11.__applicationId), xhr: function xhr() { var myXhr = $.ajaxSettings.xhr(); return myXhr; }, success: function success(data) { if (_this11.__filesToUpload[field.name] === undefined || _this11.__filesToUpload[field.name] === null) { _this11.__filesToUpload[field.name] = []; } _this11.__filesToUpload[field.name].push({ name: _this11.__normalizeFileName(file.name), url: data, type: file.type }); _this11.__tempFilesNames.push(_this11.__normalizeFileName(file.name)); callback(); }, error: function error(_error) { console.log(_error); }, async: true, data: formData, cache: false, contentType: false, processData: false, timeout: 60000 }); }; for (var _iterator2 = files[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { _loop(); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } }, { key: "__normalizeFileName", value: function __normalizeFileName(name) { var nameClone = String(name); return nameClone.replace(/[^0-9a-zA-Z_-]/gi, ''); } }, { key: "__getFileUploadUrl", value: function __getFileUploadUrl(applicationId) { if (window.location.href.startsWith('file:///')) { return 'http://localhost:8081/v1/applications/' + applicationId + '/upload'; } if (window.location.href.startsWith('http://localhost:')) { return 'http://localhost:8081/v1/applications/' + applicationId + '/upload'; } if (window.location.href.includes('preview.staging.softr.io/')) { return 'https://' + window.location.hostname + '/v1/applications/' + applicationId + '/upload'; } if (window.location.href.includes('preview.softr.io/')) { return 'https://' + window.location.hostname + '/v1/applications/' + applicationId + '/upload'; } else { return 'https://' + window.location.hostname + '/v1/applications/' + applicationId + '/upload'; } } }, { key: "__initSelectPickers", value: function __initSelectPickers(field) { var _this12 = this; if ($("#".concat(this.config.blockId, " select#").concat(field.id)).selectpicker) { $("#".concat(this.config.blockId, " select#").concat(field.id)).selectpicker(); $("#".concat(this.config.blockId, " select#").concat(field.id)).removeClass('d-none'); $("#".concat(this.config.blockId, " select#").concat(field.id)).addClass('d-block'); } else { var existCondition = setInterval(function () { if ($("#".concat(_this12.config.blockId, " select#").concat(field.id)).selectpicker) { $("#".concat(_this12.config.blockId, " select#").concat(field.id)).selectpicker(); $("#".concat(_this12.config.blockId, " select#").concat(field.id)).removeClass('d-none'); $("#".concat(_this12.config.blockId, " select#").concat(field.id)).addClass('d-block'); clearInterval(existCondition); } }, 100); } } }, { key: "__setupDatePicker", value: function __setupDatePicker(field) { var _this13 = this; var selectedDate = field.value; $('#modal-content-' + this.config.recordId + ' input[name="' + field.name + '"][data-type="date"]').each(function (index, el) { var element = $(el).get()[0]; new Litepicker({ element: element, plugins: ['mobilefriendly'], format: 'MMMM D YYYY', dropdowns: { minYear: 1930, maxYear: null, months: false, years: true }, startDate: selectedDate ? new Date(selectedDate.split('T')[0] + 'T00:00:00') : '', setup: function setup(picker) { picker.on('selected', function (date) { console.log(date.format('YYYY-MM-DD')); }); picker.on('change:year', function (date) { $('#modal-content-' + _this13.config.recordId + ' select.month-item-year').selectpicker(); var activeDate = $(element).val().split(' '); activeDate[2] = date.getFullYear(); picker.setDate(activeDate.join('-')); picker.hide(); picker.show(); }); picker.on('change:month', function () { $('#modal-content-' + _this13.config.recordId + ' select.month-item-year').selectpicker(); }); picker.on('show', function (el) { $('#modal-content-' + _this13.config.recordId + ' select.month-item-year').selectpicker(); }); } }); }); } }, { key: "__setupDateTimePicker", value: function __setupDateTimePicker(field) { var _this14 = this; var selectedDate = field.value; var date = ''; var time = ''; var splitTime = []; var selectedTime = ''; if (selectedDate) { date = selectedDate.split('T')[0]; time = selectedDate.split('T')[1]; splitTime = time.split(':'); selectedTime = "".concat(splitTime[0], ":").concat(splitTime[1]); } $('#modal-content-' + this.config.recordId + ' input[name="' + field.name + '"][data-type="dateTime"]').each(function (index, el) { var element = $(el).get()[0]; new Litepicker({ element: element, plugins: ['mobilefriendly'], format: 'MMMM D YYYY', dropdowns: { minYear: 1930, maxYear: null, months: false, years: true }, startDate: selectedDate ? new Date(date + 'T00:00:00') : '', setup: function setup(picker) { picker.on('selected', function (date) { var selectElement = $(element)[0].nextElementSibling.querySelector('select'); $(element)[0].nextElementSibling.classList.remove('prevent-click'); var selectedTime = selectElement.getAttribute('data-time-formatted-value'); if (!selectedTime) { selectElement.value = '00:00'; selectedTime = '00:00'; $('#modal-content-' + _this14.config.recordId + ' select[name="TIME:::' + field.name + '"][data-type="time"]').trigger('change'); } _this14.__setDateTimeAttribute(element, date.format('YYYY-MM-DD'), selectedTime); _this14.__removeSelectDefaultPlaceholder(); }); picker.on('change:year', function (date) { $('#modal-content-' + _this14.config.recordId + ' select.month-item-year').selectpicker(); var activeDate = $(element).attr('data-datetime-formatted-value').split('-'); activeDate[0] = date.getFullYear(); picker.setDate(activeDate.join('-')); picker.hide(); picker.show(); }); picker.on('change:month', function () { $('#modal-content-' + _this14.config.recordId + ' select.month-item-year').selectpicker(); }); picker.on('show', function (el) { $('#modal-content-' + _this14.config.recordId + ' select.month-item-year').selectpicker(); }); } }); var selectElement = $(element)[0].nextElementSibling.querySelector('select'); selectElement.setAttribute('data-time-formatted-value', selectedTime); if (selectedDate && selectedDate.length) { var _selectElement = $(element)[0].nextElementSibling.querySelector('select'); _selectElement.value = selectedTime; $('#modal-content-' + _this14.config.recordId + ' select[name="TIME:::' + field.name + '"][data-type="time"]').trigger('change'); $(element)[0].nextElementSibling.classList.remove('prevent-click'); } _this14.__setDateTimeAttribute(element, date, selectedTime); }); $('#modal-content-' + this.config.recordId + ' select[name="TIME:::' + field.name + '"][data-type="time"]').change(function (e) { var element = $(e.currentTarget).get()[0]; var dateInputElement = $(element)[0].parentElement.previousElementSibling; var selectedTime = e.target.value; $(element).attr('data-time-formatted-value', selectedTime); var selectedDate = dateInputElement.getAttribute('data-datetime-formatted-value'); if (selectedDate) { selectedDate = selectedDate.split(' ')[0]; } _this14.__setDateTimeAttribute(dateInputElement, selectedDate, selectedTime); _this14.__removeSelectDefaultPlaceholder(); }); setTimeout(function () { return _this14.__removeSelectDefaultPlaceholder(); }, 100); } }, { key: "__initRichTextEditor", value: function __initRichTextEditor(initialValue, id) { return new toastui.Editor({ el: document.querySelector('#modal-content-' + this.config.recordId + ' #' + id + '-rich-editor'), previewStyle: 'tab', height: '250px', initialValue: initialValue, initialEditType: 'wysiwyg', autofocus: false, toolbarItems: [['heading', 'bold', 'italic', 'strike'], ['hr', 'quote', 'ul', 'ol', 'task', 'image'], ['table', 'link', 'code', 'codeblock']] }); } }, { key: "__setDateTimeAttribute", value: function __setDateTimeAttribute(element, date, time) { element.setAttribute('data-datetime-formatted-value', date + ' ' + time); } }, { key: "__removeSelectDefaultPlaceholder", value: function __removeSelectDefaultPlaceholder() { setTimeout(function () { _toConsumableArray(document.querySelectorAll('[class*="filter-option-inner-inner"]')).forEach(function (txt) { if (txt && txt.innerHTML.includes('Nothing selected')) { txt.innerHTML = ''; } }); }); } }, { key: "__getRecordFromWindow", value: function __getRecordFromWindow(recordId) { if (window.records && window.records[recordId] && window.records[recordId].record) { return window.records[recordId].record; } return null; } }, { key: "__getJsonFormattedRecord", value: function __getJsonFormattedRecord() { return this.__jsonFormattedRecord; } }, { key: "__renderEditableFields", value: function __renderEditableFields() { var _this15 = this; var record; if (this.__isRecordsStringFormatted) { record = this.__getJsonFormattedRecord(); } else { record = this.__getRecordFromWindow(this.config.recordId); } var editableFields = this.__extractEditableFields(this.config.user, this.config.blockMetaData, record); editableFields.forEach(function (field) { field.value = record.fields[field.name]; }); $('#modal-content-' + this.config.recordId).empty(); // pickers = []; this.__filesToUpload = {}; this.__linkedFields = {}; editableFields.forEach(function (field) { var element = null; switch (field.type) { case 'singleLineText': case 'url': case 'email': case 'number': case 'percent': case 'currency': case 'phoneNumber': field.value = field.value === undefined ? '' : field.value; element = _this15.__createInputElement(field); break; case 'multilineText': element = _this15.__createTextAreaElement(field); break; case 'richText': element = _this15.__createRichTexAreaElement(field); var richTextFieldValue = field.value; var richTextFieldId = field.id; var richTextFieldName = field.name; setTimeout(function () { var editor = _this15.__initRichTextEditor(richTextFieldValue, richTextFieldId); _this15.__richTextEditors[richTextFieldName] = editor; }, 200); break; case 'checkbox': element = _this15.__createCheckboxElement(field); break; case 'singleSelect': element = _this15.__createSingleSelectElement(field); setTimeout(function () { $('#modal-content-' + _this15.config.recordId + ' select#' + field.id).selectpicker('val', field.value); }, 200); break; case 'multipleSelects': element = _this15.__createMultiSelectElement(field); setTimeout(function () { field.value = field.value || []; field.value = field.value.filter(function (v) { return v.trim(); }); $('#modal-content-' + _this15.config.recordId + ' select#' + field.id).selectpicker('val', field.value); }, 200); break; case 'date': element = _this15.__createDateElement(field); setTimeout(function () { return _this15.__setupDatePicker(field); }, 100); break; case 'dateTime': element = _this15.__createDateTimeElement(field); setTimeout(function () { _this15.__initSelectPickers(field); _this15.__setupDateTimePicker(field, element); }, 200); break; case 'multipleAttachments': element = _this15.__createFileUploadElement(field); setTimeout(function () { return _this15.__initFileUploadArea(field); }, 100); break; case 'multipleRecordLinks': element = _this15.__createRecordLinkElement(field); setTimeout(function () { return _this15.__initRecordLinkElement(field); }, 100); break; } $('#modal-content-' + _this15.config.recordId).append(element); _this15.__initSelectPickers(field); _this15.__removeSelectDefaultPlaceholder(); }); $('#modal-content-' + this.config.recordId + ' .sw-input-element[data-type=email]').on('keyup', function (e) { if (e.target.value && !_this15.__isEmail(e.target.value)) { $(e.currentTarget).parent().addClass('email-error'); } else { $(e.currentTarget).parent().removeClass('email-error'); } _this15.__checkSubmitButtonActiveState(); }); $('#modal-content-' + this.config.recordId + ' .sw-input-element[data-type=url]').on('keyup', function (e) { if (e.target.value && !_this15.__isUrlValid(e.target.value)) { $(e.currentTarget).parent().addClass('url-error'); } else { $(e.currentTarget).parent().removeClass('url-error'); } _this15.__checkSubmitButtonActiveState(); }); setTimeout(function () { return $('#modal-content-' + _this15.config.recordId).scrollTop(0); }, 200); } }, { key: "__checkSubmitButtonActiveState", value: function __checkSubmitButtonActiveState() { if ($('.email-error').length || $('.url-error').length) { $('#modal-save-' + this.config.recordId).addClass('invalid'); } else { $('#modal-save-' + this.config.recordId).removeClass('invalid'); } } }, { key: "__validateEmailsAndUrlsBeforeSave", value: function __validateEmailsAndUrlsBeforeSave() { var _this16 = this; $('#modal-content-' + this.config.recordId + ' .sw-input-element').each(function (index, e) { switch (e.getAttribute('data-type')) { case 'email': if (e.value && !_this16.__isEmail(e.value)) { $(e).parent().addClass('email-error'); } break; case 'url': if (e.value && !_this16.__isUrlValid(e.value)) { $(e).parent().addClass('url-error'); } break; } }); } }, { key: "__submitForm", value: function __submitForm() { var _this17 = this; this.__validateEmailsAndUrlsBeforeSave(); if ($('.email-error').length || $('.url-error').length) { return; } $('#modal-save-' + this.config.recordId).addClass('loading'); var formJson = {}; var formData = new FormData(document.querySelector('#modal-form-' + this.config.recordId)); var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = formData.entries()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var pair = _step3.value; formJson[pair[0]] = pair[1]; } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return != null) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } this.__addMultipleSelectValuesToFormJson(formJson); this.__addRichTextValuesToFormJson(formJson); this.__addDateTimeValuesToFormJson(formJson); this.__addCheckboxValuesToFormJson(formJson); this.__addPercentValuesToFormJson(formJson); this.__addAttachmentsToFormJson(formJson); this.__addLinkedFieldsToFormJson(formJson); Object.keys(formJson).forEach(function (key) { if (_this17.__isString(formJson[key])) { formJson[key] = formJson[key].trim(); } }); this.__updateAirtableRecord(formJson, function (data) { if (_this17.__isRecordsStringFormatted && !_this17.__isDetailsPage()) { _this17.__getAirtableRecord({ recordId: _this17.config.recordId, format: _this17.__isRecordsStringFormatted ? 'string' : 'json' }, function (data) { _this17.__updateRecordSuccessCallback(data); }, function (err) { _this17.__updateRecordErrorCallback(); }); } else { _this17.__updateRecordSuccessCallback(data); } }, function (err) { _this17.__updateRecordErrorCallback(); }); } }, { key: "__isDetailsPage", value: function __isDetailsPage() { var url = window.location.href; return url.indexOf('?recordId=rec') > 0 || url.indexOf('&recordId=rec') > 0 || url.indexOf('/r/rec') > 0; } }, { key: "__updateRecordSuccessCallback", value: function __updateRecordSuccessCallback(data) { var _this18 = this; $('#modal-content-' + this.config.recordId + ' .sw-error-tag').addClass('d-none'); /** ToDo reload via callback */ this.config.onSuccess(data); setTimeout(function () { $('#modal-save-' + _this18.config.recordId).removeClass('loading'); $('[data-micromodal-close]').trigger('click'); }, 2000); } }, { key: "__updateRecordErrorCallback", value: function __updateRecordErrorCallback(data) { $('#modal-content-' + this.config.recordId + ' .sw-error-tag').removeClass('d-none'); this.config.onError(); } }, { key: "__addLinkedFieldsToFormJson", value: function __addLinkedFieldsToFormJson(formJson) { var _this19 = this; console.log(this.__linkedFields); Object.keys(this.__linkedFields).forEach(function (elm) { formJson[elm] = _this19.__linkedFields[elm]; }); } }, { key: "__addAttachmentsToFormJson", value: function __addAttachmentsToFormJson(formJson) { var _this20 = this; Object.keys(this.__filesToUpload).forEach(function (elm) { formJson[elm] = _this20.__filesToUpload[elm].map(function (file) { if (file.id) { return { id: file.id }; } else if (file.url) { return { url: file.url }; } }); formJson[elm] = formJson[elm].filter(function (each) { if (each) { return Object.keys(each).length !== 0; } }); }); } }, { key: "__addDateTimeValuesToFormJson", value: function __addDateTimeValuesToFormJson(formJson) { $('#modal-content-' + this.config.recordId + ' input[data-type="dateTime"]').each(function (i, el) { var name = $(el).attr('name'); var timeValue = $(el).next().find('select').val(); formJson[name] = "".concat($(el).val(), " ").concat(timeValue); delete formJson["TIME:::".concat(name)]; }); } }, { key: "__addCheckboxValuesToFormJson", value: function __addCheckboxValuesToFormJson(formJson) { $('#modal-content-' + this.config.recordId + ' .sw-checkbox.sw-form-element input').each(function (index, element) { if ($(element).prop('checked')) { formJson[$(element).attr('name')] = true; } else { formJson[$(element).attr('name')] = false; } }); } }, { key: "__addPercentValuesToFormJson", value: function __addPercentValuesToFormJson(formJson) { $('#modal-content-' + this.config.recordId + ' .sw-form-element input[data-type="percent"]').each(function (index, element) { if ($(element).val() === '') { formJson[$(element).attr('name')] = 0; } else { formJson[$(element).attr('name')] = $(element).val() / 100; } }); } }, { key: "__addMultipleSelectValuesToFormJson", value: function __addMultipleSelectValuesToFormJson(formJson) { $('#modal-content-' + this.config.recordId + ' select[data-type="multipleSelects"]').each(function (index, element) { var selected = $(element).find('option:selected').map(function () { return $(this).text(); }).get(); var name = $(element).attr('name'); formJson[name] = selected; }); } }, { key: "__addRichTextValuesToFormJson", value: function __addRichTextValuesToFormJson(formJson) { Object.entries(this.__richTextEditors).forEach(function (el) { formJson[el[0]] = el[1].getMarkdown(); }); } }, { key: "__updateAirtableRecord", value: function __updateAirtableRecord(payload, successCallback, errorCallback) { var url = this.__getAirTableApiUrl(); var recordId = this.config.recordId; url = url + '/' + recordId; var newPayload = { fields: payload, typecast: true }; $.ajax({ url: url, type: 'PATCH', processData: false, data: JSON.stringify(newPayload), contentType: 'application/json; charset=utf-8', success: function success(data) { console.log(data); successCallback(data); }, error: function error(_error2) { console.log(_error2); if (_error2 && _error2.responseJSON && _error2.responseJSON.message) ; errorCallback(_error2); } }); } }, { key: "__getAirtableRecord", value: function __getAirtableRecord(options, successCallback, errorCallback) { var url = this.__getAirTableApiUrl(); var recordId = options.recordId; var format = options.format; var enriched = options.enriched; url = url + '/' + recordId + '?1=1'; if (format) { url = url + '&format=' + format; } if (enriched) { url = url + '&enriched=true'; } $.ajax({ url: url, type: 'GET', dataType: 'json', contentType: 'application/json; charset=utf-8', success: function success(data) { console.log(data); successCallback(data); }, error: function error(_error3) { console.log(_error3); if (_error3 && _error3.responseJSON && _error3.responseJSON.message) ; errorCallback(_error3); } }); } }, { key: "__getAirTableApiUrl", value: function __getAirTableApiUrl(__tableName) { var baseId = this.config.blockMetaData.baseId; var tableName = __tableName || this.config.blockMetaData.tableName; if (window.location.href.startsWith('file:///')) { return 'http://localhost:8080/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } if (window.location.href.startsWith('http://localhost:')) { return 'http://localhost:8080/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } if (window.location.href.startsWith('https://studio-staging.softr.io/')) { return 'https://studio-api-staging.softr.io/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } if (window.location.href.startsWith('https://studio.softr.io/')) { return 'https://studio-api.softr.io/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } if (window.location.href.includes('preview.staging.softr.io/')) { return 'https://' + window.location.hostname + '/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } if (window.location.href.includes('preview.softr.io/')) { return 'https://' + window.location.hostname + '/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } else { return 'https://' + window.location.hostname + '/v1/integrations/airtable/' + this.__applicationId + '/' + baseId + '/' + tableName + '/records'; } } }, { key: "__appendScript", value: function __appendScript(filePath, callback) { if ($('head script[src="' + filePath + '"]').length > 0) { if (callback) { setTimeout(callback, 100); } return; } var ds = document.createElement('script'); ds.setAttribute("type", "text/javascript"); ds.setAttribute("src", filePath); ds.onload = function () { if (callback) callback(); }; document.head.appendChild(ds); } }, { key: "__appendStyle", value: function __appendStyle(filepath) { if ($('head link[href="' + filepath + '"]').length > 0) return; var ele = document.createElement('link'); ele.setAttribute("type", "text/css"); ele.setAttribute("rel", "Stylesheet"); ele.setAttribute("href", filepath); $('head').append(ele); } }, { key: "__isString", value: function __isString(value) { return typeof value === 'string'; } }, { key: "__generateTimeIntervalArray", value: function __generateTimeIntervalArray(minInterval) { var is12Hours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var aMpM = ['AM', 'PM']; var startTime = 0; var times = []; for (var i = 0; startTime < 24 * 60; i++) { /*getting hours of day in 0-24 format*/ var hours = Math.floor(startTime / 60); /*getting minutes of the hour in 0-55 format*/ var minutes = startTime % 60; /* pushing data in array in [00:00 - 12:00 AM/PM format]*/ times[i] = ("0" + hours % (is12Hours ? 12 : 24)).slice(-2) + ':' + ("0" + minutes).slice(-2) + (is12Hours ? aMpM[Math.floor(hours / 12)] : ''); startTime += minInterval; } return times; } }, { key: "__getTableEditableFields", value: function __getTableEditableFields(fields) { /*filter non editable fields*/ return fields.filter(function (field) { return !field.name.toLowerCase().startsWith('seo:') && !field.name.toLowerCase().startsWith('social:') && field.type.toLowerCase() !== 'formula' && field.type.toLowerCase() !== 'autonumber' && field.type.toLowerCase() !== 'barcode' && field.type.toLowerCase() !== 'button' && field.type.toLowerCase() !== 'rollup'; }); } }]); return AirtableRecordEditor; }(); exports.newInstance = newInstance; Object.defineProperty(exports, '__esModule', { value: true }); }));
الفقه و الدين
المذيد
الكل
المذيد
المعاجم والمجلات
المذيد
-
الهيئة العامة الصرية للكتاب
المذيد
تاريخ وجغرافيا
المذيد
روايات وادب عربي وعالمي
المذيد
شعر
المذيد
فكر وفلسقة ومعارف
المذيد
متنوعة
المذيد
مشروع كلمة
المذيد
مصورات مكتبة الاسكندرية
المذيد
مكتبة المجمع العربي للنشر والتوزيع
المذيد
No results found, try adjusting your search and filters.
Something went wrong, contact us if refreshing doesn’tfix this.
Loading...
See more
background:#aba; margin:0; padding:20px 10px; text-align:center; font:x-small/1.5em "Trebuchet MS",Verdana,Arial,Sans-serif; color:#333; font-size/* */:/**/small; font-size: /**/small; } /* Page Structure ----------------------------------------------- */ /* The images which help create rounded corners depend on the following widths and measurements. If you want to change these measurements, the images will also need to change. */ @media all { #content { width:740px; margin:0 auto; text-align:left; } #main { width:485px; float:left; background:#fff url("https://resources.blogblog.com/blogblog/data/rounders/corners_main_bot.gif") no-repeat left bottom; margin:15px 0 0; padding:0 0 10px; color:#000; font-size:97%; line-height:1.5em; } #main2 { float:left; width:100%; background:url("https://resources.blogblog.com/blogblog/data/rounders/corners_main_top.gif") no-repeat left top; padding:10px 0 0; } #main3 { background:url("https://resources.blogblog.com/blogblog/data/rounders/rails_main.gif") repeat-y; padding:0; } #sidebar { width:240px; float:right; margin:15px 0 0; font-size:97%; line-height:1.5em; } } @media handheld { #content { width:90%; } #main { width:100%; float:none; background:#fff; } #main2 { float:none; background:none; } #main3 { background:none; padding:0; } #sidebar { width:100%; float:none; } } /* Links ----------------------------------------------- */ a:link { color:#258; } a:visited { color:#666; } a:hover { color:#c63; } a img { border-width:0; } /* Blog Header ----------------------------------------------- */ @media all { #header { background:#456 url("https://resources.blogblog.com/blogblog/data/rounders/corners_cap_top.gif") no-repeat left top; margin:0 0 0; padding:8px 0 0; color:#fff; } #header div { background:url("https://resources.blogblog.com/blogblog/data/rounders/corners_cap_bot.gif") no-repeat left bottom; padding:0 15px 8px; } } @media handheld { #header { background:#456; } #header div { background:none; } } #blog-title { margin:0; padding:10px 30px 5px; font-size:200%; line-height:1.2em; } #blog-title a { text-decoration:none; color:#fff; } #description { margin:0; padding:5px 30px 10px; font-size:94%; line-height:1.5em; } /* Posts ----------------------------------------------- */ .date-header { margin:0 28px 0 43px; font-size:85%; line-height:2em; text-transform:uppercase; letter-spacing:.2em; color:#357; } .post { margin:.3em 0 25px; padding:0 13px; border:1px dotted #bbb; border-width:1px 0; } .post-title { margin:0; font-size:135%; line-height:1.5em; background:url("https://resources.blogblog.com/blogblog/data/rounders/icon_arrow.gif") no-repeat 10px .5em; display:block; border:1px dotted #bbb; border-width:0 1px 1px; padding:2px 14px 2px 29px; color:#333; } a.title-link, .post-title strong { text-decoration:none; display:block; } a.title-link:hover { background-color:#ded; color:#000; } .post-body { border:1px dotted #bbb; border-width:0 1px 1px; border-bottom-color:#fff; padding:10px 14px 1px 29px; } html>body .post-body { border-bottom-width:0; } .post p { margin:0 0 .75em; } p.post-footer { background:#ded; margin:0; padding:2px 14px 2px 29px; border:1px dotted #bbb; border-width:1px; border-bottom:1px solid #eee; font-size:100%; line-height:1.5em; color:#666; text-align:right; } html>body p.post-footer { border-bottom-color:transparent; } p.post-footer em { display:block; float:left; text-align:left; font-style:normal; } a.comment-link { /* IE5.0/Win doesn't apply padding to inline elements, so we hide these two declarations from it */ background/* */:/**/url("https://resources.blogblog.com/blogblog/data/rounders/icon_comment.gif") no-repeat 0 45%; padding-left:14px; } html>body a.comment-link { /* Respecified, for IE5/Mac's benefit */ background:url("https://resources.blogblog.com/blogblog/data/rounders/icon_comment.gif") no-repeat 0 45%; padding-left:14px; } .post img { margin:0 0 5px 0; padding:4px; border:1px solid #ccc; } blockquote { margin:.75em 0; border:1px dotted #ccc; border-width:1px 0; padding:5px 15px; color:#666; } .post blockquote p { margin:.5em 0; } /* Comments ----------------------------------------------- */ #comments { margin:-25px 13px 0; border:1px dotted #ccc; border-width:0 1px 1px; padding:20px 0 15px 0; } #comments h4 { margin:0 0 10px; padding:0 14px 2px 29px; border-bottom:1px dotted #ccc; font-size:120%; line-height:1.4em; color:#333; } #comments-block { margin:0 15px 0 9px; } .comment-data { background:url("https://resources.blogblog.com/blogblog/data/rounders/icon_comment.gif") no-repeat 2px .3em; margin:.5em 0; padding:0 0 0 20px; color:#666; } .comment-poster { font-weight:bold; } .comment-body { margin:0 0 1.25em; padding:0 0 0 20px; } .comment-body p { margin:0 0 .5em; } .comment-timestamp { margin:0 0 .5em; padding:0 0 .75em 20px; color:#666; } .comment-timestamp a:link { color:#666; } .deleted-comment { font-style:italic; color:gray; } .paging-control-container { float: right; margin: 0px 6px 0px 0px; font-size: 80%; } .unneeded-paging-control { visibility: hidden; } /* Profile ----------------------------------------------- */ @media all { #profile-container { background:#cdc url("https://resources.blogblog.com/blogblog/data/rounders/corners_prof_bot.gif") no-repeat left bottom; margin:0 0 15px; padding:0 0 10px; color:#345; } #profile-container h2 { background:url("https://resources.blogblog.com/blogblog/data/rounders/corners_prof_top.gif") no-repeat left top; padding:10px 15px .2em; margin:0; border-width:0; font-size:115%; line-height:1.5em; color:#234; } } @media handheld { #profile-container { background:#cdc; } #profile-container h2 { background:none; } } .profile-datablock { margin:0 15px .5em; border-top:1px dotted #aba; padding-top:8px; } .profile-img {display:inline;} .profile-img img { float:left; margin:0 10px 5px 0; border:4px solid #fff; } .profile-data strong { display:block; } #profile-container p { margin:0 15px .5em; } #profile-container .profile-textblock { clear:left; } #profile-container a { color:#258; } .profile-link a { background:url("https://resources.blogblog.com/blogblog/data/rounders/icon_profile.gif") no-repeat 0 .1em; padding-left:15px; font-weight:bold; } ul.profile-datablock { list-style-type:none; } /* Sidebar Boxes ----------------------------------------------- */ @media all { .box { background:#fff url("https://resources.blogblog.com/blogblog/data/rounders/corners_side_top.gif") no-repeat left top; margin:0 0 15px; padding:10px 0 0; color:#666; } .box2 { background:url("https://resources.blogblog.com/blogblog/data/rounders/corners_side_bot.gif") no-repeat left bottom; padding:0 13px 8px; } } @media handheld { .box { background:#fff; } .box2 { background:none; } } .sidebar-title { margin:0; padding:0 0 .2em; border-bottom:1px dotted #9b9; font-size:115%; line-height:1.5em; color:#333; } .box ul { margin:.5em 0 1.25em; padding:0 0px; list-style:none; } .box ul li { background:url("https://resources.blogblog.com/blogblog/data/rounders/icon_arrow_sm.gif") no-repeat 2px .25em; margin:0; padding:0 0 3px 16px; margin-bottom:3px; border-bottom:1px dotted #eee; line-height:1.4em; } .box p { margin:0 0 .6em; } /* Footer ----------------------------------------------- */ #footer { clear:both; margin:0; padding:15px 0 0; } @media all { #footer div { background:#456 url("https://resources.blogblog.com/blogblog/data/rounders/corners_cap_top.gif") no-repeat left top; padding:8px 0 0; color:#fff; } #footer div div { background:url("https://resources.blogblog.com/blogblog/data/rounders/corners_cap_bot.gif") no-repeat left bottom; padding:0 15px 8px; } } @media handheld { #footer div { background:#456; } #footer div div { background:none; } } #footer hr {display:none;} #footer p {margin:0;} #footer a {color:#fff;} /* Feeds ----------------------------------------------- */ #blogfeeds { } #postfeeds { padding:0 15px 0; }
khiallibrary
من أنا
الاسم:
مكتبة خيال
عرض الملف الشخصي الكامل الخاص بي
الوصلات
Google News
Edit-Me
Edit-Me
الرسائل السابقة
الأرشيفات
الاشتراك في
التعليقات [
Atom
]